flags

package
v0.0.0-...-9fa121a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_EXPIRATION_TIME = 5 * time.Minute
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 Flag

type Flag struct {
	Name  string `json:"name"`
	Value bool   `json:"value"`
}

func ParseFlag

func ParseFlag(data interface{}) (*Flag, error)

type FlagError

type FlagError string

////////// Errors //////////

func (FlagError) Error

func (e FlagError) Error() string

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)

func (FlagMongoRepository) Set

func (repository FlagMongoRepository) Set(key string, value interface{}) error

type FlagRepository

type FlagRepository interface {
	Get(key string) (bool, error)
	Exists(name string) (bool, error)
	Set(key string, value interface{}) error
	List() ([]Flag, error)
	Delete(name string) error
}

func NewFlagMongoRepository

func NewFlagMongoRepository(host string, port int) (FlagRepository, error)

type FlagService

type FlagService struct {
	// contains filtered or unexported fields
}

func NewFlagService

func NewFlagService(cacheClient storage.CacheClient, repository FlagRepository) FlagService

func (FlagService) Create

func (flagService FlagService) Create(f Flag) error

func (FlagService) Delete

func (flagService FlagService) Delete(name string) error

func (FlagService) Exists

func (flagService FlagService) Exists(key string) (bool, error)

func (FlagService) Get

func (flagService FlagService) Get(key string) (bool, error)

func (FlagService) List

func (flagService FlagService) List() ([]Flag, error)

func (FlagService) Update

func (flagService FlagService) Update(name string, value bool) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL