store

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Code generated by cacheme, DO NOT EDIT.

Code generated by cacheme, DO NOT EDIT.

Code generated by cacheme, DO NOT EDIT.

Code generated by cacheme, DO NOT EDIT.

Code generated by cacheme, DO NOT EDIT.

Code generated by cacheme, DO NOT EDIT.

Code generated by cacheme, DO NOT EDIT.

Code generated by cacheme, DO NOT EDIT.

Code generated by cacheme, DO NOT EDIT.

Code generated by cacheme, DO NOT EDIT.

Code generated by cacheme, DO NOT EDIT.

Code generated by cacheme, DO NOT EDIT.

Index

Constants

View Source
const (
	Hit   = "HIT"
	Miss  = "MISS"
	Fetch = "FETCH"
)

Variables

View Source
var BarCacheStore = &BarCache{tag: "Bar", singleflight: false, metadata: false}
View Source
var FixCacheStore = &FixCache{tag: "Fix", singleflight: false, metadata: true}
View Source
var FooCacheStore = &FooCache{tag: "Foo", singleflight: false, metadata: true}
View Source
var FooListCacheStore = &FooListCache{tag: "FooList", singleflight: false, metadata: true}
View Source
var FooListPCacheStore = &FooListPCache{tag: "FooListP", singleflight: false, metadata: true}
View Source
var FooMapCacheStore = &FooMapCache{tag: "FooMap", singleflight: false, metadata: true}
View Source
var FooMapSCacheStore = &FooMapSCache{tag: "FooMapS", singleflight: false, metadata: true}
View Source
var FooPCacheStore = &FooPCache{tag: "FooP", singleflight: false, metadata: true}
View Source
var SimpleCacheStore = &SimpleCache{tag: "Simple", singleflight: false, metadata: true}
View Source
var SimpleFlightCacheStore = &SimpleFlightCache{tag: "SimpleFlight", singleflight: true, metadata: true}
View Source
var SimpleMultiCacheStore = &SimpleMultiCache{tag: "SimpleMulti", singleflight: false, metadata: true}

Functions

This section is empty.

Types

type BarCache

type BarCache struct {
	Fetch func(ctx context.Context, ID string) (model.Bar, error)
	// contains filtered or unexported fields
}

BarCache is the store for Bar

func (*BarCache) Get

func (s *BarCache) Get(ctx context.Context, ID string) (model.Bar, error)

Get return result from store.

func (*BarCache) GetM

func (s *BarCache) GetM(ID string) *BarMultiGetter

GetM append a new get promise to getter.

func (*BarCache) GetP

func (s *BarCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*BarPromise, error)

GetP return a pipeline getter.

func (*BarCache) Invalid

func (s *BarCache) Invalid(ctx context.Context, ID string) error

Update remove cache with given params from Redis.

func (*BarCache) InvalidAll

func (s *BarCache) InvalidAll(ctx context.Context, version string) error

InvalidAll will invalid all caches match provided version from current store.

func (*BarCache) MGetter

func (s *BarCache) MGetter() *BarMultiGetter

MGetter return a new multiple getter for current store.

func (*BarCache) Update

func (s *BarCache) Update(ctx context.Context, ID string) error

Update call fetch function with given params and update Redis.

type BarMultiGetter

type BarMultiGetter struct {
	// contains filtered or unexported fields
}

func (*BarMultiGetter) Do

Do send all requests to redis using pipeline and get results, missing parts will call fetch function.

func (*BarMultiGetter) GetM

func (g *BarMultiGetter) GetM(ID string) *BarMultiGetter

GetM append a new get promise to getter.

type BarPromise

type BarPromise struct {
	// contains filtered or unexported fields
}

BarPromise is the promise for Bar

func (*BarPromise) Result

func (p *BarPromise) Result() (model.Bar, error)

Result return promise result.

type BarQuerySet

type BarQuerySet struct {
	// contains filtered or unexported fields
}

BarQuerySet is a query struct, using Get to get a single element or GetSlice to get all elements.

func (*BarQuerySet) Get

func (q *BarQuerySet) Get(ID string) (model.Bar, error)

Get return single element for queryset with give params, return error if not found.

func (*BarQuerySet) GetSlice

func (q *BarQuerySet) GetSlice() []model.Bar

GetSlice return all elements from queryset. Same order as input.

type Client

type Client struct {
	FixCacheStore *FixCache

	SimpleCacheStore *SimpleCache

	SimpleMultiCacheStore *SimpleMultiCache

	FooMapCacheStore *FooMapCache

	FooCacheStore *FooCache

	BarCacheStore *BarCache

	FooPCacheStore *FooPCache

	FooListCacheStore *FooListCache

	FooListPCacheStore *FooListPCache

	FooMapSCacheStore *FooMapSCache

	SimpleFlightCacheStore *SimpleFlightCache
	// contains filtered or unexported fields
}

Client is the cacheme client for all stores.

func New

func New(redis cacheme.RedisClient) *Client

New create a new cacheme client with given redis client.

func NewCluster

func NewCluster(redis cacheme.RedisClient) *Client

NewCluster create a new cacheme cluster client with given redis client.

func (*Client) NewPipeline

func (c *Client) NewPipeline() *cacheme.CachePipeline

NewPipeline returns a new cacheme pipeline.

func (*Client) Redis

func (c *Client) Redis() cacheme.RedisClient

Redis return the current redis client.

func (*Client) SetLogger

func (c *Client) SetLogger(l cacheme.Logger)

SetLogger set logger interface for current client.

type FixCache

type FixCache struct {
	Fetch func(ctx context.Context) (string, error)
	// contains filtered or unexported fields
}

FixCache is the store for Fix

func (*FixCache) Get

func (s *FixCache) Get(ctx context.Context) (string, error)

Get return result from store.

func (*FixCache) GetM

func (s *FixCache) GetM() *FixMultiGetter

GetM append a new get promise to getter.

func (*FixCache) GetP

GetP return a pipeline getter.

func (*FixCache) Invalid

func (s *FixCache) Invalid(ctx context.Context) error

Update remove cache with given params from Redis.

func (*FixCache) InvalidAll

func (s *FixCache) InvalidAll(ctx context.Context, version string) error

InvalidAll will invalid all caches match provided version from current store.

func (*FixCache) MGetter

func (s *FixCache) MGetter() *FixMultiGetter

MGetter return a new multiple getter for current store.

func (*FixCache) Update

func (s *FixCache) Update(ctx context.Context) error

Update call fetch function with given params and update Redis.

type FixMultiGetter

type FixMultiGetter struct {
	// contains filtered or unexported fields
}

func (*FixMultiGetter) Do

Do send all requests to redis using pipeline and get results, missing parts will call fetch function.

func (*FixMultiGetter) GetM

func (g *FixMultiGetter) GetM() *FixMultiGetter

GetM append a new get promise to getter.

type FixPromise

type FixPromise struct {
	// contains filtered or unexported fields
}

FixPromise is the promise for Fix

func (*FixPromise) Result

func (p *FixPromise) Result() (string, error)

Result return promise result.

type FixQuerySet

type FixQuerySet struct {
	// contains filtered or unexported fields
}

FixQuerySet is a query struct, using Get to get a single element or GetSlice to get all elements.

func (*FixQuerySet) Get

func (q *FixQuerySet) Get() (string, error)

Get return single element for queryset with give params, return error if not found.

func (*FixQuerySet) GetSlice

func (q *FixQuerySet) GetSlice() []string

GetSlice return all elements from queryset. Same order as input.

type FooCache

type FooCache struct {
	Fetch func(ctx context.Context, ID string) (model.Foo, error)
	// contains filtered or unexported fields
}

FooCache is the store for Foo

func (*FooCache) Get

func (s *FooCache) Get(ctx context.Context, ID string) (model.Foo, error)

Get return result from store.

func (*FooCache) GetM

func (s *FooCache) GetM(ID string) *FooMultiGetter

GetM append a new get promise to getter.

func (*FooCache) GetP

