Documentation ¶
Index ¶
- Variables
- type FSSource
- type FliptIndex
- type Store
- func (l *Store) Close() error
- func (s Store) CountFlags(ctx context.Context, namespaceKey string) (uint64, error)
- func (s Store) CountNamespaces(ctx context.Context) (uint64, error)
- func (s Store) CountRollouts(ctx context.Context, namespaceKey, flagKey string) (uint64, error)
- func (s Store) CountRules(ctx context.Context, namespaceKey, flagKey string) (uint64, error)
- func (s Store) CountSegments(ctx context.Context, namespaceKey string) (uint64, error)
- func (s Store) CreateRollout(ctx context.Context, r *flipt.CreateRolloutRequest) (*flipt.Rollout, error)
- func (s Store) DeleteRollout(ctx context.Context, r *flipt.DeleteRolloutRequest) error
- func (s Store) GetEvaluationDistributions(ctx context.Context, ruleID string) ([]*storage.EvaluationDistribution, error)
- func (s Store) GetEvaluationRules(ctx context.Context, namespaceKey string, flagKey string) ([]*storage.EvaluationRule, error)
- func (s Store) GetFlag(ctx context.Context, namespaceKey string, key string) (*flipt.Flag, error)
- func (s Store) GetNamespace(ctx context.Context, key string) (*flipt.Namespace, error)
- func (s Store) GetRollout(ctx context.Context, namespaceKey, id string) (*flipt.Rollout, error)
- func (s Store) GetRule(ctx context.Context, namespaceKey string, id string) (*flipt.Rule, error)
- func (s Store) GetSegment(ctx context.Context, namespaceKey string, key string) (*flipt.Segment, error)
- func (s Store) ListFlags(ctx context.Context, namespaceKey string, opts ...storage.QueryOption) (storage.ResultSet[*flipt.Flag], error)
- func (s Store) ListNamespaces(ctx context.Context, opts ...storage.QueryOption) (storage.ResultSet[*flipt.Namespace], error)
- func (s Store) ListRollouts(ctx context.Context, namespaceKey, flagKey string, opts ...storage.QueryOption) (storage.ResultSet[*flipt.Rollout], error)
- func (s Store) ListRules(ctx context.Context, namespaceKey string, flagKey string, ...) (storage.ResultSet[*flipt.Rule], error)
- func (s Store) ListSegments(ctx context.Context, namespaceKey string, opts ...storage.QueryOption) (storage.ResultSet[*flipt.Segment], error)
- func (s Store) OrderRollouts(ctx context.Context, r *flipt.OrderRolloutsRequest) error
- func (l *Store) String() string
- func (s Store) UpdateRollout(ctx context.Context, r *flipt.UpdateRolloutRequest) (*flipt.Rollout, error)
- type StoreSnapshot
- func (ss *StoreSnapshot) CountFlags(ctx context.Context, namespaceKey string) (uint64, error)
- func (ss *StoreSnapshot) CountNamespaces(ctx context.Context) (uint64, error)
- func (ss *StoreSnapshot) CountRollouts(ctx context.Context, namespaceKey, flagKey string) (uint64, error)
- func (ss *StoreSnapshot) CountRules(ctx context.Context, namespaceKey, flagKey string) (uint64, error)
- func (ss *StoreSnapshot) CountSegments(ctx context.Context, namespaceKey string) (uint64, error)
- func (ss *StoreSnapshot) CreateConstraint(ctx context.Context, r *flipt.CreateConstraintRequest) (*flipt.Constraint, error)
- func (ss *StoreSnapshot) CreateDistribution(ctx context.Context, r *flipt.CreateDistributionRequest) (*flipt.Distribution, error)
- func (ss *StoreSnapshot) CreateFlag(ctx context.Context, r *flipt.CreateFlagRequest) (*flipt.Flag, error)
- func (ss *StoreSnapshot) CreateNamespace(ctx context.Context, r *flipt.CreateNamespaceRequest) (*flipt.Namespace, error)
- func (ss *StoreSnapshot) CreateRollout(ctx context.Context, r *flipt.CreateRolloutRequest) (*flipt.Rollout, error)
- func (ss *StoreSnapshot) CreateRule(ctx context.Context, r *flipt.CreateRuleRequest) (*flipt.Rule, error)
- func (ss *StoreSnapshot) CreateSegment(ctx context.Context, r *flipt.CreateSegmentRequest) (*flipt.Segment, error)
- func (ss *StoreSnapshot) CreateVariant(ctx context.Context, r *flipt.CreateVariantRequest) (*flipt.Variant, error)
- func (ss *StoreSnapshot) DeleteConstraint(ctx context.Context, r *flipt.DeleteConstraintRequest) error
- func (ss *StoreSnapshot) DeleteDistribution(ctx context.Context, r *flipt.DeleteDistributionRequest) error
- func (ss *StoreSnapshot) DeleteFlag(ctx context.Context, r *flipt.DeleteFlagRequest) error
- func (ss *StoreSnapshot) DeleteNamespace(ctx context.Context, r *flipt.DeleteNamespaceRequest) error
- func (ss *StoreSnapshot) DeleteRollout(ctx context.Context, r *flipt.DeleteRolloutRequest) error
- func (ss *StoreSnapshot) DeleteRule(ctx context.Context, r *flipt.DeleteRuleRequest) error
- func (ss *StoreSnapshot) DeleteSegment(ctx context.Context, r *flipt.DeleteSegmentRequest) error
- func (ss *StoreSnapshot) DeleteVariant(ctx context.Context, r *flipt.DeleteVariantRequest) error
- func (ss *StoreSnapshot) GetEvaluationDistributions(ctx context.Context, ruleID string) ([]*storage.EvaluationDistribution, error)
- func (ss *StoreSnapshot) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey string) ([]*storage.EvaluationRollout, error)
- func (ss *StoreSnapshot) GetEvaluationRules(ctx context.Context, namespaceKey string, flagKey string) ([]*storage.EvaluationRule, error)
- func (ss *StoreSnapshot) GetFlag(ctx context.Context, namespaceKey string, key string) (*flipt.Flag, error)
- func (ss *StoreSnapshot) GetNamespace(ctx context.Context, key string) (*flipt.Namespace, error)
- func (ss *StoreSnapshot) GetRollout(ctx context.Context, namespaceKey, id string) (*flipt.Rollout, error)
- func (ss *StoreSnapshot) GetRule(ctx context.Context, namespaceKey string, id string) (rule *flipt.Rule, _ error)
- func (ss *StoreSnapshot) GetSegment(ctx context.Context, namespaceKey string, key string) (*flipt.Segment, error)
- func (ss *StoreSnapshot) ListFlags(ctx context.Context, namespaceKey string, opts ...storage.QueryOption) (set storage.ResultSet[*flipt.Flag], err error)
- func (ss *StoreSnapshot) ListNamespaces(ctx context.Context, opts ...storage.QueryOption) (set storage.ResultSet[*flipt.Namespace], err error)
- func (ss *StoreSnapshot) ListRollouts(ctx context.Context, namespaceKey, flagKey string, opts ...storage.QueryOption) (set storage.ResultSet[*flipt.Rollout], err error)
- func (ss *StoreSnapshot) ListRules(ctx context.Context, namespaceKey string, flagKey string, ...) (set storage.ResultSet[*flipt.Rule], _ error)
- func (ss *StoreSnapshot) ListSegments(ctx context.Context, namespaceKey string, opts ...storage.QueryOption) (set storage.ResultSet[*flipt.Segment], err error)
- func (ss *StoreSnapshot) OrderRollouts(ctx context.Context, r *flipt.OrderRolloutsRequest) error
- func (ss *StoreSnapshot) OrderRules(ctx context.Context, r *flipt.OrderRulesRequest) error
- func (ss StoreSnapshot) String() string
- func (ss *StoreSnapshot) UpdateConstraint(ctx context.Context, r *flipt.UpdateConstraintRequest) (*flipt.Constraint, error)
- func (ss *StoreSnapshot) UpdateDistribution(ctx context.Context, r *flipt.UpdateDistributionRequest) (*flipt.Distribution, error)
- func (ss *StoreSnapshot) UpdateFlag(ctx context.Context, r *flipt.UpdateFlagRequest) (*flipt.Flag, error)
- func (ss *StoreSnapshot) UpdateNamespace(ctx context.Context, r *flipt.UpdateNamespaceRequest) (*flipt.Namespace, error)
- func (ss *StoreSnapshot) UpdateRollout(ctx context.Context, r *flipt.UpdateRolloutRequest) (*flipt.Rollout, error)
- func (ss *StoreSnapshot) UpdateRule(ctx context.Context, r *flipt.UpdateRuleRequest) (*flipt.Rule, error)
- func (ss *StoreSnapshot) UpdateSegment(ctx context.Context, r *flipt.UpdateSegmentRequest) (*flipt.Segment, error)
- func (ss *StoreSnapshot) UpdateVariant(ctx context.Context, r *flipt.UpdateVariantRequest) (*flipt.Variant, error)
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotImplemented = errors.New("not implemented")
)
Functions ¶
This section is empty.
Types ¶
type FSSource ¶
type FSSource interface { fmt.Stringer // Get builds a single instance of an fs.FS Get() (fs.FS, error) // Subscribe feeds implementations of fs.FS onto the provided channel. // It should block until the provided context is cancelled (it will be called in a goroutine). // It should close the provided channel before it returns. Subscribe(context.Context, chan<- fs.FS) }
FSSource produces implementations of fs.FS. A single FS can be produced via Get or a channel may be provided to Subscribe in order to received new instances when new state becomes available.
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 Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is an implementation of storage.Store backed by an FSSource. The store subscribes to the source for instances of fs.FS with new contents. When a new fs is received the contents is fetched and built into a snapshot of Flipt feature flag state.
func NewStore ¶
NewStore constructs and configure a Store. The store creates a background goroutine which feeds a channel of fs.FS.
func (Store) CountFlags ¶
func (Store) CountRollouts ¶ added in v1.24.0
func (Store) CountRules ¶
func (Store) CountSegments ¶
func (Store) CreateRollout ¶ added in v1.24.0
func (Store) DeleteRollout ¶ added in v1.24.0
func (s Store) DeleteRollout(ctx context.Context, r *flipt.DeleteRolloutRequest) error
func (Store) GetEvaluationDistributions ¶
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 (s Store) OrderRollouts(ctx context.Context, r *flipt.OrderRolloutsRequest) error
func (Store) UpdateRollout ¶ added in v1.24.0
type StoreSnapshot ¶ added in v1.27.0
type StoreSnapshot struct {
// contains filtered or unexported fields
}
StoreSnapshot 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 SnapshotFromPaths ¶ added in v1.27.0
func SnapshotFromPaths(fs fs.FS, paths ...string) (*StoreSnapshot, error)
SnapshotFromPaths constructs a storeSnapshot from the provided slice of paths resolved against the provided fs.FS.
func (*StoreSnapshot) CountFlags ¶ added in v1.27.0
func (*StoreSnapshot) CountNamespaces ¶ added in v1.27.0
func (ss *StoreSnapshot) CountNamespaces(ctx context.Context) (uint64, error)
func (*StoreSnapshot) CountRollouts ¶ added in v1.27.0
func (*StoreSnapshot) CountRules ¶ added in v1.27.0
func (*StoreSnapshot) CountSegments ¶ added in v1.27.0
func (*StoreSnapshot) CreateConstraint ¶ added in v1.27.0
func (ss *StoreSnapshot) CreateConstraint(ctx context.Context, r *flipt.CreateConstraintRequest) (*flipt.Constraint, error)
func (*StoreSnapshot) CreateDistribution ¶ added in v1.27.0
func (ss *StoreSnapshot) CreateDistribution(ctx context.Context, r *flipt.CreateDistributionRequest) (*flipt.Distribution, error)
func (*StoreSnapshot) CreateFlag ¶ added in v1.27.0
func (ss *StoreSnapshot) CreateFlag(ctx context.Context, r *flipt.CreateFlagRequest) (*flipt.Flag, error)
func (*StoreSnapshot) CreateNamespace ¶ added in v1.27.0
func (ss *StoreSnapshot) CreateNamespace(ctx context.Context, r *flipt.CreateNamespaceRequest) (*flipt.Namespace, error)
func (*StoreSnapshot) CreateRollout ¶ added in v1.27.0
func (ss *StoreSnapshot) CreateRollout(ctx context.Context, r *flipt.CreateRolloutRequest) (*flipt.Rollout, error)
func (*StoreSnapshot) CreateRule ¶ added in v1.27.0
func (ss *StoreSnapshot) CreateRule(ctx context.Context, r *flipt.CreateRuleRequest) (*flipt.Rule, error)
func (*StoreSnapshot) CreateSegment ¶ added in v1.27.0
func (ss *StoreSnapshot) CreateSegment(ctx context.Context, r *flipt.CreateSegmentRequest) (*flipt.Segment, error)
func (*StoreSnapshot) CreateVariant ¶ added in v1.27.0
func (ss *StoreSnapshot) CreateVariant(ctx context.Context, r *flipt.CreateVariantRequest) (*flipt.Variant, error)
func (*StoreSnapshot) DeleteConstraint ¶ added in v1.27.0
func (ss *StoreSnapshot) DeleteConstraint(ctx context.Context, r *flipt.DeleteConstraintRequest) error
func (*StoreSnapshot) DeleteDistribution ¶ added in v1.27.0
func (ss *StoreSnapshot) DeleteDistribution(ctx context.Context, r *flipt.DeleteDistributionRequest) error
func (*StoreSnapshot) DeleteFlag ¶ added in v1.27.0
func (ss *StoreSnapshot) DeleteFlag(ctx context.Context, r *flipt.DeleteFlagRequest) error
func (*StoreSnapshot) DeleteNamespace ¶ added in v1.27.0
func (ss *StoreSnapshot) DeleteNamespace(ctx context.Context, r *flipt.DeleteNamespaceRequest) error
func (*StoreSnapshot) DeleteRollout ¶ added in v1.27.0
func (ss *StoreSnapshot) DeleteRollout(ctx context.Context, r *flipt.DeleteRolloutRequest) error
func (*StoreSnapshot) DeleteRule ¶ added in v1.27.0
func (ss *StoreSnapshot) DeleteRule(ctx context.Context, r *flipt.DeleteRuleRequest) error
func (*StoreSnapshot) DeleteSegment ¶ added in v1.27.0
func (ss *StoreSnapshot) DeleteSegment(ctx context.Context, r *flipt.DeleteSegmentRequest) error
func (*StoreSnapshot) DeleteVariant ¶ added in v1.27.0
func (ss *StoreSnapshot) DeleteVariant(ctx context.Context, r *flipt.DeleteVariantRequest) error
func (*StoreSnapshot) GetEvaluationDistributions ¶ added in v1.27.0
func (ss *StoreSnapshot) GetEvaluationDistributions(ctx context.Context, ruleID string) ([]*storage.EvaluationDistribution, error)
func (*StoreSnapshot) GetEvaluationRollouts ¶ added in v1.27.0
func (ss *StoreSnapshot) GetEvaluationRollouts(ctx context.Context, namespaceKey, flagKey string) ([]*storage.EvaluationRollout, error)
func (*StoreSnapshot) GetEvaluationRules ¶ added in v1.27.0
func (ss *StoreSnapshot) GetEvaluationRules(ctx context.Context, namespaceKey string, flagKey string) ([]*storage.EvaluationRule, error)
func (*StoreSnapshot) GetNamespace ¶ added in v1.27.0
func (*StoreSnapshot) GetRollout ¶ added in v1.27.0
func (*StoreSnapshot) GetSegment ¶ added in v1.27.0
func (*StoreSnapshot) ListNamespaces ¶ added in v1.27.0
func (ss *StoreSnapshot) ListNamespaces(ctx context.Context, opts ...storage.QueryOption) (set storage.ResultSet[*flipt.Namespace], err error)
func (*StoreSnapshot) ListRollouts ¶ added in v1.27.0
func (*StoreSnapshot) ListSegments ¶ added in v1.27.0
func (*StoreSnapshot) OrderRollouts ¶ added in v1.27.0
func (ss *StoreSnapshot) OrderRollouts(ctx context.Context, r *flipt.OrderRolloutsRequest) error
func (*StoreSnapshot) OrderRules ¶ added in v1.27.0
func (ss *StoreSnapshot) OrderRules(ctx context.Context, r *flipt.OrderRulesRequest) error
func (StoreSnapshot) String ¶ added in v1.27.0
func (ss StoreSnapshot) String() string
func (*StoreSnapshot) UpdateConstraint ¶ added in v1.27.0
func (ss *StoreSnapshot) UpdateConstraint(ctx context.Context, r *flipt.UpdateConstraintRequest) (*flipt.Constraint, error)
func (*StoreSnapshot) UpdateDistribution ¶ added in v1.27.0
func (ss *StoreSnapshot) UpdateDistribution(ctx context.Context, r *flipt.UpdateDistributionRequest) (*flipt.Distribution, error)
func (*StoreSnapshot) UpdateFlag ¶ added in v1.27.0
func (ss *StoreSnapshot) UpdateFlag(ctx context.Context, r *flipt.UpdateFlagRequest) (*flipt.Flag, error)
func (*StoreSnapshot) UpdateNamespace ¶ added in v1.27.0
func (ss *StoreSnapshot) UpdateNamespace(ctx context.Context, r *flipt.UpdateNamespaceRequest) (*flipt.Namespace, error)
func (*StoreSnapshot) UpdateRollout ¶ added in v1.27.0
func (ss *StoreSnapshot) UpdateRollout(ctx context.Context, r *flipt.UpdateRolloutRequest) (*flipt.Rollout, error)
func (*StoreSnapshot) UpdateRule ¶ added in v1.27.0
func (ss *StoreSnapshot) UpdateRule(ctx context.Context, r *flipt.UpdateRuleRequest) (*flipt.Rule, error)
func (*StoreSnapshot) UpdateSegment ¶ added in v1.27.0
func (ss *StoreSnapshot) UpdateSegment(ctx context.Context, r *flipt.UpdateSegmentRequest) (*flipt.Segment, error)
func (*StoreSnapshot) UpdateVariant ¶ added in v1.27.0
func (ss *StoreSnapshot) UpdateVariant(ctx context.Context, r *flipt.UpdateVariantRequest) (*flipt.Variant, error)