Documentation ¶
Index ¶
- Variables
- func AddDefaultConfig(group string, configs map[string]*dbschema.Config)
- func ConfigAsStore(groups ...string) echo.H
- func ConfigDefaults() map[string]map[string]*dbschema.Config
- func ConfigDefaultsAsStore() echo.H
- func DecodeConfig(v *dbschema.Config, cfg echo.H, decoder Decoder) (echo.H, error)
- func DecodeConfigValue(v *dbschema.Config, decoder Decoder) (echo.H, error)
- func Decoders() map[string]Decoder
- func EncodeConfigValue(_v *echo.Mapx, v *dbschema.Config, encoder Encoder) (value string, err error)
- func Encoders() map[string]Encoder
- func GetDefaultConfig(group string) map[string]*dbschema.Config
- func GetDefaultConfigOk(group string) (map[string]*dbschema.Config, bool)
- func Init() error
- func InsertBy(configs map[string]*dbschema.Config, key string, values ...string) error
- func InsertDefaultConfig(group, key string, values ...string) error
- func InsertMissing(gm *echo.Mapx, added map[string]int, configs map[string]*dbschema.Config, ...) error
- func InsertMissingDefaultConfig(added map[string]map[string]struct{}) error
- func Register(sf ...*SettingForm)
- func RegisterDecoder(group string, decoder Decoder)
- func RegisterEncoder(group string, encoder Encoder)
- func RunHookGet(ctx echo.Context, groups ...string) error
- func RunHookPost(ctx echo.Context, groups ...string) error
- type Codec
- type Decoder
- type Encoder
- type SettingForm
- func (s *SettingForm) AddHookGet(hook func(echo.Context) error) *SettingForm
- func (s *SettingForm) AddHookPost(hook func(echo.Context) error) *SettingForm
- func (s *SettingForm) AddTmpl(tmpl string) *SettingForm
- func (s *SettingForm) RunHookGet(ctx echo.Context) error
- func (s *SettingForm) RunHookPost(ctx echo.Context) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotExists = errors.New(`Not exists`)
Functions ¶
func ConfigAsStore ¶
ConfigAsStore {Group:{Key:ValueObject}}
func ConfigDefaultsAsStore ¶
func DecodeConfig ¶
func DecodeConfigValue ¶
func EncodeConfigValue ¶
func InsertDefaultConfig ¶
func InsertMissing ¶
func Register ¶
func Register(sf ...*SettingForm)
func RegisterDecoder ¶
RegisterDecoder 注册配置值解码器(用于从数据库读出来之后的解码操作) 名称支持"group"或"group.key"两种格式,例如: settings.RegisterDecoder(`sms`,...)对整个sms组的配置有效 settings.RegisterDecoder(`sms.twilio`,...)对sms组内key为twilio的配置有效
func RegisterEncoder ¶
RegisterEncoder 注册配置值编码器(用于客户端提交表单数据之后的编码操作,编码结果保存到数据库) 名称支持"group"或"group.key"两种格式,例如: settings.RegisterDecoder(`sms`,...)对整个sms组的配置有效 settings.RegisterDecoder(`sms.twilio`,...)对sms组内key为twilio的配置有效
Types ¶
type Decoder ¶
func GetDecoder ¶
type Encoder ¶
func GetEncoder ¶
type SettingForm ¶
type SettingForm struct { Short string //简短标签 Label string //标签文本 Group string //组标识 Tmpl []string //输入表单模板路径 // contains filtered or unexported fields }
func Get ¶
func Get(group string) (int, *SettingForm)
func Settings ¶
func Settings() []*SettingForm
func (*SettingForm) AddHookGet ¶
func (s *SettingForm) AddHookGet(hook func(echo.Context) error) *SettingForm
func (*SettingForm) AddHookPost ¶
func (s *SettingForm) AddHookPost(hook func(echo.Context) error) *SettingForm
func (*SettingForm) AddTmpl ¶
func (s *SettingForm) AddTmpl(tmpl string) *SettingForm
func (*SettingForm) RunHookGet ¶
func (s *SettingForm) RunHookGet(ctx echo.Context) error
func (*SettingForm) RunHookPost ¶
func (s *SettingForm) RunHookPost(ctx echo.Context) error
Click to show internal directories.
Click to hide internal directories.