func (s *FooCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*FooPromise, error)

GetP return a pipeline getter.

func (*FooCache) Invalid

func (s *FooCache) Invalid(ctx context.Context, ID string) error

Update remove cache with given params from Redis.

func (*FooCache) InvalidAll

func (s *FooCache) InvalidAll(ctx context.Context, version string) error

InvalidAll will invalid all caches match provided version from current store.

func (*FooCache) MGetter

func (s *FooCache) MGetter() *FooMultiGetter

MGetter return a new multiple getter for current store.

func (*FooCache) Update

func (s *FooCache) Update(ctx context.Context, ID string) error

Update call fetch function with given params and update Redis.

type FooListCache

type FooListCache struct {
	Fetch func(ctx context.Context, ID string) ([]model.Foo, error)
	// contains filtered or unexported fields
}

FooListCache is the store for FooList

func (*FooListCache) Get

func (s *FooListCache) Get(ctx context.Context, ID string) ([]model.Foo, error)

Get return result from store.

func (*FooListCache) GetM

func (s *FooListCache) GetM(ID string) *FooListMultiGetter

GetM append a new get promise to getter.

func (*FooListCache) GetP

GetP return a pipeline getter.

func (*FooListCache) Invalid

func (s *FooListCache) Invalid(ctx context.Context, ID string) error

Update remove cache with given params from Redis.

func (*FooListCache) InvalidAll

func (s *FooListCache) InvalidAll(ctx context.Context, version string) error

InvalidAll will invalid all caches match provided version from current store.

func (*FooListCache) MGetter

func (s *FooListCache) MGetter() *FooListMultiGetter

MGetter return a new multiple getter for current store.

func (*FooListCache) Update

func (s *FooListCache) Update(ctx context.Context, ID string) error

Update call fetch function with given params and update Redis.

type FooListMultiGetter

type FooListMultiGetter struct {
	// contains filtered or unexported fields
}

func (*FooListMultiGetter) Do

Do send all requests to redis using pipeline and get results, missing parts will call fetch function.

func (*FooListMultiGetter) GetM

GetM append a new get promise to getter.

type FooListPCache

type FooListPCache struct {
	Fetch func(ctx context.Context, ID string) ([]*model.Foo, error)
	// contains filtered or unexported fields
}

FooListPCache is the store for FooListP

func (*FooListPCache) Get

func (s *FooListPCache) Get(ctx context.Context, ID string) ([]*model.Foo, error)

Get return result from store.

func (*FooListPCache) GetM

GetM append a new get promise to getter.

func (*FooListPCache) GetP

GetP return a pipeline getter.

func (*FooListPCache) Invalid

func (s *FooListPCache) Invalid(ctx context.Context, ID string) error

Update remove cache with given params from Redis.

func (*FooListPCache) InvalidAll

func (s *FooListPCache) InvalidAll(ctx context.Context, version string) error

InvalidAll will invalid all caches match provided version from current store.

func (*FooListPCache) MGetter

func (s *FooListPCache) MGetter() *FooListPMultiGetter

MGetter return a new multiple getter for current store.

func (*FooListPCache) Update

func (s *FooListPCache) Update(ctx context.Context, ID string) error

Update call fetch function with given params and update Redis.

type FooListPMultiGetter

type FooListPMultiGetter struct {
	// contains filtered or unexported fields
}

func (*FooListPMultiGetter) Do

Do send all requests to redis using pipeline and get results, missing parts will call fetch function.

func (*FooListPMultiGetter) GetM

GetM append a new get promise to getter.

type FooListPPromise

type FooListPPromise struct {
	// contains filtered or unexported fields
}

FooListPPromise is the promise for FooListP

func (*FooListPPromise) Result

func (p *FooListPPromise) Result() ([]*model.Foo, error)

Result return promise result.

type FooListPQuerySet

type FooListPQuerySet struct {
	// contains filtered or unexported fields
}

FooListPQuerySet is a query struct, using Get to get a single element or GetSlice to get all elements.

func (*FooListPQuerySet) Get

