Documentation
¶
Index ¶
- Constants
- Variables
- func GetOnce[T any](ctx echo.Context, key string, f func() (T, error)) (T, error)
- func GetTypeValues(ctx echo.Context, typ string, defaultValue ...*echo.KVData) (echo.KVList, error)
- func GetTypeValuesNocache(ctx echo.Context, typ string, defaultValue ...*echo.KVData) (echo.KVList, error)
- func GetValue(ctx echo.Context, key string, defaultValue ...string) (string, error)
- func GetValueNocache(ctx echo.Context, key string, defaultValue ...string) (string, error)
- func RemoveCache(kv *dbschema.NgingKv) error
Constants ¶
View Source
const ( HKeyDescription = model.HKeyDescription HKeyHelp = model.HKeyHelp )
Variables ¶
View Source
var DefaultTTL int64 = 86400 * 7
Functions ¶
func GetTypeValues ¶
GetTypeValues 从缓存中获取某个类型下的所有键值 typ: "type|typeName" defaultValue: echo.NewKVData().Add(`key`, `value`, echo.KVOptHKV(`description`, `说明`), echo.KVOptHKV(`help`, `帮助`))
func GetTypeValuesNocache ¶
func GetTypeValuesNocache(ctx echo.Context, typ string, defaultValue ...*echo.KVData) (echo.KVList, error)
GetTypeValuesNocache 从数据库获取某个类型下的所有键值 typ: "type|typeName" defaultValue: echo.NewKVData().Add(`key`, `value`, echo.KVOptHKV(`description`, `说明`), echo.KVOptHKV(`help`, `帮助`))
func GetValueNocache ¶
GetValueNocache 从数据库获取某个 key 的值 defaultValue: 0. 默认值; 1. 说明; 2. 帮助说明 (1 和 2 仅在自动创建时有用)
func RemoveCache ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.