Documentation ¶
Index ¶
- func NewEvaluationRepository(redisClient *redis.Client, store repository.Evaluation) repository.Evaluation
- func NewFlagRepository(redisClient *redis.Client, store repository.Flag) repository.Flag
- func NewRuleRepository(redisClient *redis.Client, store repository.Rule, flagStore repository.Flag, ...) repository.Rule
- func NewSegmentRepository(redisClient *redis.Client, store repository.Segment) repository.Segment
- func NewVariantRepository(redisClient *redis.Client, store repository.Variant, flagStore repository.Flag) repository.Variant
- type EvaluationRepository
- func (r *EvaluationRepository) DeleteAllByUserID(ctx context.Context, userID string) error
- func (r *EvaluationRepository) DeleteByID(ctx context.Context, id string) error
- func (r *EvaluationRepository) FindAllByReqHash(ctx context.Context, reqHash string) (flaggio.EvaluationList, error)
- func (r *EvaluationRepository) FindAllByUserID(ctx context.Context, userID string, search *string, offset, limit *int64) (*flaggio.EvaluationResults, error)
- func (r *EvaluationRepository) FindByID(ctx context.Context, id string) (*flaggio.Evaluation, error)
- func (r *EvaluationRepository) FindByReqHashAndFlagKey(ctx context.Context, reqHash, flagKey string) (*flaggio.Evaluation, error)
- func (r *EvaluationRepository) ReplaceAll(ctx context.Context, userID, reqHash string, evals flaggio.EvaluationList) error
- func (r *EvaluationRepository) ReplaceOne(ctx context.Context, userID string, eval *flaggio.Evaluation) error
- type FlagRepository
- func (r *FlagRepository) Create(ctx context.Context, input flaggio.NewFlag) (string, error)
- func (r *FlagRepository) Delete(ctx context.Context, id string) error
- func (r *FlagRepository) FindAll(ctx context.Context, search *string, offset, limit *int64) (*flaggio.FlagResults, error)
- func (r *FlagRepository) FindByID(ctx context.Context, id string) (*flaggio.Flag, error)
- func (r *FlagRepository) FindByKey(ctx context.Context, key string) (*flaggio.Flag, error)
- func (r *FlagRepository) Update(ctx context.Context, id string, input flaggio.UpdateFlag) error
- type RuleRepository
- func (r *RuleRepository) CreateFlagRule(ctx context.Context, flagID string, input flaggio.NewFlagRule) (string, error)
- func (r *RuleRepository) CreateSegmentRule(ctx context.Context, segmentID string, input flaggio.NewSegmentRule) (string, error)
- func (r *RuleRepository) DeleteFlagRule(ctx context.Context, flagID, id string) error
- func (r *RuleRepository) DeleteSegmentRule(ctx context.Context, segmentID, id string) error
- func (r *RuleRepository) FindFlagRuleByID(ctx context.Context, flagIDHex, idHex string) (*flaggio.FlagRule, error)
- func (r *RuleRepository) FindSegmentRuleByID(ctx context.Context, segmentIDHex, idHex string) (*flaggio.SegmentRule, error)
- func (r *RuleRepository) UpdateFlagRule(ctx context.Context, flagID, id string, input flaggio.UpdateFlagRule) error
- func (r *RuleRepository) UpdateSegmentRule(ctx context.Context, segmentID, id string, input flaggio.UpdateSegmentRule) error
- type SegmentRepository
- func (r *SegmentRepository) Create(ctx context.Context, input flaggio.NewSegment) (string, error)
- func (r *SegmentRepository) Delete(ctx context.Context, id string) error
- func (r *SegmentRepository) FindAll(ctx context.Context, offset, limit *int64) ([]*flaggio.Segment, error)
- func (r *SegmentRepository) FindByID(ctx context.Context, id string) (*flaggio.Segment, error)
- func (r *SegmentRepository) Update(ctx context.Context, id string, input flaggio.UpdateSegment) error
- type VariantRepository
- func (r *VariantRepository) Create(ctx context.Context, flagID string, input flaggio.NewVariant) (string, error)
- func (r *VariantRepository) Delete(ctx context.Context, flagID, id string) error
- func (r *VariantRepository) FindByID(ctx context.Context, flagIDHex, idHex string) (*flaggio.Variant, error)
- func (r *VariantRepository) Update(ctx context.Context, flagID, id string, input flaggio.UpdateVariant) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEvaluationRepository ¶
func NewEvaluationRepository(redisClient *redis.Client, store repository.Evaluation) repository.Evaluation
NewEvaluationRepository returns a new evaluation repository that uses redis as underlying storage.
func NewFlagRepository ¶
func NewFlagRepository(redisClient *redis.Client, store repository.Flag) repository.Flag
NewFlagRepository returns a new flag repository that uses redis as underlying storage.
func NewRuleRepository ¶
func NewRuleRepository(redisClient *redis.Client, store repository.Rule, flagStore repository.Flag, segmentStore repository.Segment) repository.Rule
NewRuleRepository returns a new rule repository that uses redis as underlying storage.
func NewSegmentRepository ¶
func NewSegmentRepository(redisClient *redis.Client, store repository.Segment) repository.Segment
NewSegmentRepository returns a new segment repository that uses redis as underlying storage.
func NewVariantRepository ¶
func NewVariantRepository(redisClient *redis.Client, store repository.Variant, flagStore repository.Flag) repository.Variant
NewVariantRepository returns a new variant repository that uses redis as underlying storage.
Types ¶
type EvaluationRepository ¶
type EvaluationRepository struct {
// contains filtered or unexported fields
}
EvaluationRepository implements repository.Evaluation interface using redis.
func (*EvaluationRepository) DeleteAllByUserID ¶
func (r *EvaluationRepository) DeleteAllByUserID(ctx context.Context, userID string) error
DeleteAllByUserID deletes evaluations for a user.
func (*EvaluationRepository) DeleteByID ¶
func (r *EvaluationRepository) DeleteByID(ctx context.Context, id string) error
DeleteByID deletes an evaluation by its ID.
func (*EvaluationRepository) FindAllByReqHash ¶
func (r *EvaluationRepository) FindAllByReqHash(ctx context.Context, reqHash string) (flaggio.EvaluationList, error)
FindAllByReqHash returns all previous flag evaluations for a given request hash.
func (*EvaluationRepository) FindAllByUserID ¶
func (r *EvaluationRepository) FindAllByUserID(ctx context.Context, userID string, search *string, offset, limit *int64) (*flaggio.EvaluationResults, error)
FindAllByUserID returns all previous flag evaluations for a given user ID.
func (*EvaluationRepository) FindByID ¶
func (r *EvaluationRepository) FindByID(ctx context.Context, id string) (*flaggio.Evaluation, error)
FindByID returns a previous flag evaluation by its ID.
func (*EvaluationRepository) FindByReqHashAndFlagKey ¶
func (r *EvaluationRepository) FindByReqHashAndFlagKey(ctx context.Context, reqHash, flagKey string) (*flaggio.Evaluation, error)
FindByReqHashAndFlagKey returns a previous flag evaluation for a given request hash and flag key.
func (*EvaluationRepository) ReplaceAll ¶
func (r *EvaluationRepository) ReplaceAll(ctx context.Context, userID, reqHash string, evals flaggio.EvaluationList) error
ReplaceAll creates or replaces evaluations for a combination of user and request hash.
func (*EvaluationRepository) ReplaceOne ¶
func (r *EvaluationRepository) ReplaceOne(ctx context.Context, userID string, eval *flaggio.Evaluation) error
ReplaceOne creates or replaces one evaluation for a user ID.
type FlagRepository ¶
type FlagRepository struct {
// contains filtered or unexported fields
}
FlagRepository implements repository.Flag interface using redis.
func (*FlagRepository) Delete ¶
func (r *FlagRepository) Delete(ctx context.Context, id string) error
Delete deletes a flag.
func (*FlagRepository) FindAll ¶
func (r *FlagRepository) FindAll(ctx context.Context, search *string, offset, limit *int64) (*flaggio.FlagResults, error)
FindAll returns a list of flags, based on an optional offset and limit.
func (*FlagRepository) Update ¶
func (r *FlagRepository) Update(ctx context.Context, id string, input flaggio.UpdateFlag) error
Update updates a flag.
type RuleRepository ¶
type RuleRepository struct {
// contains filtered or unexported fields
}
RuleRepository implements repository.Rule interface using redis.
func (*RuleRepository) CreateFlagRule ¶
func (r *RuleRepository) CreateFlagRule(ctx context.Context, flagID string, input flaggio.NewFlagRule) (string, error)
CreateFlagRule creates a new rule under a flag.
func (*RuleRepository) CreateSegmentRule ¶
func (r *RuleRepository) CreateSegmentRule(ctx context.Context, segmentID string, input flaggio.NewSegmentRule) (string, error)
CreateSegmentRule creates a new rule under a segment.
func (*RuleRepository) DeleteFlagRule ¶
func (r *RuleRepository) DeleteFlagRule(ctx context.Context, flagID, id string) error
DeleteFlagRule deletes a rule under a flag.
func (*RuleRepository) DeleteSegmentRule ¶
func (r *RuleRepository) DeleteSegmentRule(ctx context.Context, segmentID, id string) error
DeleteSegmentRule deletes a rule under a segment.
func (*RuleRepository) FindFlagRuleByID ¶
func (r *RuleRepository) FindFlagRuleByID(ctx context.Context, flagIDHex, idHex string) (*flaggio.FlagRule, error)
FindFlagRuleByID returns a flag rule that has a given ID.
func (*RuleRepository) FindSegmentRuleByID ¶
func (r *RuleRepository) FindSegmentRuleByID(ctx context.Context, segmentIDHex, idHex string) (*flaggio.SegmentRule, error)
FindSegmentRuleByID returns a segment rule that has a given ID.
func (*RuleRepository) UpdateFlagRule ¶
func (r *RuleRepository) UpdateFlagRule(ctx context.Context, flagID, id string, input flaggio.UpdateFlagRule) error
UpdateFlagRule updates a rule under a flag.
func (*RuleRepository) UpdateSegmentRule ¶
func (r *RuleRepository) UpdateSegmentRule(ctx context.Context, segmentID, id string, input flaggio.UpdateSegmentRule) error
UpdateSegmentRule updates a rule under a segment.
type SegmentRepository ¶
type SegmentRepository struct {
// contains filtered or unexported fields
}
SegmentRepository implements repository.Segment interface using redis.
func (*SegmentRepository) Create ¶
func (r *SegmentRepository) Create(ctx context.Context, input flaggio.NewSegment) (string, error)
Create creates a new segment.
func (*SegmentRepository) Delete ¶
func (r *SegmentRepository) Delete(ctx context.Context, id string) error
Delete deletes a segment.
func (*SegmentRepository) FindAll ¶
func (r *SegmentRepository) FindAll(ctx context.Context, offset, limit *int64) ([]*flaggio.Segment, error)
FindAll returns a list of segments, based on an optional offset and limit.
func (*SegmentRepository) Update ¶
func (r *SegmentRepository) Update(ctx context.Context, id string, input flaggio.UpdateSegment) error
Update updates a segment.
type VariantRepository ¶
type VariantRepository struct {
// contains filtered or unexported fields
}
VariantRepository implements repository.Variant interface using redis.
func (*VariantRepository) Create ¶
func (r *VariantRepository) Create(ctx context.Context, flagID string, input flaggio.NewVariant) (string, error)
Create creates a new variant.
func (*VariantRepository) Delete ¶
func (r *VariantRepository) Delete(ctx context.Context, flagID, id string) error
Delete deletes a variant.
func (*VariantRepository) FindByID ¶
func (r *VariantRepository) FindByID(ctx context.Context, flagIDHex, idHex string) (*flaggio.Variant, error)
FindByID returns a variant that has a given ID.
func (*VariantRepository) Update ¶
func (r *VariantRepository) Update(ctx context.Context, flagID, id string, input flaggio.UpdateVariant) error
Update updates a variant.