xkv

package
v0.0.0-...-b3bd9ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: AGPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	HKeyDescription = model.HKeyDescription
	HKeyHelp        = model.HKeyHelp
)

Variables

View Source
var DefaultTTL int64 = 86400 * 7

Functions

func GetOnce

func GetOnce[T any](ctx echo.Context, key string, f func() (T, error)) (T, error)

func GetTypeValues

func GetTypeValues(ctx echo.Context, typ string, defaultValue ...*echo.KVData) (echo.KVList, error)

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 GetValue

func GetValue(ctx echo.Context, key string, defaultValue ...string) (string, error)

GetValue 从缓存中获取获取某个 key 的值 defaultValue: 0. 默认值; 1. 说明; 2. 帮助说明 (1 和 2 仅在自动创建时有用)

func GetValueNocache

func GetValueNocache(ctx echo.Context, key string, defaultValue ...string) (string, error)

GetValueNocache 从数据库获取某个 key 的值 defaultValue: 0. 默认值; 1. 说明; 2. 帮助说明 (1 和 2 仅在自动创建时有用)

func RemoveCache

func RemoveCache(kv *dbschema.NgingKv) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL