Documentation ¶
Index ¶
Constants ¶
View Source
const Collection = "forms"
Collection is the mongo collection where Form documents are saved.
Variables ¶
View Source
var ErrInvalidID = errors.New("ID is not in it's proper form")
ErrInvalidID occurs when an ID is not in a valid form.
Functions ¶
Types ¶
type Form ¶
type Form struct { ID bson.ObjectId `json:"id" bson:"_id" validate:"required"` Status string `json:"status" bson:"status"` Theme interface{} `json:"theme" bson:"theme"` Settings map[string]interface{} `json:"settings" bson:"settings"` Header interface{} `json:"header" bson:"header"` FinishedScreen interface{} `json:"finishedScreen" bson:"finishedScreen"` Steps []Step `json:"steps" bson:"steps"` Stats Stats `json:"stats" bson:"stats"` CreatedBy interface{} `json:"created_by" bson:"created_by"` UpdatedBy interface{} `json:"updated_by" bson:"updated_by"` DeletedBy interface{} `json:"deleted_by" bson:"deleted_by"` DateCreated time.Time `json:"date_created,omitempty" bson:"date_created,omitempty"` DateUpdated time.Time `json:"date_updated,omitempty" bson:"date_updated,omitempty"` DateDeleted time.Time `json:"date_deleted,omitempty" bson:"date_deleted,omitempty"` }
Form contains the conatical representation of a Form, containing all the Steps, and help text relating to completing the Form.
func UpdateStatus ¶
UpdateStatus updates the forms status and returns the updated form from the MongodB database collection.
type Stats ¶
type Stats struct {
Responses int `json:"responses" bson:"responses"`
}
Stats describes the statistics being recorded by a specific Form.
type Step ¶
type Step struct { ID string `json:"id" bson:"_id"` Name string `json:"name" bson:"name"` Widgets []Widget `json:"widgets" bson:"widgets"` }
Step is a collection of Widget's.
type Widget ¶
type Widget struct { ID string `json:"id" bson:"_id"` Type string `json:"type" bson:"type"` Identity bool `json:"identity" bson:"identity"` Component string `json:"component" bson:"component"` Title string `json:"title" bson:"title"` Description string `json:"description" bson:"description"` Wrapper interface{} `json:"wrapper" bson:"wrapper"` Props interface{} `json:"props" bson:"props"` }
Widget describes a specific question being asked by the Form which is contained within a Step.
Click to show internal directories.
Click to hide internal directories.