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
- Variables
- type BarCache
- func (s *BarCache) Get(ctx context.Context, ID string) (model.Bar, error)
- func (s *BarCache) GetM(ID string) *BarMultiGetter
- func (s *BarCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*BarPromise, error)
- func (s *BarCache) Invalid(ctx context.Context, ID string) error
- func (s *BarCache) InvalidAll(ctx context.Context, version string) error
- func (s *BarCache) MGetter() *BarMultiGetter
- func (s *BarCache) Update(ctx context.Context, ID string) error
- type BarMultiGetter
- type BarPromise
- type BarQuerySet
- type Client
- type FixCache
- func (s *FixCache) Get(ctx context.Context) (string, error)
- func (s *FixCache) GetM() *FixMultiGetter
- func (s *FixCache) GetP(ctx context.Context, pp *cacheme.CachePipeline) (*FixPromise, error)
- func (s *FixCache) Invalid(ctx context.Context) error
- func (s *FixCache) InvalidAll(ctx context.Context, version string) error
- func (s *FixCache) MGetter() *FixMultiGetter
- func (s *FixCache) Update(ctx context.Context) error
- type FixMultiGetter
- type FixPromise
- type FixQuerySet
- type FooCache
- func (s *FooCache) Get(ctx context.Context, ID string) (model.Foo, error)
- func (s *FooCache) GetM(ID string) *FooMultiGetter
- func (s *FooCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*FooPromise, error)
- func (s *FooCache) Invalid(ctx context.Context, ID string) error
- func (s *FooCache) InvalidAll(ctx context.Context, version string) error
- func (s *FooCache) MGetter() *FooMultiGetter
- func (s *FooCache) Update(ctx context.Context, ID string) error
- type FooListCache
- func (s *FooListCache) Get(ctx context.Context, ID string) ([]model.Foo, error)
- func (s *FooListCache) GetM(ID string) *FooListMultiGetter
- func (s *FooListCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*FooListPromise, error)
- func (s *FooListCache) Invalid(ctx context.Context, ID string) error
- func (s *FooListCache) InvalidAll(ctx context.Context, version string) error
- func (s *FooListCache) MGetter() *FooListMultiGetter
- func (s *FooListCache) Update(ctx context.Context, ID string) error
- type FooListMultiGetter
- type FooListPCache
- func (s *FooListPCache) Get(ctx context.Context, ID string) ([]*model.Foo, error)
- func (s *FooListPCache) GetM(ID string) *FooListPMultiGetter
- func (s *FooListPCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*FooListPPromise, error)
- func (s *FooListPCache) Invalid(ctx context.Context, ID string) error
- func (s *FooListPCache) InvalidAll(ctx context.Context, version string) error
- func (s *FooListPCache) MGetter() *FooListPMultiGetter
- func (s *FooListPCache) Update(ctx context.Context, ID string) error
- type FooListPMultiGetter
- type FooListPPromise
- type FooListPQuerySet
- type FooListPromise
- type FooListQuerySet
- type FooMapCache
- func (s *FooMapCache) Get(ctx context.Context, ID string) (map[string]string, error)
- func (s *FooMapCache) GetM(ID string) *FooMapMultiGetter
- func (s *FooMapCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*FooMapPromise, error)
- func (s *FooMapCache) Invalid(ctx context.Context, ID string) error
- func (s *FooMapCache) InvalidAll(ctx context.Context, version string) error
- func (s *FooMapCache) MGetter() *FooMapMultiGetter
- func (s *FooMapCache) Update(ctx context.Context, ID string) error
- type FooMapMultiGetter
- type FooMapPromise
- type FooMapQuerySet
- type FooMapSCache
- func (s *FooMapSCache) Get(ctx context.Context, ID string) (map[model.Foo]model.Bar, error)
- func (s *FooMapSCache) GetM(ID string) *FooMapSMultiGetter
- func (s *FooMapSCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*FooMapSPromise, error)
- func (s *FooMapSCache) Invalid(ctx context.Context, ID string) error
- func (s *FooMapSCache) InvalidAll(ctx context.Context, version string) error
- func (s *FooMapSCache) MGetter() *FooMapSMultiGetter
- func (s *FooMapSCache) Update(ctx context.Context, ID string) error
- type FooMapSMultiGetter
- type FooMapSPromise
- type FooMapSQuerySet
- type FooMultiGetter
- type FooPCache
- func (s *FooPCache) Get(ctx context.Context, ID string) (*model.Foo, error)
- func (s *FooPCache) GetM(ID string) *FooPMultiGetter
- func (s *FooPCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*FooPPromise, error)
- func (s *FooPCache) Invalid(ctx context.Context, ID string) error
- func (s *FooPCache) InvalidAll(ctx context.Context, version string) error
- func (s *FooPCache) MGetter() *FooPMultiGetter
- func (s *FooPCache) Update(ctx context.Context, ID string) error
- type FooPMultiGetter
- type FooPPromise
- type FooPQuerySet
- type FooPromise
- type FooQuerySet
- type SimpleCache
- func (s *SimpleCache) Get(ctx context.Context, ID string) (string, error)
- func (s *SimpleCache) GetM(ID string) *SimpleMultiGetter
- func (s *SimpleCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*SimplePromise, error)
- func (s *SimpleCache) Invalid(ctx context.Context, ID string) error
- func (s *SimpleCache) InvalidAll(ctx context.Context, version string) error
- func (s *SimpleCache) MGetter() *SimpleMultiGetter
- func (s *SimpleCache) Update(ctx context.Context, ID string) error
- type SimpleFlightCache
- func (s *SimpleFlightCache) Get(ctx context.Context, ID string) (string, error)
- func (s *SimpleFlightCache) GetM(ID string) *SimpleFlightMultiGetter
- func (s *SimpleFlightCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*SimpleFlightPromise, error)
- func (s *SimpleFlightCache) Invalid(ctx context.Context, ID string) error
- func (s *SimpleFlightCache) InvalidAll(ctx context.Context, version string) error
- func (s *SimpleFlightCache) MGetter() *SimpleFlightMultiGetter
- func (s *SimpleFlightCache) Update(ctx context.Context, ID string) error
- type SimpleFlightMultiGetter
- type SimpleFlightPromise
- type SimpleFlightQuerySet
- type SimpleMultiCache
- func (s *SimpleMultiCache) Get(ctx context.Context, Foo string, Bar string, ID string) (string, error)
- func (s *SimpleMultiCache) GetM(Foo string, Bar string, ID string) *SimpleMultiMultiGetter
- func (s *SimpleMultiCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, Foo string, Bar string, ...) (*SimpleMultiPromise, error)
- func (s *SimpleMultiCache) Invalid(ctx context.Context, Foo string, Bar string, ID string) error
- func (s *SimpleMultiCache) InvalidAll(ctx context.Context, version string) error
- func (s *SimpleMultiCache) MGetter() *SimpleMultiMultiGetter
- func (s *SimpleMultiCache) Update(ctx context.Context, Foo string, Bar string, ID string) error
- type SimpleMultiGetter
- type SimpleMultiMultiGetter
- type SimpleMultiPromise
- type SimpleMultiQuerySet
- type SimplePromise
- type SimpleQuerySet
Constants ¶
const ( Hit = "HIT" Miss = "MISS" Fetch = "FETCH" )
Variables ¶
var BarCacheStore = &BarCache{tag: "Bar", singleflight: false, metadata: false}
var FixCacheStore = &FixCache{tag: "Fix", singleflight: false, metadata: true}
var FooCacheStore = &FooCache{tag: "Foo", singleflight: false, metadata: true}
var FooListCacheStore = &FooListCache{tag: "FooList", singleflight: false, metadata: true}
var FooListPCacheStore = &FooListPCache{tag: "FooListP", singleflight: false, metadata: true}
var FooMapCacheStore = &FooMapCache{tag: "FooMap", singleflight: false, metadata: true}
var FooMapSCacheStore = &FooMapSCache{tag: "FooMapS", singleflight: false, metadata: true}
var FooPCacheStore = &FooPCache{tag: "FooP", singleflight: false, metadata: true}
var SimpleCacheStore = &SimpleCache{tag: "Simple", singleflight: false, metadata: true}
var SimpleFlightCacheStore = &SimpleFlightCache{tag: "SimpleFlight", singleflight: true, metadata: true}
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) 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) InvalidAll ¶
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.
type BarMultiGetter ¶
type BarMultiGetter struct {
// contains filtered or unexported fields
}
func (*BarMultiGetter) Do ¶
func (g *BarMultiGetter) Do(ctx context.Context) (*BarQuerySet, error)
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
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.
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) GetM ¶
func (s *FixCache) GetM() *FixMultiGetter
GetM append a new get promise to getter.
func (*FixCache) GetP ¶
func (s *FixCache) GetP(ctx context.Context, pp *cacheme.CachePipeline) (*FixPromise, error)
GetP return a pipeline getter.
func (*FixCache) InvalidAll ¶
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.
type FixMultiGetter ¶
type FixMultiGetter struct {
// contains filtered or unexported fields
}
func (*FixMultiGetter) Do ¶
func (g *FixMultiGetter) Do(ctx context.Context) (*FixQuerySet, error)
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) 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) InvalidAll ¶
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.
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) GetM ¶
func (s *FooListCache) GetM(ID string) *FooListMultiGetter
GetM append a new get promise to getter.
func (*FooListCache) GetP ¶
func (s *FooListCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*FooListPromise, error)
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.
type FooListMultiGetter ¶
type FooListMultiGetter struct {
// contains filtered or unexported fields
}
func (*FooListMultiGetter) Do ¶
func (g *FooListMultiGetter) Do(ctx context.Context) (*FooListQuerySet, error)
Do send all requests to redis using pipeline and get results, missing parts will call fetch function.
func (*FooListMultiGetter) GetM ¶
func (g *FooListMultiGetter) GetM(ID string) *FooListMultiGetter
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) GetM ¶
func (s *FooListPCache) GetM(ID string) *FooListPMultiGetter
GetM append a new get promise to getter.
func (*FooListPCache) GetP ¶
func (s *FooListPCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*FooListPPromise, error)
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.
type FooListPMultiGetter ¶
type FooListPMultiGetter struct {
// contains filtered or unexported fields
}
func (*FooListPMultiGetter) Do ¶
func (g *FooListPMultiGetter) Do(ctx context.Context) (*FooListPQuerySet, error)
Do send all requests to redis using pipeline and get results, missing parts will call fetch function.
func (*FooListPMultiGetter) GetM ¶
func (g *FooListPMultiGetter) GetM(ID string) *FooListPMultiGetter
GetM append a new get promise to getter.
type FooListPPromise ¶
type FooListPPromise struct {
// contains filtered or unexported fields
}
FooListPPromise is the promise for FooListP
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
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) GetM ¶
func (s *FooMapCache) GetM(ID string) *FooMapMultiGetter
GetM append a new get promise to getter.
func (*FooMapCache) GetP ¶
func (s *FooMapCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*FooMapPromise, error)
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.
type FooMapMultiGetter ¶
type FooMapMultiGetter struct {
// contains filtered or unexported fields
}
func (*FooMapMultiGetter) Do ¶
func (g *FooMapMultiGetter) Do(ctx context.Context) (*FooMapQuerySet, error)
Do send all requests to redis using pipeline and get results, missing parts will call fetch function.
func (*FooMapMultiGetter) GetM ¶
func (g *FooMapMultiGetter) GetM(ID string) *FooMapMultiGetter
GetM append a new get promise to getter.
type FooMapPromise ¶
type FooMapPromise struct {
// contains filtered or unexported fields
}
FooMapPromise is the promise for FooMap
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) GetM ¶
func (s *FooMapSCache) GetM(ID string) *FooMapSMultiGetter
GetM append a new get promise to getter.
func (*FooMapSCache) GetP ¶
func (s *FooMapSCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*FooMapSPromise, error)
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.
type FooMapSMultiGetter ¶
type FooMapSMultiGetter struct {
// contains filtered or unexported fields
}
func (*FooMapSMultiGetter) Do ¶
func (g *FooMapSMultiGetter) Do(ctx context.Context) (*FooMapSQuerySet, error)
Do send all requests to redis using pipeline and get results, missing parts will call fetch function.
func (*FooMapSMultiGetter) GetM ¶
func (g *FooMapSMultiGetter) GetM(ID string) *FooMapSMultiGetter
GetM append a new get promise to getter.
type FooMapSPromise ¶
type FooMapSPromise struct {
// contains filtered or unexported fields
}
FooMapSPromise is the promise for FooMapS
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.
type FooMultiGetter ¶
type FooMultiGetter struct {
// contains filtered or unexported fields
}
func (*FooMultiGetter) Do ¶
func (g *FooMultiGetter) Do(ctx context.Context) (*FooQuerySet, error)
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) GetM ¶
func (s *FooPCache) GetM(ID string) *FooPMultiGetter
GetM append a new get promise to getter.
func (*FooPCache) GetP ¶
func (s *FooPCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*FooPPromise, error)
GetP return a pipeline getter.
func (*FooPCache) InvalidAll ¶
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.
type FooPMultiGetter ¶
type FooPMultiGetter struct {
// contains filtered or unexported fields
}
func (*FooPMultiGetter) Do ¶
func (g *FooPMultiGetter) Do(ctx context.Context) (*FooPQuerySet, error)
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
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
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) GetM ¶
func (s *SimpleCache) GetM(ID string) *SimpleMultiGetter
GetM append a new get promise to getter.
func (*SimpleCache) GetP ¶
func (s *SimpleCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*SimplePromise, error)
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.
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) GetM ¶
func (s *SimpleFlightCache) GetM(ID string) *SimpleFlightMultiGetter
GetM append a new get promise to getter.
func (*SimpleFlightCache) GetP ¶
func (s *SimpleFlightCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, ID string) (*SimpleFlightPromise, error)
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 ¶
func (s *SimpleFlightCache) MGetter() *SimpleFlightMultiGetter
MGetter return a new multiple getter for current store.
type SimpleFlightMultiGetter ¶
type SimpleFlightMultiGetter struct {
// contains filtered or unexported fields
}
func (*SimpleFlightMultiGetter) Do ¶
func (g *SimpleFlightMultiGetter) Do(ctx context.Context) (*SimpleFlightQuerySet, error)
Do send all requests to redis using pipeline and get results, missing parts will call fetch function.
func (*SimpleFlightMultiGetter) GetM ¶
func (g *SimpleFlightMultiGetter) GetM(ID string) *SimpleFlightMultiGetter
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 ¶
func (s *SimpleMultiCache) GetM(Foo string, Bar string, ID string) *SimpleMultiMultiGetter
GetM append a new get promise to getter.
func (*SimpleMultiCache) GetP ¶
func (s *SimpleMultiCache) GetP(ctx context.Context, pp *cacheme.CachePipeline, Foo string, Bar string, ID string) (*SimpleMultiPromise, error)
GetP return a pipeline getter.
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 ¶
func (s *SimpleMultiCache) MGetter() *SimpleMultiMultiGetter
MGetter return a new multiple getter for current store.
type SimpleMultiGetter ¶
type SimpleMultiGetter struct {
// contains filtered or unexported fields
}
func (*SimpleMultiGetter) Do ¶
func (g *SimpleMultiGetter) Do(ctx context.Context) (*SimpleQuerySet, error)
Do send all requests to redis using pipeline and get results, missing parts will call fetch function.
func (*SimpleMultiGetter) GetM ¶
func (g *SimpleMultiGetter) GetM(ID string) *SimpleMultiGetter
GetM append a new get promise to getter.
type SimpleMultiMultiGetter ¶
type SimpleMultiMultiGetter struct {
// contains filtered or unexported fields
}
func (*SimpleMultiMultiGetter) Do ¶
func (g *SimpleMultiMultiGetter) Do(ctx context.Context) (*SimpleMultiQuerySet, error)
Do send all requests to redis using pipeline and get results, missing parts will call fetch function.
func (*SimpleMultiMultiGetter) GetM ¶
func (g *SimpleMultiMultiGetter) GetM(Foo string, Bar string, ID string) *SimpleMultiMultiGetter
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 ¶
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.