Documentation ¶
Index ¶
- Variables
- func IsNil(err error) bool
- func Marshal(ctx context.Context, data interface{}, options *Options) ([]byte, error)
- func Unmarshal(ctx context.Context, data []byte, v interface{}, options *Options) error
- type Cache
- type Depend
- type GetOrSetValue
- type KeyDepend
- type NilDep
- type Option
- type Options
- type Value
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDependNotValid = errors.New("depend not valid")
View Source
var (
ErrNil = errors.New("cache: nil")
)
Functions ¶
Types ¶
type Cache ¶
type Cache interface { GetOrSet(ctx context.Context, key string, set func() (interface{}, error), opts ...Option) Value Set(ctx context.Context, key string, val interface{}, opts ...Option) Value Get(ctx context.Context, key string, opts ...Option) Value Has(ctx context.Context, key string) (bool, error) Del(ctx context.Context, key string) error Close() error }
type GetOrSetValue ¶ added in v1.1.0
func (*GetOrSetValue) Scan ¶ added in v1.1.0
func (g *GetOrSetValue) Scan(v interface{}) error
type KeyDepend ¶
type KeyDepend struct { Key string `json:"key"` Value int64 `json:"Value"` // contains filtered or unexported fields }
KeyDepend key依赖
func NewKeyDepend ¶
func (*KeyDepend) InvalidKey ¶
InvalidKey 使key失效
type Options ¶
func NewOptions ¶
Click to show internal directories.
Click to hide internal directories.