storage

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvaluationConstraint added in v1.9.0

type EvaluationConstraint struct {
	ID       string
	Type     flipt.ComparisonType
	Property string
	Operator string
	Value    string
}

EvaluationConstraint represents a segment constraint that is used for evaluation

type EvaluationDistribution added in v1.9.0

type EvaluationDistribution struct {
	ID                string
	RuleID            string
	VariantID         string
	Rollout           float32
	VariantKey        string
	VariantAttachment string
}

EvaluationDistribution represents a rule distribution along with its variant for evaluation

type EvaluationRule added in v1.9.0

type EvaluationRule struct {
	ID               string
	FlagKey          string
	SegmentKey       string
	SegmentMatchType flipt.MatchType
	Rank             int32
	Constraints      []EvaluationConstraint
}

EvaluationRule represents a rule and constraints required for evaluating if a given flagKey matches a segment

type EvaluationStore added in v1.9.0

type EvaluationStore interface {
	// GetEvaluationRules returns rules applicable to flagKey provided
	// Note: Rules MUST be returned in order by Rank
	GetEvaluationRules(ctx context.Context, flagKey string) ([]*EvaluationRule, error)
	GetEvaluationDistributions(ctx context.Context, ruleID string) ([]*EvaluationDistribution, error)
}

EvaluationStore returns data necessary for evaluation

type FlagStore added in v0.2.0

type FlagStore interface {
	GetFlag(ctx context.Context, key string) (*flipt.Flag, error)
	ListFlags(ctx context.Context, opts ...QueryOption) ([]*flipt.Flag, error)
	CreateFlag(ctx context.Context, r *flipt.CreateFlagRequest) (*flipt.Flag, error)
	UpdateFlag(ctx context.Context, r *flipt.UpdateFlagRequest) (*flipt.Flag, error)
	DeleteFlag(ctx context.Context, r *flipt.DeleteFlagRequest) error
	CreateVariant(ctx context.Context, r *flipt.CreateVariantRequest) (*flipt.Variant, error)
	UpdateVariant(ctx context.Context, r *flipt.UpdateVariantRequest) (*flipt.Variant, error)
	DeleteVariant(ctx context.Context, r *flipt.DeleteVariantRequest) error
}

FlagStore stores and retrieves flags and variants

type QueryOption added in v1.9.0

type QueryOption func(p *QueryParams)

func WithLimit added in v1.9.0

func WithLimit(limit uint64) QueryOption

func WithOffset added in v1.9.0

func WithOffset(offset uint64) QueryOption

type QueryParams added in v1.9.0

type QueryParams struct {
	Limit  uint64
	Offset uint64
}

type RuleStore added in v0.2.0

type RuleStore interface {
	GetRule(ctx context.Context, id string) (*flipt.Rule, error)
	ListRules(ctx context.Context, flagKey string, opts ...QueryOption) ([]*flipt.Rule, error)
	CreateRule(ctx context.Context, r *flipt.CreateRuleRequest) (*flipt.Rule, error)
	UpdateRule(ctx context.Context, r *flipt.UpdateRuleRequest) (*flipt.Rule, error)
	DeleteRule(ctx context.Context, r *flipt.DeleteRuleRequest) error
	OrderRules(ctx context.Context, r *flipt.OrderRulesRequest) error
	CreateDistribution(ctx context.Context, r *flipt.CreateDistributionRequest) (*flipt.Distribution, error)
	UpdateDistribution(ctx context.Context, r *flipt.UpdateDistributionRequest) (*flipt.Distribution, error)
	DeleteDistribution(ctx context.Context, r *flipt.DeleteDistributionRequest) error
}

RuleStore stores and retrieves rules and distributions

type SegmentStore added in v0.2.0

type SegmentStore interface {
	GetSegment(ctx context.Context, key string) (*flipt.Segment, error)
	ListSegments(ctx context.Context, opts ...QueryOption) ([]*flipt.Segment, error)
	CreateSegment(ctx context.Context, r *flipt.CreateSegmentRequest) (*flipt.Segment, error)
	UpdateSegment(ctx context.Context, r *flipt.UpdateSegmentRequest) (*flipt.Segment, error)
	DeleteSegment(ctx context.Context, r *flipt.DeleteSegmentRequest) error
	CreateConstraint(ctx context.Context, r *flipt.CreateConstraintRequest) (*flipt.Constraint, error)
	UpdateConstraint(ctx context.Context, r *flipt.UpdateConstraintRequest) (*flipt.Constraint, error)
	DeleteConstraint(ctx context.Context, r *flipt.DeleteConstraintRequest) error
}

SegmentStore stores and retrieves segments and constraints

type Store added in v1.9.0

Directories

Path Synopsis
sql

Jump to

Keyboard shortcuts

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