Documentation ¶
Index ¶
- Variables
- type Cacher
- type Store
- func (c *Store) CreateConstraint(ctx context.Context, r *flipt.CreateConstraintRequest) (*flipt.Constraint, error)
- func (c *Store) CreateDistribution(ctx context.Context, r *flipt.CreateDistributionRequest) (*flipt.Distribution, error)
- func (c *Store) CreateFlag(ctx context.Context, r *flipt.CreateFlagRequest) (*flipt.Flag, error)
- func (c *Store) CreateRule(ctx context.Context, r *flipt.CreateRuleRequest) (*flipt.Rule, error)
- func (c *Store) CreateSegment(ctx context.Context, r *flipt.CreateSegmentRequest) (*flipt.Segment, error)
- func (c *Store) CreateVariant(ctx context.Context, r *flipt.CreateVariantRequest) (*flipt.Variant, error)
- func (c *Store) DeleteConstraint(ctx context.Context, r *flipt.DeleteConstraintRequest) error
- func (c *Store) DeleteDistribution(ctx context.Context, r *flipt.DeleteDistributionRequest) error
- func (c *Store) DeleteFlag(ctx context.Context, r *flipt.DeleteFlagRequest) error
- func (c *Store) DeleteRule(ctx context.Context, r *flipt.DeleteRuleRequest) error
- func (c *Store) DeleteSegment(ctx context.Context, r *flipt.DeleteSegmentRequest) error
- func (c *Store) DeleteVariant(ctx context.Context, r *flipt.DeleteVariantRequest) error
- func (c *Store) GetEvaluationDistributions(ctx context.Context, ruleID string) ([]*storage.EvaluationDistribution, error)
- func (c *Store) GetEvaluationRules(ctx context.Context, flagKey string) ([]*storage.EvaluationRule, error)
- func (c *Store) GetFlag(ctx context.Context, k string) (*flipt.Flag, error)
- func (c *Store) GetRule(ctx context.Context, id string) (*flipt.Rule, error)
- func (c *Store) GetSegment(ctx context.Context, k string) (*flipt.Segment, error)
- func (c *Store) ListFlags(ctx context.Context, opts ...storage.QueryOption) ([]*flipt.Flag, error)
- func (c *Store) ListRules(ctx context.Context, flagKey string, opts ...storage.QueryOption) ([]*flipt.Rule, error)
- func (c *Store) ListSegments(ctx context.Context, opts ...storage.QueryOption) ([]*flipt.Segment, error)
- func (c *Store) OrderRules(ctx context.Context, r *flipt.OrderRulesRequest) error
- func (c *Store) String() string
- func (c *Store) UpdateConstraint(ctx context.Context, r *flipt.UpdateConstraintRequest) (*flipt.Constraint, error)
- func (c *Store) UpdateDistribution(ctx context.Context, r *flipt.UpdateDistributionRequest) (*flipt.Distribution, error)
- func (c *Store) UpdateFlag(ctx context.Context, r *flipt.UpdateFlagRequest) (*flipt.Flag, error)
- func (c *Store) UpdateRule(ctx context.Context, r *flipt.UpdateRuleRequest) (*flipt.Rule, error)
- func (c *Store) UpdateSegment(ctx context.Context, r *flipt.UpdateSegmentRequest) (*flipt.Segment, error)
- func (c *Store) UpdateVariant(ctx context.Context, r *flipt.UpdateVariantRequest) (*flipt.Variant, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCorrupt represents a corrupt cache error ErrCorrupt = errors.New("cache corrupted") )
Functions ¶
This section is empty.
Types ¶
type Cacher ¶
type Cacher interface { // Get retrieves a value from the cache, the bool indicates if the item was found Get(ctx context.Context, key string) (interface{}, bool, error) // Set sets a value in the cache Set(ctx context.Context, key string, value interface{}) error // Delete removes a value from the cache Delete(ctx context.Context, key string) error // Flush removes all values from the cache Flush(ctx context.Context) error fmt.Stringer }
Cacher modifies and queries a cache
type Store ¶ added in v1.9.0
type Store struct {
// contains filtered or unexported fields
}
Store wraps an existing storage.Store and provides caching
func (*Store) CreateConstraint ¶ added in v1.9.0
func (c *Store) CreateConstraint(ctx context.Context, r *flipt.CreateConstraintRequest) (*flipt.Constraint, error)
CreateConstraint delegates to the underlying store, flushing the cache in the process
func (*Store) CreateDistribution ¶ added in v1.9.0
func (c *Store) CreateDistribution(ctx context.Context, r *flipt.CreateDistributionRequest) (*flipt.Distribution, error)
CreateDistribution delegates to the underlying store, flushing the cache in the process
func (*Store) CreateFlag ¶ added in v1.9.0
CreateFlag delegates to the underlying store, flushing the cache in the process
func (*Store) CreateRule ¶ added in v1.9.0
CreateRule delegates to the underlying store, flushing the cache in the process
func (*Store) CreateSegment ¶ added in v1.9.0
func (c *Store) CreateSegment(ctx context.Context, r *flipt.CreateSegmentRequest) (*flipt.Segment, error)
CreateSegment delegates to the underlying store, flushing the cache in the process
func (*Store) CreateVariant ¶ added in v1.9.0
func (c *Store) CreateVariant(ctx context.Context, r *flipt.CreateVariantRequest) (*flipt.Variant, error)
CreateVariant delegates to the underlying store, flushing the cache in the process
func (*Store) DeleteConstraint ¶ added in v1.9.0
DeleteConstraint delegates to the underlying store, flushing the cache in the process
func (*Store) DeleteDistribution ¶ added in v1.9.0
DeleteDistribution delegates to the underlying store, flushing the cache in the process
func (*Store) DeleteFlag ¶ added in v1.9.0
DeleteFlag delegates to the underlying store, flushing the cache in the process
func (*Store) DeleteRule ¶ added in v1.9.0
DeleteRule delegates to the underlying store, flushing the cache in the process
func (*Store) DeleteSegment ¶ added in v1.9.0
DeleteSegment delegates to the underlying store, flushing the cache in the process
func (*Store) DeleteVariant ¶ added in v1.9.0
DeleteVariant delegates to the underlying store, flushing the cache in the process
func (*Store) GetEvaluationDistributions ¶ added in v1.9.0
func (c *Store) GetEvaluationDistributions(ctx context.Context, ruleID string) ([]*storage.EvaluationDistribution, error)
GetEvaluationDistributions returns all distributions applicable to the ruleID provided from the cache if they exist; delegating to the underlying store and caching the result if no error
func (*Store) GetEvaluationRules ¶ added in v1.9.0
func (c *Store) GetEvaluationRules(ctx context.Context, flagKey string) ([]*storage.EvaluationRule, error)
GetEvaluationRules returns all rules applicable to the flagKey provided from the cache if they exist; delegating to the underlying store and caching the result if no error
func (*Store) GetFlag ¶ added in v1.9.0
GetFlag returns the flag from the cache if it exists; otherwise it delegates to the underlying store caching the result if no error
func (*Store) GetRule ¶ added in v1.9.0
GetRule returns the rule from the cache if it exists; otherwise it delegates to the underlying store caching the result if no error
func (*Store) GetSegment ¶ added in v1.9.0
GetSegment returns the segment from the cache if it exists; otherwise it delegates to the underlying store caching the result if no error
func (*Store) ListRules ¶ added in v1.9.0
func (c *Store) ListRules(ctx context.Context, flagKey string, opts ...storage.QueryOption) ([]*flipt.Rule, error)
ListRules delegates to the underlying store
func (*Store) ListSegments ¶ added in v1.9.0
func (c *Store) ListSegments(ctx context.Context, opts ...storage.QueryOption) ([]*flipt.Segment, error)
ListSegments delegates to the underlying store
func (*Store) OrderRules ¶ added in v1.9.0
OrderRules delegates to the underlying store, flushing the cache in the process
func (*Store) UpdateConstraint ¶ added in v1.9.0
func (c *Store) UpdateConstraint(ctx context.Context, r *flipt.UpdateConstraintRequest) (*flipt.Constraint, error)
UpdateConstraint delegates to the underlying store, flushing the cache in the process
func (*Store) UpdateDistribution ¶ added in v1.9.0
func (c *Store) UpdateDistribution(ctx context.Context, r *flipt.UpdateDistributionRequest) (*flipt.Distribution, error)
UpdateDistribution delegates to the underlying store, flushing the cache in the process
func (*Store) UpdateFlag ¶ added in v1.9.0
UpdateFlag delegates to the underlying store, flushing the cache in the process
func (*Store) UpdateRule ¶ added in v1.9.0
UpdateRule delegates to the underlying store, flushing the cache in the process
func (*Store) UpdateSegment ¶ added in v1.9.0
func (c *Store) UpdateSegment(ctx context.Context, r *flipt.UpdateSegmentRequest) (*flipt.Segment, error)
UpdateSegment delegates to the underlying store, flushing the cache in the process
func (*Store) UpdateVariant ¶ added in v1.9.0
func (c *Store) UpdateVariant(ctx context.Context, r *flipt.UpdateVariantRequest) (*flipt.Variant, error)
UpdateVariant delegates to the underlying store, flushing the cache in the process