Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.1.4
type Client interface { // get stat info Metrics() *Metrics // Get value from remon // If cache miss, load from database Get(ctx context.Context, key string, opts ...GetOption) (rev int64, val string, err error) // Set value to remon // Value will be saved to cache and synced to database later automatically Set(ctx context.Context, key, val string) (rev int64, err error) // Add value to remon // If key already exists, return ErrAlreadyExists // If add success, the rev must be 1 Add(ctx context.Context, key, val string) (err error) // contains filtered or unexported methods }
type GetOption ¶ added in v0.1.4
type GetOption interface {
// contains filtered or unexported methods
}
get method xOptions
func AddIfNotFound ¶ added in v0.1.4
type MailClient ¶ added in v0.1.4
type MailClient interface { // list mails List(ctx context.Context, key string) (_ []*Mail, err error) // push mail in Push(ctx context.Context, key, val string, opts ...PushOption) (id int64, err error) // pull mail(s) out Pull(ctx context.Context, key string, ids ...int64) (pulled []int64, err error) // clean all mails Clean(ctx context.Context, key string) (err error) }
func NewMailClient ¶ added in v0.1.4
func NewMailClient(rm Client) MailClient
type MapKeyFunc ¶ added in v0.1.4
Redis(key) -> Mongo(db,collection,_id)
type Metrics ¶ added in v0.1.4
type Metrics struct {
// contains filtered or unexported fields
}
client wide statistics
func (*Metrics) MongoError ¶ added in v0.1.4
func (*Metrics) RedisError ¶ added in v0.1.4
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func OnSyncError ¶ added in v0.1.4
func OnSyncError(f OnSyncErrorFunc) Option
func OnSyncIdle ¶ added in v0.1.4
func OnSyncIdle(f OnSyncIdleFunc) Option
func OnSyncSave ¶ added in v0.1.4
func OnSyncSave(f OnSyncSaveFunc) Option
func WithKeyMap ¶ added in v0.1.4
func WithKeyMap(f MapKeyFunc) Option
type PushOption ¶
type PushOption interface {
// contains filtered or unexported methods
}
func WithCapacity ¶
func WithCapacity(v int) PushOption
func WithPushStrategy ¶ added in v0.1.4
func WithPushStrategy(v PushStrategy) PushOption
type PushStrategy ¶ added in v0.1.4
type PushStrategy int
push method options
const ( RejectOnFull PushStrategy = 0 PullOldestOnFull PushStrategy = 1 )
type RedisClient ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.