func (q *FooListPQuerySet) Get(ID string) ([]*model.Foo, error)

Get return single element for queryset with give params, return error if not found.

func (*FooListPQuerySet) GetSlice

func (q *FooListPQuerySet) GetSlice() [][]*model.Foo

GetSlice return all elements from queryset. Same order as input.

type FooListPromise

type FooListPromise struct {
	// contains filtered or unexported fields
}

FooListPromise is the promise for FooList

func (*FooListPromise) Result

func (p *FooListPromise) Result() ([]model.Foo, error)

Result return promise result.

type FooListQuerySet

type FooListQuerySet struct {
	// contains filtered or unexported fields
}

FooListQuerySet is a query struct, using Get to get a single element or GetSlice to get all elements.

func (*FooListQuerySet) Get

func (q *FooListQuerySet) Get(ID string) ([]model.Foo, error)

Get return single element for queryset with give params, return error if not found.

func (*FooListQuerySet) GetSlice

func (q *FooListQuerySet) GetSlice() [][]model.Foo

GetSlice return all elements from queryset. Same order as input.

type FooMapCache

type FooMapCache struct {
	Fetch func(ctx context.Context, ID string) (map[string]string, error)
	// contains filtered or unexported fields
}

FooMapCache is the store for FooMap

func (*FooMapCache) Get

func (s *FooMapCache) Get(ctx context.Context, ID string) (map[string]string, error)

Get return result from store.

func (*FooMapCache) GetM

func (s *FooMapCache) GetM(ID string) *FooMapMultiGetter

GetM append a new get promise to getter.

func (*FooMapCache) GetP

GetP return a pipeline getter.

func (*FooMapCache) Invalid

func (s *FooMapCache) Invalid(ctx context.Context, ID string) error

Update remove cache with given params from Redis.

func (*FooMapCache) InvalidAll

func (s *FooMapCache) InvalidAll(ctx context.Context, version string) error

InvalidAll will invalid all caches match provided version from current store.

func (*FooMapCache) MGetter

func (s *FooMapCache) MGetter() *FooMapMultiGetter

MGetter return a new multiple getter for current store.

func (*FooMapCache) Update

func (s *FooMapCache) Update(ctx context.Context, ID string) error

Update call fetch function with given params and update Redis.

type FooMapMultiGetter

type FooMapMultiGetter struct {
	// contains filtered or unexported fields
}

func (*FooMapMultiGetter) Do

Do send all requests to redis using pipeline and get results, missing parts will call fetch function.

func (*FooMapMultiGetter) GetM

GetM append a new get promise to getter.

type FooMapPromise

type FooMapPromise struct {
	// contains filtered or unexported fields
}

FooMapPromise is the promise for FooMap

func (*FooMapPromise) Result

func (p *FooMapPromise) Result() (map[string]string, error)

Result return promise result.

type FooMapQuerySet

type FooMapQuerySet struct {
	// contains filtered or unexported fields
}

FooMapQuerySet is a query struct, using Get to get a single element or GetSlice to get all elements.

func (*FooMapQuerySet) Get

func (q *FooMapQuerySet) Get(ID string) (map[string]string, error)

Get return single element for queryset with give params, return error if not found.

func (*FooMapQuerySet) GetSlice

func (q *FooMapQuerySet) GetSlice() []map[string]string

GetSlice return all elements from queryset. Same order as input.

type FooMapSCache

type FooMapSCache struct {
	Fetch func(ctx context.Context, ID string) (map[model.Foo]model.Bar, error)
	// contains filtered or unexported fields
}

FooMapSCache is the store for FooMapS

func (*FooMapSCache) Get

func (s *FooMapSCache) Get(ctx context.Context, ID string) (map[model.Foo]model.Bar, error)

Get return result from store.

func (*FooMapSCache) GetM

func (s *FooMapSCache) GetM(ID string) *FooMapSMultiGetter

GetM append a new get promise to getter.

func (*FooMapSCache) GetP

GetP return a pipeline getter.

func (*FooMapSCache) Invalid

