Documentation ¶
Index ¶
- func NewTracingHook() *tracingHook
- type Hook
- type MemcacheProxy
- func (mp *MemcacheProxy) AddHook(h Hook)
- func (m *MemcacheProxy) Delete(ctx context.Context, key string) error
- func (mp *MemcacheProxy) Destory() error
- func (m *MemcacheProxy) Get(ctx context.Context, key string) (string, error)
- func (mp *MemcacheProxy) Initialize() error
- func (m *MemcacheProxy) MGet(ctx context.Context, keys []string) (map[string]string, error)
- func (m *MemcacheProxy) Set(ctx context.Context, key string, value string) error
- func (m *MemcacheProxy) SetWithExpire(ctx context.Context, key string, value string, expire int) error
- func (mp *MemcacheProxy) WithLogger(logger xlog.Logger)
- func (mp *MemcacheProxy) WithMetrics(metrics metrics.Provider)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTracingHook ¶
func NewTracingHook() *tracingHook
Types ¶
type MemcacheProxy ¶
type MemcacheProxy struct { Opt *Option // contains filtered or unexported fields }
MemcacheProxy memcache 三方包的包装器类
func (*MemcacheProxy) AddHook ¶
func (mp *MemcacheProxy) AddHook(h Hook)
func (*MemcacheProxy) Delete ¶
func (m *MemcacheProxy) Delete(ctx context.Context, key string) error
Delete 删除操作
func (*MemcacheProxy) Destory ¶
func (mp *MemcacheProxy) Destory() error
func (*MemcacheProxy) Initialize ¶
func (mp *MemcacheProxy) Initialize() error
func (*MemcacheProxy) SetWithExpire ¶
func (m *MemcacheProxy) SetWithExpire(ctx context.Context, key string, value string, expire int) error
SetWithExpire 设置缓存,并且添加超时 expire 以s为单位
func (*MemcacheProxy) WithLogger ¶
func (mp *MemcacheProxy) WithLogger(logger xlog.Logger)
func (*MemcacheProxy) WithMetrics ¶
func (mp *MemcacheProxy) WithMetrics(metrics metrics.Provider)
Click to show internal directories.
Click to hide internal directories.