Documentation
¶
Overview ¶
Package domain contains system configuration and dictionary rules.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidConfigKey = errors.New("invalid config key") ErrInvalidConfigName = errors.New("invalid config name") ErrInvalidDictID = errors.New("invalid dictionary id") ErrInvalidDictCode = errors.New("invalid dictionary code") ErrInvalidDictName = errors.New("invalid dictionary name") ErrInvalidDictItemID = errors.New("invalid dictionary item id") ErrInvalidDictParent = errors.New("invalid dictionary item parent") ErrInvalidDictLabel = errors.New("invalid dictionary item label") ErrInvalidDictValue = errors.New("invalid dictionary item value") ErrInvalidDictExtend = errors.New("invalid dictionary item extend") ErrInvalidDictLevel = errors.New("invalid dictionary item level") ErrInvalidDictPath = errors.New("invalid dictionary item path") ErrInvalidParamID = errors.New("invalid system param id") ErrInvalidParamName = errors.New("invalid system param name") ErrInvalidParamKey = errors.New("invalid system param key") ErrInvalidParamValue = errors.New("invalid system param value") ErrInvalidParamDesc = errors.New("invalid system param description") ErrInvalidVersionID = errors.New("invalid system version id") ErrInvalidVersion = errors.New("invalid system version") ErrInvalidVersionName = errors.New("invalid system version name") ErrInvalidVersionDesc = errors.New("invalid system version description") )
System data validation errors.
Functions ¶
This section is empty.
Types ¶
type Dictionary ¶
type Dictionary struct {
ID int64
Code string
Name string
Items []DictionaryItem
CreatedAt time.Time
UpdatedAt time.Time
}
Dictionary is a validated group of controlled values.
func RestoreDictionary ¶
func RestoreDictionary(id int64, code, name string, items []DictionaryItem, createdAt, updatedAt time.Time) (Dictionary, error)
RestoreDictionary rebuilds a dictionary from a trusted store representation.
type DictionaryItem ¶
type DictionaryItem struct {
ID int64
ParentID int64
Label string
Value string
Extend string
Sort int
Active bool
Level int
Path string
Children []DictionaryItem
}
DictionaryItem is a validated selectable value under a dictionary.
func RestoreDictionaryItem ¶
func RestoreDictionaryItem(id, parentID int64, label, value, extend string, sort int, active bool, level int, path string, children []DictionaryItem) (DictionaryItem, error)
RestoreDictionaryItem rebuilds a dictionary item from a trusted store representation.
type SystemConfig ¶
SystemConfig is a validated key-value runtime setting managed from the back office.
func RestoreSystemConfig ¶
func RestoreSystemConfig(key, name, value string, public bool, updatedAt time.Time) (SystemConfig, error)
RestoreSystemConfig rebuilds a config item from a trusted store representation.
type SystemParam ¶
type SystemParam struct {
ID int64
Name string
Key string
Value string
Desc string
CreatedAt time.Time
UpdatedAt time.Time
}
SystemParam is an operator-managed named key/value parameter.
func RestoreSystemParam ¶
func RestoreSystemParam(id int64, name, key, value, desc string, createdAt, updatedAt time.Time) (SystemParam, error)
RestoreSystemParam rebuilds a parameter from a trusted store representation.
type SystemVersion ¶
type SystemVersion struct {
ID int64
Version string
Name string
Description string
Data string
PublishedAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
}
SystemVersion is an operator-managed release note for the running back office.
func RestoreSystemVersion ¶
func RestoreSystemVersion(id int64, version, name, description, data string, publishedAt, createdAt, updatedAt time.Time) (SystemVersion, error)
RestoreSystemVersion rebuilds a release record from a trusted store representation.