func (s *FooMapSCache) Invalid(ctx context.Context, ID string) error

Update remove cache with given params from Redis.

func (*FooMapSCache) InvalidAll

func (s *FooMapSCache) InvalidAll(ctx context.Context, version string) error

InvalidAll will invalid all caches match provided version from current store.

func (*FooMapSCache) MGetter

func (s *FooMapSCache) MGetter() *FooMapSMultiGetter

MGetter return a new multiple getter for current store.

func (*FooMapSCache) Update

func (s *FooMapSCache) Update(ctx context.Context, ID string) error

Update call fetch function with given params and update Redis.

type FooMapSMultiGetter

type FooMapSMultiGetter struct {
	// contains filtered or unexported fields
}

func (*FooMapSMultiGetter) Do

Do send all requests to redis using pipeline and get results, missing parts will call fetch function.

func (*FooMapSMultiGetter) GetM

GetM append a new get promise to getter.

type FooMapSPromise

type FooMapSPromise struct {
	// contains filtered or unexported fields
}

FooMapSPromise is the promise for FooMapS

func (*FooMapSPromise) Result

func (p *FooMapSPromise) Result() (map[model.Foo]model.Bar, error)

Result return promise result.

type FooMapSQuerySet

type FooMapSQuerySet struct {
	// contains filtered or unexported fields
}

FooMapSQuerySet is a query struct, using Get to get a single element or GetSlice to get all elements.

func (*FooMapSQuerySet) Get

func (q *FooMapSQuerySet) Get(ID string) (map[model.Foo]model.Bar, error)

Get return single element for queryset with give params, return error if not found.

func (*FooMapSQuerySet) GetSlice

func (q *FooMapSQuerySet) GetSlice() []map[model.Foo]model.Bar

GetSlice return all elements from queryset. Same order as input.

type FooMultiGetter

type FooMultiGetter struct {
	// contains filtered or unexported fields
}

func (*FooMultiGetter) Do

Do send all requests to redis using pipeline and get results, missing parts will call fetch function.

func (*FooMultiGetter) GetM

func (g *FooMultiGetter) GetM(ID string) *FooMultiGetter

GetM append a new get promise to getter.

type FooPCache

type FooPCache struct {
	Fetch func(ctx context.Context, ID string) (*model.Foo, error)
	// contains filtered or unexported fields
}

FooPCache is the store for FooP

func (*FooPCache) Get

func (s *FooPCache) Get(ctx context.Context, ID string) (*model.Foo, error)

Get return result from store.

func (*FooPCache) GetM

func (s *FooPCache) GetM(ID string) *FooPMultiGetter

GetM append a new get promise to getter.

func (*FooPCache) GetP

GetP return a pipeline getter.

func (*FooPCache) Invalid

func (s *FooPCache) Invalid(ctx context.Context, ID string) error

Update remove cache with given params from Redis.

func (*FooPCache) InvalidAll

func (s *FooPCache) InvalidAll(ctx context.Context, version string) error

InvalidAll will invalid all caches match provided version from current store.

func (*FooPCache) MGetter

func (s *FooPCache) MGetter() *FooPMultiGetter

MGetter return a new multiple getter for current store.

func (*FooPCache) Update

func (s *FooPCache) Update(ctx context.Context, ID string) error

Update call fetch function with given params and update Redis.

type FooPMultiGetter

type FooPMultiGetter struct {
	// contains filtered or unexported fields
}

func (*FooPMultiGetter) Do

Do send all requests to redis using pipeline and get results, missing parts will call fetch function.

func (*FooPMultiGetter) GetM

func (g *FooPMultiGetter) GetM(ID string) *FooPMultiGetter

GetM append a new get promise to getter.

type FooPPromise

type FooPPromise struct {
	// contains filtered or unexported fields
}

FooPPromise is the promise for FooP

func (*FooPPromise) Result

func (p *FooPPromise) Result() (*model.Foo, error)

Result return promise result.

type FooPQuerySet

type FooPQuerySet struct {
	// contains filtered or unexported fields
}

