Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(storeLayer store.StoreLayer) *appLayer
Types ¶
type AppLayer ¶
type AppLayer interface {
AuthenticateUser(username string, password string) (*UserInternal, error)
CheckRole(userRole string, requiredRole string) bool
CreateSubmission(slug string, ipAddress string, userAgent string, values map[string]string) (*SubmissionInternal, error)
DeleteSubmission(id uint) error
DuplicateForm(slug string) (*FormInternal, error)
GetForm(slug string) (*FormInternal, error)
GetFormsForUser(userId uint) (*[]FormInternal, error)
GetSubmissionsForForm(slug string, userId uint) (*[]SubmissionsInternal, error)
GetUser(userId uint) (*UserInternal, error)
ValidatePassword(user *UserInternal, password string) error
ValidateUser(userId uint) error
ValidateRecaptchaToken(token string, clientIp string) error
ValidateSubmissionWithForm(submission map[string]string, form *FormInternal) []error
UpdatePassword(user *UserInternal, password string) error
}
type EmailSubmissionData ¶
type FormFieldInternal ¶
type FormFieldInternal struct {
Name string
Slug string
Type string
Metadata *interface{}
Required bool
Validation string
Order uint
}
func (*FormFieldInternal) Internalize ¶
func (f *FormFieldInternal) Internalize(field *store.FormField)
type FormInternal ¶
type FormInternal struct {
Slug string
Name string
Template string
OpensOn *time.Time
ClosesOn *time.Time
Submissions uint
MaxSubmissions uint
Fields map[string]*FormFieldInternal
RecaptchaSiteKey string
NotOpenMessage string
ClosedMessage string
SuccessMessage string
}
func (*FormInternal) Internalize ¶
func (*FormInternal) IsAfterFormClose ¶
func (f *FormInternal) IsAfterFormClose() bool
func (*FormInternal) IsBeforeFormOpen ¶
func (f *FormInternal) IsBeforeFormOpen() bool
func (*FormInternal) IsFormFilled ¶
func (f *FormInternal) IsFormFilled() bool
type SiteVerifyResponse ¶
type SubmissionInternal ¶
func (*SubmissionInternal) Internalize ¶
func (s *SubmissionInternal) Internalize(field *store.Submission)
type SubmissionsInternal ¶
type UserInternal ¶
type UserInternal struct {
ID uint
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time
Username string
Password string
Role string
Name string
Email string
Disabled bool
RequirePasswordReset bool
}
func (*UserInternal) Internalize ¶
func (u *UserInternal) Internalize(user *store.User)
Click to show internal directories.
Click to hide internal directories.