Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDuplicatedName = errors.New("duplicated form name")
Functions ¶
func NewForm ¶
func NewForm(config FormConfig, options ...FormOption) http.HandlerFunc
Types ¶
type AMQPFactory ¶ added in v0.3.0
type AMQPFactory interface {
Create(definition schema.AMQP) notifications.Notification
}
type Config ¶
type Config struct {
Forms []schema.Form
Storage Storage
WebhooksFactory WebhooksFactory
AMQPFactory AMQPFactory
Listing bool
Captcha []web.Captcha
}
type FormConfig ¶
type FormConfig struct {
Definition schema.Form // schema definition
ViewForm *template.Template // template to show main form
ViewSuccess *template.Template // template to show result (success) after submit
ViewFail *template.Template // template to show result (fail) after submit
ViewCode *template.Template // template to show code access
ViewForbidden *template.Template // template to show access denied
Storage Storage // where to store data
WebhooksFactory WebhooksFactory
AMQPFactory AMQPFactory
XSRF bool // check XSRF token. Disable if form is exposed as API.
Captcha []web.Captcha
}
type FormOption ¶
type FormOption func(config *FormConfig)
func WithXSRF ¶
func WithXSRF(enable bool) FormOption
type WebhooksFactory ¶ added in v0.3.0
type WebhooksFactory interface {
Create(webhook schema.Webhook) notifications.Notification
}
Click to show internal directories.
Click to hide internal directories.