Documentation ¶
Index ¶
- type AuthRepo
- type FeatureFlagOption
- type FeatureFlagRepo
- type SegmentOption
- type SegmentRepo
- type TargetOption
- type TargetRepo
- func (t TargetRepo) Add(ctx context.Context, envID string, targets ...domain.Target) error
- func (t TargetRepo) DeltaAdd(ctx context.Context, envID string, targets ...domain.Target) error
- func (t TargetRepo) Get(ctx context.Context, envID string) ([]domain.Target, error)
- func (t TargetRepo) GetByIdentifier(ctx context.Context, envID string, identifier string) (domain.Target, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthRepo ¶
type AuthRepo struct {
// contains filtered or unexported fields
}
AuthRepo is a repository that stores a map of api key hashes to environmentIDs
func NewAuthRepo ¶
func NewAuthRepo(c cache.Cache, config map[domain.AuthAPIKey]string, approvedEnvironments map[string]struct{}) (AuthRepo, error)
NewAuthRepo creates an AuthRepo from a map of api key hashes to environmentIDs
type FeatureFlagOption ¶
type FeatureFlagOption func(f *FeatureFlagRepo)
FeatureFlagOption defines functional option for a FeatureFlagRepo
func WithFeatureConfig ¶
func WithFeatureConfig(config map[domain.FeatureFlagKey]interface{}) FeatureFlagOption
WithFeatureConfig populates a FeatureFlagRepo with the given config
type FeatureFlagRepo ¶
type FeatureFlagRepo struct {
// contains filtered or unexported fields
}
FeatureFlagRepo is a repository that stores FeatureFlags
func NewFeatureFlagRepo ¶
func NewFeatureFlagRepo(c cache.Cache, opts ...FeatureFlagOption) (FeatureFlagRepo, error)
NewFeatureFlagRepo creates a FeatureFlagRepo. It can optionally preload the repo with data from the passed config
func (FeatureFlagRepo) Get ¶
func (f FeatureFlagRepo) Get(ctx context.Context, envID string) ([]domain.FeatureFlag, error)
Get gets all of the FeatureFlag for a given key
func (FeatureFlagRepo) GetByIdentifier ¶
func (f FeatureFlagRepo) GetByIdentifier(ctx context.Context, envID string, identifier string) (domain.FeatureFlag, error)
GetByIdentifier gets a FeatureFlag for a given key and identifier
type SegmentOption ¶
type SegmentOption func(s *SegmentRepo)
SegmentOption defines functional option for a SegmentRepo
func WithSegmentConfig ¶
func WithSegmentConfig(config map[domain.SegmentKey]interface{}) SegmentOption
WithSegmentConfig populates a SegmentRepo with the given config
type SegmentRepo ¶
type SegmentRepo struct {
// contains filtered or unexported fields
}
SegmentRepo is a repository that stores Segments
func NewSegmentRepo ¶
func NewSegmentRepo(c cache.Cache, opts ...SegmentOption) (SegmentRepo, error)
NewSegmentRepo creates a SegmentRepo. It can optionally preload the repo with data from the passed config
func (SegmentRepo) GetByIdentifier ¶
func (t SegmentRepo) GetByIdentifier(ctx context.Context, envID string, identifier string) (domain.Segment, error)
GetByIdentifier gets a Segment for a given key and identifer
type TargetOption ¶
type TargetOption func(t *TargetRepo)
TargetOption defines functional option for a TargetRepo
func WithTargetConfig ¶
func WithTargetConfig(config map[domain.TargetKey]interface{}) TargetOption
WithTargetConfig populates a TargetRepo with the given config
type TargetRepo ¶
type TargetRepo struct {
// contains filtered or unexported fields
}
TargetRepo is a repository that stores Targets
func NewTargetRepo ¶
func NewTargetRepo(c cache.Cache, opts ...TargetOption) (TargetRepo, error)
NewTargetRepo creates a TargetRepo. It can optionally preload the repo with data from the passed config
func (TargetRepo) DeltaAdd ¶
DeltaAdd adds new Targets and updates existing Targets for the given key if they exist in the cache. It will remove any existing Targets from the cache that are not in the list of new Targets. If you pass it an empty list of Targets it will return an error to avoid wiping all of the Targets from the cache. If we want to remove all of the Targets for a given key then we should add an explicit Remove method that calls cache.Remove.
func (TargetRepo) GetByIdentifier ¶
func (t TargetRepo) GetByIdentifier(ctx context.Context, envID string, identifier string) (domain.Target, error)
GetByIdentifier gets a Target for a given key and identifer