Documentation ¶
Index ¶
- Constants
- Variables
- func BilibiliCurrentLiveKey(keys ...interface{}) string
- func BilibiliCurrentNewsKey(keys ...interface{}) string
- func BilibiliDynamicIdKey(keys ...interface{}) string
- func BilibiliGroupAtAllMarkKey(keys ...interface{}) string
- func BilibiliGroupConcernConfigKey(keys ...interface{}) string
- func BilibiliGroupConcernStateKey(keys ...interface{}) string
- func BilibiliNotLiveCountKey(keys ...interface{}) string
- func BilibiliOriginMarkKey(keys ...interface{}) string
- func BilibiliUidFirstTimestampKey(keys ...interface{}) string
- func BilibiliUserCookieInfoKey(keys ...interface{}) string
- func BilibiliUserInfoKey(keys ...interface{}) string
- func BilibiliUserStatKey(keys ...interface{}) string
- func BilibiliVideoOriginMarkKey(keys ...interface{}) string
- func BilibliFreshKey(keys ...interface{}) string
- func BlockListKey(keys ...interface{}) string
- func Close() error
- func CreatePatternIndex(patternFunc KeyPatternFunc, suffix []interface{}, ...) error
- func DouyuCurrentLiveKey(keys ...interface{}) string
- func DouyuFreshKey(keys ...interface{}) string
- func DouyuGroupAtAllMarkKey(keys ...interface{}) string
- func DouyuGroupConcernConfigKey(keys ...interface{}) string
- func DouyuGroupConcernStateKey(keys ...interface{}) string
- func ExpireOption(duration time.Duration) *buntdb.SetOptions
- func GetClient() (*buntdb.DB, error)
- func GetInt64(key string) (int64, error)
- func GlobalEnabledKey(keys ...interface{}) string
- func GlobalSilenceKey(keys ...interface{}) string
- func GroupEnabledKey(keys ...interface{}) string
- func GroupInvitedKey(keys ...interface{}) string
- func GroupInvitorKey(keys ...interface{}) string
- func GroupMessageImageKey(keys ...interface{}) string
- func GroupMuteKey(keys ...interface{}) string
- func GroupPermissionKey(keys ...interface{}) string
- func GroupSilenceKey(keys ...interface{}) string
- func HuyaCurrentLiveKey(keys ...interface{}) string
- func HuyaFreshKey(keys ...interface{}) string
- func HuyaGroupAtAllMarkKey(keys ...interface{}) string
- func HuyaGroupConcernConfigKey(keys ...interface{}) string
- func HuyaGroupConcernStateKey(keys ...interface{}) string
- func ImageCacheKey(keys ...interface{}) string
- func InitBuntDB(dbpath string) error
- func IsRollback(e error) bool
- func JsonGet(key string, obj interface{}) error
- func JsonSave(key string, obj interface{}, opt ...*buntdb.SetOptions) error
- func Key(keys ...interface{}) string
- func LoliconPoolStoreKey(keys ...interface{}) string
- func ModeKey() string
- func MustGetClient() *buntdb.DB
- func NamedKey(name string, keys []interface{}) string
- func NewFriendRequestKey(keys ...interface{}) string
- func ParseConcernStateKeyWithInt64(key string) (groupCode int64, id int64, err error)
- func ParseConcernStateKeyWithString(key string) (groupCode int64, id string, err error)
- func PermissionKey(keys ...interface{}) string
- func RCover(f func() error) error
- func RCoverTx(f func(tx *buntdb.Tx) error) error
- func RWCover(f func() error) error
- func RWCoverTx(f func(tx *buntdb.Tx) error) error
- func RemoveByPrefixAndIndex(prefixKey []string, indexKey []string) ([]string, error)
- func SeqClear(key string) error
- func SeqNext(key string) (int64, error)
- func SetIfNotExist(key, value string, opt ...*buntdb.SetOptions) error
- func SetInt64(key string, value int64, opt ...*buntdb.SetOptions) (int64, error)
- func VersionKey(keys ...interface{}) string
- func YoutubeFreshKey(keys ...interface{}) string
- func YoutubeGroupAtAllMarkKey(keys ...interface{}) string
- func YoutubeGroupConcernConfigKey(keys ...interface{}) string
- func YoutubeGroupConcernStateKey(keys ...interface{}) string
- func YoutubeInfoKey(keys ...interface{}) string
- func YoutubeUserInfoKey(keys ...interface{}) string
- func YoutubeVideoKey(keys ...interface{}) string
- type KeyPatternFunc
- type ShortCut
- func (s *ShortCut) CreatePatternIndex(patternFunc KeyPatternFunc, suffix []interface{}, ...) error
- func (s *ShortCut) GetInt64(key string) (int64, error)
- func (s *ShortCut) JsonGet(key string, obj interface{}) error
- func (s *ShortCut) JsonSave(key string, obj interface{}, opt ...*buntdb.SetOptions) error
- func (*ShortCut) RCover(f func() error) error
- func (*ShortCut) RCoverTx(f func(tx *buntdb.Tx) error) error
- func (*ShortCut) RWCover(f func() error) error
- func (*ShortCut) RWCoverTx(f func(tx *buntdb.Tx) error) error
- func (s *ShortCut) SeqClear(key string) error
- func (s *ShortCut) SeqNext(key string) (int64, error)
- func (s *ShortCut) SetIfNotExist(key, value string, opt ...*buntdb.SetOptions) error
- func (s *ShortCut) SetInt64(key string, value int64, opt ...*buntdb.SetOptions) (int64, error)
Constants ¶
View Source
const MEMORYDB = ":memory:"
Variables ¶
View Source
var ( ErrKeyExist = errors.New("key exist") ErrNotInitialized = errors.New("not initialized") ErrRollback = errors.New("rollback") )
View Source
var TxKey = new(struct{})
Functions ¶
func BilibiliCurrentLiveKey ¶
func BilibiliCurrentLiveKey(keys ...interface{}) string
func BilibiliCurrentNewsKey ¶
func BilibiliCurrentNewsKey(keys ...interface{}) string
func BilibiliDynamicIdKey ¶
func BilibiliDynamicIdKey(keys ...interface{}) string
func BilibiliGroupAtAllMarkKey ¶ added in v0.0.10
func BilibiliGroupAtAllMarkKey(keys ...interface{}) string
func BilibiliGroupConcernConfigKey ¶ added in v0.0.10
func BilibiliGroupConcernConfigKey(keys ...interface{}) string
func BilibiliGroupConcernStateKey ¶
func BilibiliGroupConcernStateKey(keys ...interface{}) string
func BilibiliNotLiveCountKey ¶ added in v0.0.7
func BilibiliNotLiveCountKey(keys ...interface{}) string
func BilibiliOriginMarkKey ¶ added in v0.1.3
func BilibiliOriginMarkKey(keys ...interface{}) string
func BilibiliUidFirstTimestampKey ¶ added in v0.0.6
func BilibiliUidFirstTimestampKey(keys ...interface{}) string
func BilibiliUserCookieInfoKey ¶ added in v0.0.17
func BilibiliUserCookieInfoKey(keys ...interface{}) string
func BilibiliUserInfoKey ¶
func BilibiliUserInfoKey(keys ...interface{}) string
func BilibiliUserStatKey ¶ added in v0.0.19
func BilibiliUserStatKey(keys ...interface{}) string
func BilibiliVideoOriginMarkKey ¶ added in v0.0.20
func BilibiliVideoOriginMarkKey(keys ...interface{}) string
func BilibliFreshKey ¶
func BilibliFreshKey(keys ...interface{}) string
func BlockListKey ¶
func BlockListKey(keys ...interface{}) string
func CreatePatternIndex ¶ added in v0.1.4
func CreatePatternIndex(patternFunc KeyPatternFunc, suffix []interface{}, less ...func(a, b string) bool) error
func DouyuCurrentLiveKey ¶
func DouyuCurrentLiveKey(keys ...interface{}) string
func DouyuFreshKey ¶
func DouyuFreshKey(keys ...interface{}) string
func DouyuGroupAtAllMarkKey ¶ added in v0.0.10
func DouyuGroupAtAllMarkKey(keys ...interface{}) string
func DouyuGroupConcernConfigKey ¶ added in v0.0.10
func DouyuGroupConcernConfigKey(keys ...interface{}) string
func DouyuGroupConcernStateKey ¶
func DouyuGroupConcernStateKey(keys ...interface{}) string
func ExpireOption ¶
func ExpireOption(duration time.Duration) *buntdb.SetOptions
ExpireOption 是一个创建expire的函数糖
func GlobalEnabledKey ¶ added in v0.0.16
func GlobalEnabledKey(keys ...interface{}) string
func GlobalSilenceKey ¶ added in v0.1.3
func GlobalSilenceKey(keys ...interface{}) string
func GroupEnabledKey ¶
func GroupEnabledKey(keys ...interface{}) string
func GroupInvitedKey ¶ added in v0.1.0
func GroupInvitedKey(keys ...interface{}) string
func GroupInvitorKey ¶
func GroupInvitorKey(keys ...interface{}) string
func GroupMessageImageKey ¶
func GroupMessageImageKey(keys ...interface{}) string
func GroupMuteKey ¶
func GroupMuteKey(keys ...interface{}) string
func GroupPermissionKey ¶
func GroupPermissionKey(keys ...interface{}) string
func GroupSilenceKey ¶ added in v0.1.3
func GroupSilenceKey(keys ...interface{}) string
func HuyaCurrentLiveKey ¶ added in v0.0.7
func HuyaCurrentLiveKey(keys ...interface{}) string
func HuyaFreshKey ¶ added in v0.0.7
func HuyaFreshKey(keys ...interface{}) string
func HuyaGroupAtAllMarkKey ¶ added in v0.0.10
func HuyaGroupAtAllMarkKey(keys ...interface{}) string
func HuyaGroupConcernConfigKey ¶ added in v0.0.10
func HuyaGroupConcernConfigKey(keys ...interface{}) string
func HuyaGroupConcernStateKey ¶ added in v0.0.7
func HuyaGroupConcernStateKey(keys ...interface{}) string
func ImageCacheKey ¶
func ImageCacheKey(keys ...interface{}) string
func InitBuntDB ¶
func IsRollback ¶ added in v0.0.10
func JsonSave ¶ added in v0.1.0
func JsonSave(key string, obj interface{}, opt ...*buntdb.SetOptions) error
func LoliconPoolStoreKey ¶
func LoliconPoolStoreKey(keys ...interface{}) string
func MustGetClient ¶
func NewFriendRequestKey ¶ added in v0.1.0
func NewFriendRequestKey(keys ...interface{}) string
func ParseConcernStateKeyWithInt64 ¶ added in v0.0.7
func ParseConcernStateKeyWithString ¶ added in v0.0.7
func PermissionKey ¶
func PermissionKey(keys ...interface{}) string
func RemoveByPrefixAndIndex ¶ added in v0.0.19
RemoveByPrefixAndIndex 遍历每个index,如果一个key满足任意prefix,则删掉
func SetIfNotExist ¶ added in v0.1.4
func SetIfNotExist(key, value string, opt ...*buntdb.SetOptions) error
func VersionKey ¶ added in v0.1.4
func VersionKey(keys ...interface{}) string
func YoutubeFreshKey ¶
func YoutubeFreshKey(keys ...interface{}) string
func YoutubeGroupAtAllMarkKey ¶ added in v0.0.10
func YoutubeGroupAtAllMarkKey(keys ...interface{}) string
func YoutubeGroupConcernConfigKey ¶ added in v0.0.10
func YoutubeGroupConcernConfigKey(keys ...interface{}) string
func YoutubeGroupConcernStateKey ¶
func YoutubeGroupConcernStateKey(keys ...interface{}) string
func YoutubeInfoKey ¶
func YoutubeInfoKey(keys ...interface{}) string
func YoutubeUserInfoKey ¶
func YoutubeUserInfoKey(keys ...interface{}) string
func YoutubeVideoKey ¶
func YoutubeVideoKey(keys ...interface{}) string
Types ¶
type KeyPatternFunc ¶ added in v0.1.0
type KeyPatternFunc func(...interface{}) string
type ShortCut ¶
type ShortCut struct{}
func (*ShortCut) CreatePatternIndex ¶ added in v0.1.4
func (s *ShortCut) CreatePatternIndex(patternFunc KeyPatternFunc, suffix []interface{}, less ...func(a, b string) bool) error
func (*ShortCut) JsonSave ¶ added in v0.1.0
func (s *ShortCut) JsonSave(key string, obj interface{}, opt ...*buntdb.SetOptions) error
func (*ShortCut) RWCoverTx ¶ added in v0.0.18
RWCoverTx 在一个RW事务中执行f,注意f的返回值不一定是RWCoverTx的返回值 有可能f返回nil,但RWTxCover返回non-nil 可以忽略error,但不要简单地用f返回值替代RWTxCover返回值,ref: bilibili/MarkDynamicId
func (*ShortCut) SetIfNotExist ¶ added in v0.1.4
func (s *ShortCut) SetIfNotExist(key, value string, opt ...*buntdb.SetOptions) error
SetIfNotExist 使用opt设置key value,如果key已经存在,则回滚并返回 ErrRollback
Click to show internal directories.
Click to hide internal directories.