Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DataFieldTypes = []string{"int", "string", "datetime", "bool", "time.Time"}
View Source
var (
ErrInvalidIdentifier = errors.New("Invalid identifier")
)
View Source
var LocationColumns []string = []string{
"id",
"parent_id",
"main_id",
"hierarchy",
"depth",
"identifier_path",
"content_type",
"content_id",
"is_hidden",
"is_invisible",
"priority",
"uid",
"section",
"p",
}
View Source
var MetaColumns = []string{"version", "name", "published", "modified", "author", "cuid"}
Functions ¶
func GetFields ¶
Get fields based on path pattern including container, separated by / . eg. article/relations, report/step1
func LoadDefinition ¶
func LoadDefinition() error
LoadDefinition Load all setting in file into memory.
Types ¶
type ContentType ¶
type ContentType struct {
Name string `json:"name"`
TableName string `json:"table_name"`
RelationData []string `json:"relation_data"`
NamePattern string `json:"name_pattern"`
HasVersion bool `json:"has_version"`
HasLocation bool `json:"has_location"`
HasLocationID bool `json:"has_location_id"` //for non-location content
Fields []fieldtype.FieldDef `json:"fields"`
DataFields []DataField `json:"data_fields"`
//All fields where identifier is the key.
FieldMap map[string]fieldtype.FieldDef `json:"-"`
FieldIdentifierList []string `json:"-"`
// contains filtered or unexported fields
}
func GetDefinition ¶
func GetDefinition(contentType string, language ...string) (ContentType, error)
Get a definition of a contenttype
func (*ContentType) HasDataField ¶
func (c *ContentType) HasDataField(identifier string) bool
func (ContentType) HasRelationlist ¶
func (c ContentType) HasRelationlist() bool
func (*ContentType) Init ¶
func (c *ContentType) Init(fieldCallback ...func(*fieldtype.FieldDef)) error
func (*ContentType) Validate ¶
func (c *ContentType) Validate() error
type ContentTypeList ¶
type ContentTypeList map[string]ContentTypeMap
func GetDefinitionList ¶
func GetDefinitionList() ContentTypeList
type ContentTypeMap ¶
type ContentTypeMap map[string]ContentType
func (*ContentTypeMap) Init ¶
func (c *ContentTypeMap) Init() error
type VaidationRule ¶
type VaidationRule map[string]interface{}
ValidationRule defines rule for a field's validation. eg. max length
Click to show internal directories.
Click to hide internal directories.