FooPQuerySet is a query struct, using Get to get a single element or GetSlice to get all elements.

func (*FooPQuerySet) Get

func (q *FooPQuerySet) Get(ID string) (*model.Foo, error)

Get return single element for queryset with give params, return error if not found.

func (*FooPQuerySet) GetSlice

func (q *FooPQuerySet) GetSlice() []*model.Foo

GetSlice return all elements from queryset. Same order as input.

type FooPromise

type FooPromise struct {
	// contains filtered or unexported fields
}

FooPromise is the promise for Foo

func (*FooPromise) Result

func (p *FooPromise) Result() (model.Foo, error)

Result return promise result.

type FooQuerySet

type FooQuerySet struct {
	// contains filtered or unexported fields
}

FooQuerySet is a query struct, using Get to get a single element or GetSlice to get all elements.

func (*FooQuerySet) Get

func (q *FooQuerySet) Get(ID string) (model.Foo, error)

Get return single element for queryset with give params, return error if not found.

func (*FooQuerySet) GetSlice

func (q *FooQuerySet) GetSlice() []model.Foo

GetSlice return all elements from queryset. Same order as input.

type SimpleCache

type SimpleCache struct {
	Fetch func(ctx context.Context, ID string) (string, error)
	// contains filtered or unexported fields
}

SimpleCache is the store for Simple

func (*SimpleCache) Get

func (s *SimpleCache) Get(ctx context.Context, ID string) (string, error)

Get return result from store.

func (*SimpleCache) GetM

func (s *SimpleCache) GetM(ID string) *SimpleMultiGetter

GetM append a new get promise to getter.

func (*SimpleCache) GetP

GetP return a pipeline getter.

func (*SimpleCache) Invalid

func (s *SimpleCache) Invalid(ctx context.Context, ID string) error

Update remove cache with given params from Redis.

func (*SimpleCache) InvalidAll

func (s *SimpleCache) InvalidAll(ctx context.Context, version string) error

InvalidAll will invalid all caches match provided version from current store.

func (*SimpleCache) MGetter

func (s *SimpleCache) MGetter() *SimpleMultiGetter

MGetter return a new multiple getter for current store.

func (*SimpleCache) Update

func (s *SimpleCache) Update(ctx context.Context, ID string) error

Update call fetch function with given params and update Redis.

type SimpleFlightCache

type SimpleFlightCache struct {
	Fetch func(ctx context.Context, ID string) (string, error)
	// contains filtered or unexported fields
}

SimpleFlightCache is the store for SimpleFlight

func (*SimpleFlightCache) Get

func (s *SimpleFlightCache) Get(ctx context.Context, ID string) (string, error)

Get return result from store.

func (*SimpleFlightCache) GetM

GetM append a new get promise to getter.

func (*SimpleFlightCache) GetP

GetP return a pipeline getter.

func (*SimpleFlightCache) Invalid

func (s *SimpleFlightCache) Invalid(ctx context.Context, ID string) error

Update remove cache with given params from Redis.

func (*SimpleFlightCache) InvalidAll

func (s *SimpleFlightCache) InvalidAll(ctx context.Context, version string) error

InvalidAll will invalid all caches match provided version from current store.

func (*SimpleFlightCache) MGetter

MGetter return a new multiple getter for current store.

func (*SimpleFlightCache) Update

func (s *SimpleFlightCache) Update(ctx context.Context, ID string) error

Update call fetch function with given params and update Redis.

type SimpleFlightMultiGetter

type SimpleFlightMultiGetter struct {
	// contains filtered or unexported fields
}

func (*SimpleFlightMultiGetter) Do

Do send all requests to redis using pipeline and get results, missing parts will call fetch function.

func (*SimpleFlightMultiGetter) GetM

GetM append a new get promise to getter.

type SimpleFlightPromise

type SimpleFlightPromise struct {
	// contains filtered or unexported fields
}

SimpleFlightPromise is the promise for SimpleFlight

func (*SimpleFlightPromise) Result

func (p *SimpleFlightPromise) Result() (string, error)

Result return promise result.

type SimpleFlightQuerySet

