Documentation ¶
Index ¶
- func Del(key []byte)
- func Get(key []byte) []byte
- func GetBool(key []byte) bool
- func GetDuration(key []byte) time.Duration
- func GetFloat64(key []byte) float64
- func GetInt(key []byte) int
- func GetInt32(key []byte) int32
- func GetInt64(key []byte) int64
- func GetIntSlice(key []byte) []int
- func GetString(key []byte) string
- func GetStringMap(key []byte) map[string]string
- func GetStringMapStringSlice(key []byte) map[string][]string
- func GetStringSlice(key []byte) []string
- func GetTime(key []byte) time.Time
- func GetUint(key []byte) uint
- func GetUint32(key []byte) uint32
- func GetUint64(key []byte) uint64
- func Put(key []byte, value interface{}, ttl ...time.Duration)
- func SetDB(d *badger.DB, l ...LogInterface)
- func Start(path string, l ...LogInterface)
- func Stop()
- type LogInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDuration ¶
GetDuration returns the value associated with the key as a duration.
func GetFloat64 ¶
GetFloat64 returns the value associated with the key as a float64.
func GetIntSlice ¶
GetIntSlice returns the value associated with the key as a slice of int values.
func GetStringMap ¶
GetStringMap returns the value associated with the key as a map of strings.
func GetStringMapStringSlice ¶
GetStringMapStringSlice returns the value associated with the key as a map to a slice of strings.
func GetStringSlice ¶
GetStringSlice returns the value associated with the key as a slice of strings.
func GetTime ¶
GetTime 需要注意,使用time.Now()返回的time.Time包含Wall Clock和Monotonic Clock。 在Marshal之后,Monotonic Clock部分会被丢弃,所以在Unmarshal之后和原来的并不完全相同。
在一般业务场景下,存储时间戳的精度其实就足够了。
Types ¶
type LogInterface ¶
Click to show internal directories.
Click to hide internal directories.