Documentation ¶
Overview ¶
Package cache provides caching adapters for go-micro
The cache package should only be configured via yaml parameters or env variables. Cache instance should be accessed via micro client.Client and used to manually store and retreive cached values.
Package cache provides caching adapters for go-micro ¶
The cache package should only be configured via yaml parameters or env variables. Cache instance should be accessed via micro client.Client and used to manually store and retreive cached values.
Package cache provides caching adapters for go-micro ¶
The cache package should only be configured via yaml parameters or env variables. Cache instance should be accessed via micro client.Client and used to manually store and retreive cached values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CustomCache ¶
type CustomCache struct {
// contains filtered or unexported fields
}
A CustomCache provides go-micro compatible interface for custom cache providers. This structure is expected to be initialized automatically by fx.
func (*CustomCache) Delete ¶
func (c *CustomCache) Delete(ctx context.Context, key string) error
Delete removes from a gocache provided store by key. It returns the first error encountered while removing a cache entry by key.
A successful Delete returns err == nil.
func (*CustomCache) Get ¶
Get retreives from a gocache provided store by key. It returns the value, extraction time and the first error encountered while extracting the value by key.
A successful Get returns value != nil, time.Now() and err == nil.
func (*CustomCache) Put ¶
Put stores into a gocache provided store by key, value and expiration date It returns the first error encountered while settings a new cache value.
A successful Put returns err == nil.
func (*CustomCache) String ¶
func (c *CustomCache) String() string
String returns a gocache provided store name.