type SimpleFlightQuerySet struct {
	// contains filtered or unexported fields
}

SimpleFlightQuerySet is a query struct, using Get to get a single element or GetSlice to get all elements.

func (*SimpleFlightQuerySet) Get

func (q *SimpleFlightQuerySet) Get(ID string) (string, error)

Get return single element for queryset with give params, return error if not found.

func (*SimpleFlightQuerySet) GetSlice

func (q *SimpleFlightQuerySet) GetSlice() []string

GetSlice return all elements from queryset. Same order as input.

type SimpleMultiCache

type SimpleMultiCache struct {
	Fetch func(ctx context.Context, Foo string, Bar string, ID string) (string, error)
	// contains filtered or unexported fields
}

SimpleMultiCache is the store for SimpleMulti

func (*SimpleMultiCache) Get

func (s *SimpleMultiCache) Get(ctx context.Context, Foo string, Bar string, ID string) (string, error)

Get return result from store.

func (*SimpleMultiCache) GetM

GetM append a new get promise to getter.

func (*SimpleMultiCache) GetP

GetP return a pipeline getter.

func (*SimpleMultiCache) Invalid

func (s *SimpleMultiCache) Invalid(ctx context.Context, Foo string, Bar string, ID string) error

Update remove cache with given params from Redis.

func (*SimpleMultiCache) InvalidAll

func (s *SimpleMultiCache) InvalidAll(ctx context.Context, version string) error

InvalidAll will invalid all caches match provided version from current store.

func (*SimpleMultiCache) MGetter

MGetter return a new multiple getter for current store.

func (*SimpleMultiCache) Update

func (s *SimpleMultiCache) Update(ctx context.Context, Foo string, Bar string, ID string) error

Update call fetch function with given params and update Redis.

type SimpleMultiGetter

type SimpleMultiGetter struct {
	// contains filtered or unexported fields
}

func (*SimpleMultiGetter) Do

Do send all requests to redis using pipeline and get results, missing parts will call fetch function.

func (*SimpleMultiGetter) GetM

GetM append a new get promise to getter.

type SimpleMultiMultiGetter

type SimpleMultiMultiGetter struct {
	// contains filtered or unexported fields
}

func (*SimpleMultiMultiGetter) Do

Do send all requests to redis using pipeline and get results, missing parts will call fetch function.

func (*SimpleMultiMultiGetter) GetM

GetM append a new get promise to getter.

type SimpleMultiPromise

type SimpleMultiPromise struct {
	// contains filtered or unexported fields
}

SimpleMultiPromise is the promise for SimpleMulti

func (*SimpleMultiPromise) Result

func (p *SimpleMultiPromise) Result() (string, error)

Result return promise result.

type SimpleMultiQuerySet

type SimpleMultiQuerySet struct {
	// contains filtered or unexported fields
}

SimpleMultiQuerySet is a query struct, using Get to get a single element or GetSlice to get all elements.

func (*SimpleMultiQuerySet) Get

func (q *SimpleMultiQuerySet) Get(Foo string, Bar string, ID string) (string, error)

Get return single element for queryset with give params, return error if not found.

func (*SimpleMultiQuerySet) GetSlice

func (q *SimpleMultiQuerySet) GetSlice() []string

GetSlice return all elements from queryset. Same order as input.

type SimplePromise

type SimplePromise struct {
	// contains filtered or unexported fields
}

SimplePromise is the promise for Simple

func (*SimplePromise) Result

func (p *SimplePromise) Result() (string, error)

Result return promise result.

type SimpleQuerySet

type SimpleQuerySet struct {
	// contains filtered or unexported fields
}

SimpleQuerySet is a query struct, using Get to get a single element or GetSlice to get all elements.

func (*SimpleQuerySet) Get

func (q *SimpleQuerySet) Get(ID string) (string, error)

Get return single element for queryset with give params, return error if not found.

func (*SimpleQuerySet) GetSlice

func (q *SimpleQuerySet) GetSlice() []string

GetSlice return all elements from queryset. Same order as input.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL