octopot / forma Goto Github PK
View Code? Open in Web Editor NEW๐ Data Collector as a Service.
Home Page: https://hugs.octolab.net
License: MIT License
๐ Data Collector as a Service.
Home Page: https://hugs.octolab.net
License: MIT License
e.g. encoder (it is request-specific)
Provide information about CSRF-free and rate limit protection
need to support renderer with json, xml, html and plain text formats
parse:
Accept: text/html
Accept: image/*
Accept: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8
/* TODO for GetV1
supported := map[string]string{
"json": "application/json",
//"toml": "application/toml",
//"xml": "application/xml",
//"yaml": "application/yaml",
}
format := strings.ToLower(req.URL.Query().Get("format"))
if format == "" {
format = "json"
}
ct, ok := supported[format]
if !ok {
http.Error(rw, "Unsupported output format.", http.StatusUnsupportedMediaType)
return
}
rw.Header().Set("Content-Type", ct)
fmt.Fprintf(rw, "get form schema in format %q with Content-Type %q", format, ct)
*/
MVP should support JSON only, but REST should be ready for
## Feedback
[![@kamilsk](https://img.shields.io/badge/author-%40ikamilsk-blue.svg)](https://twitter.com/ikamilsk)
[![@octolab](https://img.shields.io/badge/sponsor-%40octolab-blue.svg)](https://twitter.com/octolab_inc)
## Notes
- made with โค๏ธ by [OctoLab](https://www.octolab.org/)
$ form-api run --demo
should be insert fake data
also, need to separate it with dev section in docker-compose.yml
form:
id: ...
{"form": {
"id": ...
}}
var data url.Values = request.PostForm()
filtered := schema.Apply(data)
validated := schema.Validate(filtered)
Continue of issue #29
var data url.Values = request.PostForm()
filtered := schema.Apply(data)
validated := schema.Validate(filtered)
cmd/root.go:14:5:warning: exported var RootCmd should have comment or be unexported (golint)
dao/layer.go:15:36:warning: exported func Must returns unexported type *dao.layer, which can be annoying to use (golint)
dao/layer.go:24:36:warning: exported func New returns unexported type *dao.layer, which can be annoying to use (golint)
dao/layer_test.go:96:12:warning: ineffectual assignment to err (ineffassign)
dao/postgres/postgres.go:36:25:warning: uuid can be fmt.Stringer (interfacer)
errors/error.go:11:2:warning: exported const ServerError should have comment (or a comment on this block) or be unexported (golint)
errors/error.go:17:64:warning: exported func NotFound returns unexported type *errors.withCode, which can be annoying to use (golint)
errors/error.go:22:66:warning: exported func Validation returns unexported type *errors.withCode, which can be annoying to use (golint)
errors/error.go:27:64:warning: exported func Database returns unexported type *errors.withCode, which can be annoying to use (golint)
errors/error.go:32:69:warning: exported func Serialization returns unexported type *errors.withCode, which can be annoying to use (golint)
errors/error.go:6:2:warning: exported const ResourceNotFound should have comment (or a comment on this block) or be unexported (golint)
server/error.go:67:1:warning: comment on exported method Error.InvalidReferer should be of the form "InvalidReferer ..." (golint)
server/error.go:77:1:warning: exported method Error.FromGetV1 should have comment or be unexported (golint)
server/middleware.go:13:14:warning: next can be http.Handler (interfacer)
server/middleware.go:35:34:warning: error return value not checked (err.NotProvidedUUID().MarshalTo(rw)) (errcheck)
server/middleware.go:39:30:warning: error return value not checked (err.InvalidUUID().MarshalTo(rw)) (errcheck)
server/server.go:19:34:warning: exported func New returns unexported type *server.server, which can be annoying to use (golint)
server/server.go:37:46:warning: error return value not checked (httpErr.FromGetV1(response.Error).MarshalTo(rw)) (errcheck)
server/server.go:40:12:warning: error return value not checked (enc.Encode(response.Schema)) (errcheck)
server/server.go:50:41:warning: error return value not checked (httpErr.InvalidFormData(err).MarshalTo(rw)) (errcheck)
server/server.go:56:32:warning: error return value not checked (httpErr.NoReferer().MarshalTo(rw)) (errcheck)
server/server.go:62:40:warning: error return value not checked (httpErr.InvalidReferer(err).MarshalTo(rw)) (errcheck)
service/service.go:6:25:warning: exported func New returns unexported type *service.formAPI, which can be annoying to use (golint)
static/static.go:101:6:warning: func staticTemplateErrorHtml should be staticTemplateErrorHTML (golint)
static/static.go:72:5:warning: don't use underscores in Go names; var _staticMigrations1_initialSql should be _staticMigrations1InitialSQL (golint)
static/static.go:74:6:warning: don't use underscores in Go names; func staticMigrations1_initialSqlBytes should be staticMigrations1InitialSQLBytes (golint)
static/static.go:81:6:warning: don't use underscores in Go names; func staticMigrations1_initialSql should be staticMigrations1InitialSQL (golint)
static/static.go:92:5:warning: var _staticTemplateErrorHtml should be _staticTemplateErrorHTML (golint)
static/static.go:94:6:warning: func staticTemplateErrorHtmlBytes should be staticTemplateErrorHTMLBytes (golint)
need to create separate tasks for all packages
/bin/sh -c "su - postgres -c psql"
and show a page with validation error before a redirect
{{ schema }}{{ user }}:{{ pass }}@{{ host }}/docs/
$ make stress-test
semaphore create 2
semaphore add -- curl -O http://user:pass@localhost:8080/debug/
semaphore add -- hey -cpu=2 localhost:8080/api/v1/{schema}
semaphore wait
current work with errors not optimal:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.