Documentation ¶
Index ¶
- Constants
- type DefaultFlagService
- func (flagService DefaultFlagService) Create(f Flag) error
- func (flagService DefaultFlagService) Delete(name string) error
- func (flagService DefaultFlagService) Exists(key string) (bool, error)
- func (flagService DefaultFlagService) Get(key string) (bool, error)
- func (flagService DefaultFlagService) List() ([]Flag, error)
- func (flagService DefaultFlagService) Update(name string, value bool) error
- type Flag
- type FlagError
- type FlagMongoRepository
- func (repository FlagMongoRepository) Delete(name string) error
- func (repository FlagMongoRepository) Exists(name string) (bool, error)
- func (repository FlagMongoRepository) Get(key string) (bool, error)
- func (repository FlagMongoRepository) List() ([]Flag, error)
- func (repository FlagMongoRepository) Set(key string, value any) error
- type FlagRepository
- type FlagService
Constants ¶
View Source
const ErrFlagAlreadyExists = FlagError("toggles: Flag already exists") // nolint:errname
View Source
const ErrFlagNotFound = FlagError("toggles: Flag not found") // nolint:errname
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultFlagService ¶
type DefaultFlagService struct {
// contains filtered or unexported fields
}
func (DefaultFlagService) Create ¶
func (flagService DefaultFlagService) Create(f Flag) error
func (DefaultFlagService) Delete ¶
func (flagService DefaultFlagService) Delete(name string) error
func (DefaultFlagService) Exists ¶
func (flagService DefaultFlagService) Exists(key string) (bool, error)
func (DefaultFlagService) List ¶
func (flagService DefaultFlagService) List() ([]Flag, error)
type Flag ¶
func (Flag) ToPrettyString ¶
type FlagMongoRepository ¶
type FlagMongoRepository struct {
// contains filtered or unexported fields
}
func (FlagMongoRepository) Delete ¶
func (repository FlagMongoRepository) Delete(name string) error
func (FlagMongoRepository) Exists ¶
func (repository FlagMongoRepository) Exists(name string) (bool, error)
func (FlagMongoRepository) Get ¶
func (repository FlagMongoRepository) Get(key string) (bool, error)
func (FlagMongoRepository) List ¶
func (repository FlagMongoRepository) List() ([]Flag, error)
type FlagRepository ¶
type FlagRepository interface { Get(key string) (bool, error) Exists(name string) (bool, error) Set(key string, value any) error List() ([]Flag, error) Delete(name string) error }
func NewFlagMongoRepository ¶
func NewFlagMongoRepository(host string, port uint) (FlagRepository, error)
type FlagService ¶
type FlagService interface { Get(key string) (bool, error) Create(f Flag) error Update(name string, value bool) error Exists(key string) (bool, error) List() ([]Flag, error) Delete(name string) error }
func NewFlagService ¶
func NewFlagService(cacheClient storage.CacheClient, repository FlagRepository) FlagService
Click to show internal directories.
Click to hide internal directories.