Documentation ¶
Index ¶
- Variables
- type Flag
- type FlagType
- type Repo
- func (repo *Repo) Create(ctx context.Context, flag Flag) (Flag, error)
- func (repo *Repo) Delete(ctx context.Context, key string) error
- func (repo *Repo) FindAll(ctx context.Context) ([]Flag, error)
- func (repo *Repo) FindOneByKey(ctx context.Context, key string) (Flag, error)
- func (repo *Repo) Update(ctx context.Context, flag Flag) (Flag, error)
- type Service
- func (service *Service) Create(ctx context.Context, flag Flag) (Flag, error)
- func (service *Service) CreateBooleanFlag(ctx context.Context, booleanFlag UpsertFlagParams[bool]) (Flag, error)
- func (service *Service) CreateJSONFlag(ctx context.Context, jsonFlag UpsertFlagParams[map[string]interface{}]) (Flag, error)
- func (service *Service) CreateStringFlag(ctx context.Context, stringFlag UpsertFlagParams[string]) (Flag, error)
- func (service *Service) Delete(ctx context.Context, key string) error
- func (service *Service) FindAll(ctx context.Context) ([]Flag, error)
- func (service *Service) FindOne(ctx context.Context, key string) (Flag, error)
- func (service *Service) Update(ctx context.Context, flag Flag) (Flag, error)
- type UpsertFlagParams
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAlreadyExists = errors.New("a flag with that key already exists")
View Source
var ErrNotFound = errors.New("no flag found")
Functions ¶
This section is empty.
Types ¶
type Flag ¶
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func (*Repo) FindOneByKey ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) CreateBooleanFlag ¶
func (*Service) CreateJSONFlag ¶
func (*Service) CreateStringFlag ¶
type UpsertFlagParams ¶
type UpsertFlagParams[T any] struct { // Key is the flag's key. It must be unique, non-empty, and contain only // numbers, letters, underscores and hyphens. It is immutable. Key string `json:"key"` // IsPublic determines whether the flag is public or not. IsPublic bool `json:"isPublic"` // Value is the flag's initial value. Value T `json:"value"` }
UpsertFlagParams is the set of parameters required to create a feature flag.
Click to show internal directories.
Click to hide internal directories.