Documentation ¶
Index ¶
- func Build(blueprint Blueprint) (*ember.App, error)
- func CSP(baseURL string) serve.ContentPolicy
- func Deconflict(name string) string
- func MustBuild(blueprint Blueprint) *ember.App
- func Title(name string) string
- type Action
- type Any
- type Attribute
- type Backend
- type Blueprint
- type Column
- type Condition
- type Control
- type Expression
- type Field
- type Filter
- type Format
- type Kind
- type LabelKeys
- type Menu
- type MenuItem
- type Model
- type Option
- type Order
- type Property
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CSP ¶ added in v0.3.5
func CSP(baseURL string) serve.ContentPolicy
CSP returns a basic content security policy.
func Deconflict ¶
Deconflict will return a model key that is conflict safe. It will use an titelized version of the key for conflicting keys.
Types ¶
type Action ¶ added in v0.3.0
type Action struct { Title string `json:"title"` Expression Expression `json:"expression"` Disabled Expression `json:"disabled"` }
Action describes a row action.
type Attribute ¶
type Attribute struct { Name string `json:"name"` Kind Kind `json:"kind"` Type Type `json:"type,omitempty"` Inverse string `json:"inverse,omitempty"` // belongs-to, has-many Default Any `json:"default,omitempty"` Init Expression `json:"init,omitempty"` }
Attribute describes a static model attribute.
type Backend ¶
type Backend struct { BaseURL string `json:"baseURL"` AuthPath string `json:"authPath"` AuthScope string `json:"authScope"` DataPath string `json:"dataPath"` WatchPath string `json:"watchPath"` UploadPath string `json:"uploadPath"` DownloadPath string `json:"downloadPath"` ClientID string `json:"clientID"` UserDataKey string `json:"userDataKey"` UserModel string `json:"userModel"` UserNameKey string `json:"userNameKey"` }
Backend describes the backend service.
type Blueprint ¶
type Blueprint struct { Title string `json:"title"` Color string `json:"color"` Backend Backend `json:"backend"` Menus []Menu `json:"menus"` Models []Model `json:"models"` }
Blueprint configures a thermo application.
type Column ¶
type Column struct { Title string `json:"title"` Key string `json:"key,omitempty"` // leave empty for model based expression Format Format `json:"format,omitempty"` Options []Option `json:"options,omitempty"` // map LabelKey string `json:"labelKey,omitempty"` // belongs-to, has-many Expression Expression `json:"expression,omitempty"` // expression }
Column describes a table column.
type Control ¶
type Control string
Control describes a form control.
const ( ControlString Control = "string" ControlText Control = "text" ControlBoolean Control = "boolean" ControlNumber Control = "number" ControlDate Control = "date" ControlStrings Control = "strings" ControlSelect Control = "select" ControlReference Control = "reference" ControlWell Control = "well" ControlFile Control = "file" ControlColor Control = "color" ControlArray Control = "array" )
The available form controls.
type Expression ¶
type Expression string
Expression describes a javascript expression. The current value can be accessed using `this`, the special variable `$` allows access to the context service.
func Constant ¶ added in v0.3.0
func Constant(value interface{}) Expression
Constant creates and expression that returns the provided constant value.
type Field ¶
type Field struct { Label string `json:"label"` Key string `json:"key"` Hint string `json:"hint"` Control Control `json:"control"` Disabled Expression `json:"disabled,omitempty"` Locked bool `json:"locked,omitempty"` Placeholder string `json:"placeholder,omitempty"` // string, text, number, date, undefined Redacted bool `json:"redacted,omitempty"` // string Min float64 `json:"min,omitempty"` // number Max float64 `json:"max,omitempty"` // number Step float64 `json:"step,omitempty"` // number Options []Option `json:"options,omitempty"` // select Source Expression `json:"source,omitempty"` // reference Multiple bool `json:"multiple,omitempty"` // reference LabelKey string `json:"labelKey,omitempty"` // reference EmptyLabel string `json:"emptyLabel,omitempty"` // reference AllowEmpty bool `json:"allowEmpty,omitempty"` // reference AcceptMedia string `json:"acceptMedia,omitempty"` // file ItemName string `json:"itemName,omitempty"` // array ItemFields []Field `json:"itemFields,omitempty"` // array ItemFactory Expression `json:"itemFactory,omitempty"` // array }
Field describes a form field.
type Filter ¶
type Filter struct { Title string `json:"title"` Key string `json:"key"` Condition Condition `json:"condition"` Options []Option `json:"options"` // select }
Filter describes a list filter.
type Format ¶
type Format string
Format describes a column format.
const ( FormatLiteral Format = "literal" FormatBoolean Format = "boolean" FormatMap Format = "map" FormatAbsoluteDate Format = "absolute-date" FormatRelativeDate Format = "relative-date" FormatStrings Format = "strings" FormatProgress Format = "progress" FormatBelongsTo Format = "belongs-to" FormatHasMany Format = "has-many" FormatExpression Format = "expression" FormatFile Format = "file" FormatFiles Format = "files" FormatColor Format = "color" )
The available column formats.
type Model ¶
type Model struct { Name string `json:"name"` Singular string `json:"singular"` Plural string `json:"plural"` Watchable bool `json:"watchable"` Immediate bool `json:"immediate"` Creatable bool `json:"creatable"` Editable bool `json:"editable"` Deletable bool `json:"deletable"` Attributes []Attribute `json:"attributes"` Properties []Property `json:"properties"` Orders []Order `json:"orders"` Filters []Filter `json:"filters"` Columns []Column `json:"columns"` Actions []Action `json:"actions"` Fields []Field `json:"fields"` }
Model describes a model.
func Applications ¶
Applications will return the model for managing flame.Application documents. If confidential is true an attribute and column is added for a "confidential" property that maps to "IsConfidential".
func Auto ¶
func Auto(model coal.Model, name, singular, plural string, labelKeys LabelKeys, modifiers ...func(*Model)) Model
Auto will generate a Model definition for the provided coal.Model.
type Property ¶
type Property struct { Name string `json:"name"` Keys []string `json:"keys,omitempty"` Body Expression `json:"body,omitempty"` }
Property describes a dynamic model property.