Documentation
¶
Index ¶
- Variables
- type Cacher
- type FlagCache
- func (f *FlagCache) CreateFlag(ctx context.Context, r *flipt.CreateFlagRequest) (*flipt.Flag, error)
- func (f *FlagCache) CreateVariant(ctx context.Context, r *flipt.CreateVariantRequest) (*flipt.Variant, error)
- func (f *FlagCache) DeleteFlag(ctx context.Context, r *flipt.DeleteFlagRequest) error
- func (f *FlagCache) DeleteVariant(ctx context.Context, r *flipt.DeleteVariantRequest) error
- func (f *FlagCache) GetFlag(ctx context.Context, r *flipt.GetFlagRequest) (*flipt.Flag, error)
- func (f *FlagCache) ListFlags(ctx context.Context, r *flipt.ListFlagRequest) ([]*flipt.Flag, error)
- func (f *FlagCache) UpdateFlag(ctx context.Context, r *flipt.UpdateFlagRequest) (*flipt.Flag, error)
- func (f *FlagCache) UpdateVariant(ctx context.Context, r *flipt.UpdateVariantRequest) (*flipt.Variant, error)
Constants ¶
This section is empty.
Variables ¶
var ErrCacheCorrupt = errors.New("cache corrupted")
ErrCacheCorrupt represents a corrupt cache error
Functions ¶
This section is empty.
Types ¶
type Cacher ¶
type Cacher interface { Get(key interface{}) (interface{}, bool) Add(key, value interface{}) bool Remove(key interface{}) }
Cacher modifies and queries a cache
type FlagCache ¶
type FlagCache struct {
// contains filtered or unexported fields
}
FlagCache wraps a FlagStore and provides caching
func NewFlagCache ¶
NewFlagCache creates a FlagCache by wrapping a storage.FlagStore
func (*FlagCache) CreateFlag ¶
func (f *FlagCache) CreateFlag(ctx context.Context, r *flipt.CreateFlagRequest) (*flipt.Flag, error)
CreateFlag delegates to the underlying store, caching the result if no error
func (*FlagCache) CreateVariant ¶
func (f *FlagCache) CreateVariant(ctx context.Context, r *flipt.CreateVariantRequest) (*flipt.Variant, error)
CreateVariant invalidates the cache key and delegates to the underlying store
func (*FlagCache) DeleteFlag ¶
DeleteFlag invalidates the cache key and delegates to the underlying store
func (*FlagCache) DeleteVariant ¶
DeleteVariant invalidates the cache key and delegates to the underlying store
func (*FlagCache) GetFlag ¶
GetFlag returns the flag from the cache if it exists; otherwise it delegates to the underlying store caching the result if no error
func (*FlagCache) UpdateFlag ¶
func (f *FlagCache) UpdateFlag(ctx context.Context, r *flipt.UpdateFlagRequest) (*flipt.Flag, error)
UpdateFlag invalidates the cache key and delegates to the underlying store
func (*FlagCache) UpdateVariant ¶
func (f *FlagCache) UpdateVariant(ctx context.Context, r *flipt.UpdateVariantRequest) (*flipt.Variant, error)
UpdateVariant invalidates the cache key and delegates to the underlying store