Documentation ¶
Index ¶
- Variables
- func WalkDocuments(logger *zap.Logger, src fs.FS, fn func(*ext.Document) error) error
- func WithInterval(interval time.Duration) containers.Option[Poller]
- func WithNotify(t *testing.T, n func(modified bool)) containers.Option[Poller]
- type FliptIndex
- type Poller
- type Snapshot
- func (ss *Snapshot) CountFlags(ctx context.Context, namespaceKey string) (uint64, error)
- func (ss *Snapshot) CountNamespaces(ctx context.Context) (uint64, error)
- func (ss *Snapshot) CountRollouts(ctx context.Context, namespaceKey, flagKey string) (uint64, error)
- func (ss *Snapshot) CountRules(ctx context.Context, namespaceKey, flagKey string) (uint64, error)
- func (ss *Snapshot) CountSegments(ctx context.Context, namespaceKey string) (uint64, error)
- func (ss *Snapshot) GetEvaluationDistributions(ctx context.Context, ruleID string) ([]*storage.EvaluationDistribution, error)
- func (ss *Snapshot) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey string) ([]*storage.EvaluationRollout, error)
- func (ss *Snapshot) GetEvaluationRules(ctx context.Context, namespaceKey string, flagKey string) ([]*storage.EvaluationRule, error)
- func (ss *Snapshot) GetFlag(ctx context.Context, namespaceKey string, key string) (*flipt.Flag, error)
- func (ss *Snapshot) GetNamespace(ctx context.Context, key string) (*flipt.Namespace, error)
- func (ss *Snapshot) GetRollout(ctx context.Context, namespaceKey, id string) (*flipt.Rollout, error)
- func (ss *Snapshot) GetRule(ctx context.Context, namespaceKey string, id string) (rule *flipt.Rule, _ error)
- func (ss *Snapshot) GetSegment(ctx context.Context, namespaceKey string, key string) (*flipt.Segment, error)
- func (ss *Snapshot) ListFlags(ctx context.Context, namespaceKey string, opts ...storage.QueryOption) (set storage.ResultSet[*flipt.Flag], err error)
- func (ss *Snapshot) ListNamespaces(ctx context.Context, opts ...storage.QueryOption) (set storage.ResultSet[*flipt.Namespace], err error)
- func (ss *Snapshot) ListRollouts(ctx context.Context, namespaceKey, flagKey string, opts ...storage.QueryOption) (set storage.ResultSet[*flipt.Rollout], err error)
- func (ss *Snapshot) ListRules(ctx context.Context, namespaceKey string, flagKey string, ...) (set storage.ResultSet[*flipt.Rule], _ error)
- func (ss *Snapshot) ListSegments(ctx context.Context, namespaceKey string, opts ...storage.QueryOption) (set storage.ResultSet[*flipt.Segment], err error)
- func (ss Snapshot) String() string
- type SnapshotStore
- type Store
- func (s *Store) CountFlags(ctx context.Context, namespaceKey string) (count uint64, err error)
- func (s *Store) CountNamespaces(ctx context.Context) (count uint64, err error)
- func (s *Store) CountRollouts(ctx context.Context, namespaceKey, flagKey string) (count uint64, err error)
- func (s *Store) CountRules(ctx context.Context, namespaceKey, flagKey string) (count uint64, err error)
- func (s *Store) CountSegments(ctx context.Context, namespaceKey string) (count uint64, err error)
- func (s *Store) CreateConstraint(ctx context.Context, r *flipt.CreateConstraintRequest) (*flipt.Constraint, error)
- func (s *Store) CreateDistribution(ctx context.Context, r *flipt.CreateDistributionRequest) (*flipt.Distribution, error)
- func (s *Store) CreateFlag(ctx context.Context, r *flipt.CreateFlagRequest) (*flipt.Flag, error)
- func (s *Store) CreateNamespace(ctx context.Context, r *flipt.CreateNamespaceRequest) (*flipt.Namespace, error)
- func (s *Store) CreateRollout(ctx context.Context, r *flipt.CreateRolloutRequest) (*flipt.Rollout, error)
- func (s *Store) CreateRule(ctx context.Context, r *flipt.CreateRuleRequest) (*flipt.Rule, error)
- func (s *Store) CreateSegment(ctx context.Context, r *flipt.CreateSegmentRequest) (*flipt.Segment, error)
- func (s *Store) CreateVariant(ctx context.Context, r *flipt.CreateVariantRequest) (*flipt.Variant, error)
- func (s *Store) DeleteConstraint(ctx context.Context, r *flipt.DeleteConstraintRequest) error
- func (s *Store) DeleteDistribution(ctx context.Context, r *flipt.DeleteDistributionRequest) error
- func (s *Store) DeleteFlag(ctx context.Context, r *flipt.DeleteFlagRequest) error
- func (s *Store) DeleteNamespace(ctx context.Context, r *flipt.DeleteNamespaceRequest) error
- func (s *Store) DeleteRollout(ctx context.Context, r *flipt.DeleteRolloutRequest) error
- func (s *Store) DeleteRule(ctx context.Context, r *flipt.DeleteRuleRequest) error
- func (s *Store) DeleteSegment(ctx context.Context, r *flipt.DeleteSegmentRequest) error
- func (s *Store) DeleteVariant(ctx context.Context, r *flipt.DeleteVariantRequest) error
- func (s *Store) GetEvaluationDistributions(ctx context.Context, ruleID string) (dists []*storage.EvaluationDistribution, err error)
- func (s *Store) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey string) (rollouts []*storage.EvaluationRollout, err error)
- func (s *Store) GetEvaluationRules(ctx context.Context, namespaceKey string, flagKey string) (rules []*storage.EvaluationRule, err error)
- func (s *Store) GetFlag(ctx context.Context, namespaceKey string, key string) (flag *flipt.Flag, err error)
- func (s *Store) GetNamespace(ctx context.Context, key string) (ns *flipt.Namespace, err error)
- func (s *Store) GetRollout(ctx context.Context, namespaceKey, id string) (rollout *flipt.Rollout, err error)
- func (s *Store) GetRule(ctx context.Context, namespaceKey string, id string) (rule *flipt.Rule, err error)
- func (s *Store) GetSegment(ctx context.Context, namespaceKey string, key string) (segment *flipt.Segment, err error)
- func (s *Store) ListFlags(ctx context.Context, namespaceKey string, opts ...storage.QueryOption) (set storage.ResultSet[*flipt.Flag], err error)
- func (s *Store) ListNamespaces(ctx context.Context, opts ...storage.QueryOption) (set storage.ResultSet[*flipt.Namespace], err error)
- func (s *Store) ListRollouts(ctx context.Context, namespaceKey, flagKey string, opts ...storage.QueryOption) (set storage.ResultSet[*flipt.Rollout], err error)
- func (s *Store) ListRules(ctx context.Context, namespaceKey string, flagKey string, ...) (set storage.ResultSet[*flipt.Rule], err error)
- func (s *Store) ListSegments(ctx context.Context, namespaceKey string, opts ...storage.QueryOption) (set storage.ResultSet[*flipt.Segment], err error)
- func (s *Store) OrderRollouts(ctx context.Context, r *flipt.OrderRolloutsRequest) error
- func (s *Store) OrderRules(ctx context.Context, r *flipt.OrderRulesRequest) error
- func (s *Store) String() string
- func (s *Store) UpdateConstraint(ctx context.Context, r *flipt.UpdateConstraintRequest) (*flipt.Constraint, error)
- func (s *Store) UpdateDistribution(ctx context.Context, r *flipt.UpdateDistributionRequest) (*flipt.Distribution, error)
- func (s *Store) UpdateFlag(ctx context.Context, r *flipt.UpdateFlagRequest) (*flipt.Flag, error)
- func (s *Store) UpdateNamespace(ctx context.Context, r *flipt.UpdateNamespaceRequest) (*flipt.Namespace, error)
- func (s *Store) UpdateRollout(ctx context.Context, r *flipt.UpdateRolloutRequest) (*flipt.Rollout, error)
- func (s *Store) UpdateRule(ctx context.Context, r *flipt.UpdateRuleRequest) (*flipt.Rule, error)
- func (s *Store) UpdateSegment(ctx context.Context, r *flipt.UpdateSegmentRequest) (*flipt.Segment, error)
- func (s *Store) UpdateVariant(ctx context.Context, r *flipt.UpdateVariantRequest) (*flipt.Variant, error)
- type UpdateFunc
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotImplemented is returned when a method has intentionally not been implemented // This is usually reserved for the store write actions when the store is read-only // but still needs to implement storage.Store ErrNotImplemented = errors.New("not implemented") )
Functions ¶
func WalkDocuments ¶ added in v1.31.0
WalkDocuments walks all the Flipt feature documents found in the target fs.FS based on either the default index file or an index file located in the root
func WithInterval ¶ added in v1.34.0
func WithInterval(interval time.Duration) containers.Option[Poller]
func WithNotify ¶ added in v1.34.0
Types ¶
type FliptIndex ¶
type FliptIndex struct { Version string `yaml:"version,omitempty"` Include []string `yaml:"include,omitempty"` Exclude []string `yaml:"exclude,omitempty"` }
FliptIndex represents the structure of a well-known file ".flipt.yml" at the root of an FS.
type Poller ¶ added in v1.34.0
type Poller struct {
// contains filtered or unexported fields
}
type Snapshot ¶ added in v1.34.0
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot contains the structures necessary for serving flag state to a client.
func SnapshotFromFS ¶ added in v1.27.0
SnapshotFromFS is a convenience function for building a snapshot directly from an implementation of fs.FS using the list state files function to source the relevant Flipt configuration files.
func SnapshotFromFiles ¶ added in v1.31.0
SnapshotFromFiles constructs a StoreSnapshot from the provided slice of fs.File implementations.
func SnapshotFromPaths ¶ added in v1.27.0
SnapshotFromPaths constructs a StoreSnapshot from the provided slice of paths resolved against the provided fs.FS.
func (*Snapshot) CountFlags ¶ added in v1.34.0
func (*Snapshot) CountNamespaces ¶ added in v1.34.0
func (*Snapshot) CountRollouts ¶ added in v1.34.0
func (*Snapshot) CountRules ¶ added in v1.34.0
func (*Snapshot) CountSegments ¶ added in v1.34.0
func (*Snapshot) GetEvaluationDistributions ¶ added in v1.34.0
func (*Snapshot) GetEvaluationRollouts ¶ added in v1.34.0
func (*Snapshot) GetEvaluationRules ¶ added in v1.34.0
func (*Snapshot) GetNamespace ¶ added in v1.34.0
func (*Snapshot) GetRollout ¶ added in v1.34.0
func (*Snapshot) GetSegment ¶ added in v1.34.0
func (*Snapshot) ListNamespaces ¶ added in v1.34.0
func (*Snapshot) ListRollouts ¶ added in v1.34.0
func (*Snapshot) ListSegments ¶ added in v1.34.0
type SnapshotStore ¶ added in v1.34.0
type SnapshotStore interface { // View accepts a function which takes a *StoreSnapshot. // The SnapshotStore will supply a snapshot which is valid // for the lifetime of the provided function call. View(func(storage.ReadOnlyStore) error) error fmt.Stringer }
SnapshotStore is a type which has a single function View. View is a functional transaction interface for reading a snapshot during the lifetime of a supplied function.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store embeds a StoreSnapshot and wraps the Store methods with a read-write mutex to synchronize reads with atomic replacements of the embedded snapshot.
func NewStore ¶
func NewStore(viewer SnapshotStore) *Store
func (*Store) CountFlags ¶
func (*Store) CountNamespaces ¶
func (*Store) CountRollouts ¶ added in v1.24.0
func (*Store) CountRules ¶
func (*Store) CountSegments ¶
func (*Store) CreateConstraint ¶ added in v1.34.0
func (s *Store) CreateConstraint(ctx context.Context, r *flipt.CreateConstraintRequest) (*flipt.Constraint, error)
func (*Store) CreateDistribution ¶ added in v1.34.0
func (s *Store) CreateDistribution(ctx context.Context, r *flipt.CreateDistributionRequest) (*flipt.Distribution, error)
func (*Store) CreateFlag ¶ added in v1.34.0
func (*Store) CreateNamespace ¶ added in v1.34.0
func (*Store) CreateRollout ¶ added in v1.24.0
func (*Store) CreateRule ¶ added in v1.34.0
func (*Store) CreateSegment ¶ added in v1.34.0
func (*Store) CreateVariant ¶ added in v1.34.0
func (*Store) DeleteConstraint ¶ added in v1.34.0
func (*Store) DeleteDistribution ¶ added in v1.34.0
func (*Store) DeleteFlag ¶ added in v1.34.0
func (*Store) DeleteNamespace ¶ added in v1.34.0
func (*Store) DeleteRollout ¶ added in v1.24.0
func (*Store) DeleteRule ¶ added in v1.34.0
func (*Store) DeleteSegment ¶ added in v1.34.0
func (*Store) DeleteVariant ¶ added in v1.34.0
func (*Store) GetEvaluationDistributions ¶
func (*Store) GetEvaluationRollouts ¶ added in v1.29.0
func (*Store) GetEvaluationRules ¶
func (*Store) GetNamespace ¶
func (*Store) GetRollout ¶ added in v1.24.0
func (*Store) GetSegment ¶
func (*Store) ListNamespaces ¶
func (*Store) ListRollouts ¶ added in v1.24.0
func (*Store) ListSegments ¶
func (*Store) OrderRollouts ¶ added in v1.24.0
func (*Store) OrderRules ¶ added in v1.34.0
func (*Store) UpdateConstraint ¶ added in v1.34.0
func (s *Store) UpdateConstraint(ctx context.Context, r *flipt.UpdateConstraintRequest) (*flipt.Constraint, error)
func (*Store) UpdateDistribution ¶ added in v1.34.0
func (s *Store) UpdateDistribution(ctx context.Context, r *flipt.UpdateDistributionRequest) (*flipt.Distribution, error)