Versions in this module Expand all Collapse all v0 v0.7.0 Aug 5, 2022 v0.6.0 Oct 27, 2021 Changes in this version + func NewEvaluationRepository(ctx context.Context, db *mongo.Database) (repository.Evaluation, error) + func NewFlagRepository(ctx context.Context, db *mongo.Database) (repository.Flag, error) + func NewRuleRepository(flagRepo *FlagRepository, segmentRepo *SegmentRepository) repository.Rule + func NewSegmentRepository(ctx context.Context, db *mongo.Database) (repository.Segment, error) + func NewUserRepository(ctx context.Context, db *mongo.Database) (repository.User, error) + func NewVariantRepository(flagRepo *FlagRepository) repository.Variant + type EvaluationRepository struct + func (r *EvaluationRepository) DeleteAllByUserID(ctx context.Context, userID string) error + func (r *EvaluationRepository) DeleteByID(ctx context.Context, idHex 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, idHex 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 struct + func (r *FlagRepository) Create(ctx context.Context, f flaggio.NewFlag) (string, error) + func (r *FlagRepository) Delete(ctx context.Context, idHex string) error + func (r *FlagRepository) FindAll(ctx context.Context, search *string, offset, limit *int64) (*flaggio.FlagResults, error) + func (r *FlagRepository) FindByID(ctx context.Context, idHex string) (*flaggio.Flag, error) + func (r *FlagRepository) FindByKey(ctx context.Context, key string) (*flaggio.Flag, error) + func (r *FlagRepository) Update(ctx context.Context, idHex string, f flaggio.UpdateFlag) error + type RuleRepository struct + func (r *RuleRepository) CreateFlagRule(ctx context.Context, flagIDHex string, fr flaggio.NewFlagRule) (string, error) + func (r *RuleRepository) CreateSegmentRule(ctx context.Context, segmentIDHex string, fr flaggio.NewSegmentRule) (string, error) + func (r *RuleRepository) DeleteFlagRule(ctx context.Context, flagIDHex, idHex string) error + func (r *RuleRepository) DeleteSegmentRule(ctx context.Context, segmentIDHex, idHex 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, flagIDHex, idHex string, fr flaggio.UpdateFlagRule) error + func (r *RuleRepository) UpdateSegmentRule(ctx context.Context, segmentIDHex, idHex string, fr flaggio.UpdateSegmentRule) error + type SegmentRepository struct + func (r *SegmentRepository) Create(ctx context.Context, f flaggio.NewSegment) (string, error) + func (r *SegmentRepository) Delete(ctx context.Context, idHex string) error + func (r *SegmentRepository) FindAll(ctx context.Context, offset, limit *int64) ([]*flaggio.Segment, error) + func (r *SegmentRepository) FindByID(ctx context.Context, idHex string) (*flaggio.Segment, error) + func (r *SegmentRepository) Update(ctx context.Context, idHex string, f flaggio.UpdateSegment) error + type UserRepository struct + func (r *UserRepository) Delete(ctx context.Context, userID string) error + func (r *UserRepository) FindAll(ctx context.Context, search *string, offset, limit *int64) (*flaggio.UserResults, error) + func (r *UserRepository) FindByID(ctx context.Context, id string) (*flaggio.User, error) + func (r *UserRepository) Replace(ctx context.Context, userID string, userCtx flaggio.UserContext) error + type VariantRepository struct + func (r *VariantRepository) Create(ctx context.Context, flagIDHex string, v flaggio.NewVariant) (string, error) + func (r *VariantRepository) Delete(ctx context.Context, flagIDHex, idHex string) error + func (r *VariantRepository) FindByID(ctx context.Context, flagIDHex, idHex string) (*flaggio.Variant, error) + func (r *VariantRepository) Update(ctx context.Context, flagIDHex, idHex string, v flaggio.UpdateVariant) error