common

package
v1.19.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PageToken

type PageToken struct {
	Key    string `json:"key,omitempty"`
	Offset uint64 `json:"offset,omitempty"`
}

type Store

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

func NewStore

func NewStore(db *sql.DB, builder sq.StatementBuilderType, logger *zap.Logger) *Store

func (*Store) CountFlags

func (s *Store) CountFlags(ctx context.Context) (uint64, error)

CountFlags counts all flags

func (*Store) CountRules

func (s *Store) CountRules(ctx context.Context) (uint64, error)

CountRules counts all rules

func (*Store) CountSegments

func (s *Store) CountSegments(ctx context.Context) (uint64, error)

CountSegments counts all segments

func (*Store) CreateConstraint

func (s *Store) CreateConstraint(ctx context.Context, r *flipt.CreateConstraintRequest) (*flipt.Constraint, error)

CreateConstraint creates a constraint

func (*Store) CreateDistribution

func (s *Store) CreateDistribution(ctx context.Context, r *flipt.CreateDistributionRequest) (*flipt.Distribution, error)

CreateDistribution creates a distribution

func (*Store) CreateFlag

func (s *Store) CreateFlag(ctx context.Context, r *flipt.CreateFlagRequest) (*flipt.Flag, error)

CreateFlag creates a flag

func (*Store) CreateRule

func (s *Store) CreateRule(ctx context.Context, r *flipt.CreateRuleRequest) (*flipt.Rule, error)

CreateRule creates a rule

func (*Store) CreateSegment

func (s *Store) CreateSegment(ctx context.Context, r *flipt.CreateSegmentRequest) (*flipt.Segment, error)

CreateSegment creates a segment

func (*Store) CreateVariant

func (s *Store) CreateVariant(ctx context.Context, r *flipt.CreateVariantRequest) (*flipt.Variant, error)

CreateVariant creates a variant

func (*Store) DeleteConstraint

func (s *Store) DeleteConstraint(ctx context.Context, r *flipt.DeleteConstraintRequest) error

DeleteConstraint deletes a constraint

func (*Store) DeleteDistribution

func (s *Store) DeleteDistribution(ctx context.Context, r *flipt.DeleteDistributionRequest) error

DeleteDistribution deletes a distribution

func (*Store) DeleteFlag

func (s *Store) DeleteFlag(ctx context.Context, r *flipt.DeleteFlagRequest) error

DeleteFlag deletes a flag

func (*Store) DeleteRule

func (s *Store) DeleteRule(ctx context.Context, r *flipt.DeleteRuleRequest) error

DeleteRule deletes a rule

func (*Store) DeleteSegment

func (s *Store) DeleteSegment(ctx context.Context, r *flipt.DeleteSegmentRequest) error

DeleteSegment deletes a segment

func (*Store) DeleteVariant

func (s *Store) DeleteVariant(ctx context.Context, r *flipt.DeleteVariantRequest) error

DeleteVariant deletes a variant

func (*Store) GetEvaluationDistributions

func (s *Store) GetEvaluationDistributions(ctx context.Context, ruleID string) ([]*storage.EvaluationDistribution, error)

func (*Store) GetEvaluationRules

func (s *Store) GetEvaluationRules(ctx context.Context, flagKey string) ([]*storage.EvaluationRule, error)

func (*Store) GetFlag

func (s *Store) GetFlag(ctx context.Context, key string) (*flipt.Flag, error)

GetFlag gets a flag with variants by key

func (*Store) GetRule

func (s *Store) GetRule(ctx context.Context, id string) (*flipt.Rule, error)

GetRule gets an individual rule with distributions by ID

func (*Store) GetSegment

func (s *Store) GetSegment(ctx context.Context, key string) (*flipt.Segment, error)

GetSegment gets a segment

func (*Store) ListFlags

func (s *Store) ListFlags(ctx context.Context, opts ...storage.QueryOption) (storage.ResultSet[*flipt.Flag], error)

ListFlags lists all flags with variants

func (*Store) ListRules

func (s *Store) ListRules(ctx context.Context, flagKey string, opts ...storage.QueryOption) (storage.ResultSet[*flipt.Rule], error)

ListRules gets all rules for a flag with distributions

func (*Store) ListSegments

func (s *Store) ListSegments(ctx context.Context, opts ...storage.QueryOption) (storage.ResultSet[*flipt.Segment], error)

ListSegments lists all segments

func (*Store) OrderRules

func (s *Store) OrderRules(ctx context.Context, r *flipt.OrderRulesRequest) error

OrderRules orders rules

func (*Store) UpdateConstraint

func (s *Store) UpdateConstraint(ctx context.Context, r *flipt.UpdateConstraintRequest) (*flipt.Constraint, error)

UpdateConstraint updates an existing constraint

func (*Store) UpdateDistribution

func (s *Store) UpdateDistribution(ctx context.Context, r *flipt.UpdateDistributionRequest) (*flipt.Distribution, error)

UpdateDistribution updates an existing distribution

func (*Store) UpdateFlag

func (s *Store) UpdateFlag(ctx context.Context, r *flipt.UpdateFlagRequest) (*flipt.Flag, error)

UpdateFlag updates an existing flag

func (*Store) UpdateRule

func (s *Store) UpdateRule(ctx context.Context, r *flipt.UpdateRuleRequest) (*flipt.Rule, error)

UpdateRule updates an existing rule

func (*Store) UpdateSegment

func (s *Store) UpdateSegment(ctx context.Context, r *flipt.UpdateSegmentRequest) (*flipt.Segment, error)

UpdateSegment updates an existing segment

func (*Store) UpdateVariant

func (s *Store) UpdateVariant(ctx context.Context, r *flipt.UpdateVariantRequest) (*flipt.Variant, error)

UpdateVariant updates an existing variant

Jump to

Keyboard shortcuts

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