Documentation
¶
Index ¶
- Variables
- func ScriptLoad(r scripter) (err error)
- type DB
- type Data
- type Elem
- type KeyMappingStrategy
- type Option
- type PushOption
- type ReMon
- func (x *ReMon) EvalVarJSON(ctx context.Context, key, src string) (ret int, value string, err error)
- func (x *ReMon) Get(ctx context.Context, key string) (value string, err error)
- func (x *ReMon) GetList(ctx context.Context, key string) (list []Elem, err error)
- func (x *ReMon) Pull(ctx context.Context, key string, ids []string) (n int, err error)
- func (x *ReMon) Push(ctx context.Context, key string, values []string, opts ...PushOption) (err error)
- func (x *ReMon) Set(ctx context.Context, key, value string) (err error)
- func (x *ReMon) Stat() *Stat
- type RedisClient
- type Stat
- type Sync
- type SyncHooker
- type SyncOnErrorFunc
- type SyncOnSaveFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrClosed = errors.New("remon: closed")
)
View Source
var ( // exported errors ErrNotExist = errors.New("remon: not exist") )
Functions ¶
func ScriptLoad ¶
func ScriptLoad(r scripter) (err error)
Types ¶
type Data ¶
type Data struct { // sync/load Version int64 `msgpack:"version" bson:"version"` // for get/set Value string `msgpack:"value" bson:"value"` // for list List struct { Inc int64 `msgpack:"inc" bson:"inc"` // id auto increment Que []string `msgpack:"que" bson:"que"` // ids by push order Map map[string]string `msgpack:"map" bson:"map"` // id to value } `msgpack:"list" bson:"list"` }
type KeyMappingStrategy ¶
map redis key to mongodb (database,collection,_id)
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithKeyMappingStrategy ¶
func WithKeyMappingStrategy(v KeyMappingStrategy) Option
func WithSyncLimit ¶
func WithVolatileTTL ¶
type PushOption ¶
type PushOption interface {
// contains filtered or unexported methods
}
func WithCapacity ¶
func WithCapacity(capacity int) PushOption
type ReMon ¶
type ReMon struct {
// contains filtered or unexported fields
}
func (*ReMon) EvalVarJSON ¶
func (x *ReMon) EvalVarJSON(ctx context.Context, key, src string) (ret int, value string, err error)
Eval custom lua script on json value If src cannot be trusted, set lua-time-limit to a small value
func (*ReMon) Push ¶
func (x *ReMon) Push(ctx context.Context, key string, values []string, opts ...PushOption) (err error)
Push element(s) to list
type RedisClient ¶
type Sync ¶
type Sync struct {
// contains filtered or unexported fields
}
func (*Sync) Hook ¶
func (x *Sync) Hook(hookers ...SyncHooker)
type SyncHooker ¶
type SyncHooker interface {
// contains filtered or unexported methods
}
func SyncOnError ¶
func SyncOnError(f SyncOnErrorFunc) SyncHooker
func SyncOnSave ¶
func SyncOnSave(f SyncOnSaveFunc) SyncHooker
type SyncOnErrorFunc ¶
type SyncOnSaveFunc ¶
Click to show internal directories.
Click to hide internal directories.