Documentation
¶
Index ¶
Constants ¶
View Source
const ( BOOL flagType = "BOOL" // BOOL is a simple boolean flag type PERCENT flagType = "PERCENT" // PERCENT is a boolean that is true ${PERCENT}% of the time )
flagTypes are types of flags
Variables ¶
View Source
var ErrFlagNotFound = errors.New("Flag not found")
ErrFlagNotFound means the flag was not found
Functions ¶
This section is empty.
Types ¶
type Flag ¶
type Flag struct { Name string Type flagType `json:"type"` InternalValue int `json:"value"` Namespace string `json:"namespace"` Tags []string `json:"tags"` }
Flag is a flag ;)
func (*Flag) MarshalBinary ¶
MarshalBinary implements encoding support for redis
func (*Flag) UnmarshalBinary ¶
UnmarshalBinary implements encoding support for redis
type Flagger ¶
type Flagger interface { SaveFlag(flag *Flag) error GetFlag(name string) (*Flag, error) GetFlagWithTags(name string, tags []string) (*Flag, error) ListFlags() ([]*Flag, error) }
Flagger is implemented by each of the storage backends
type RedisFlagger ¶
type RedisFlagger struct {
// contains filtered or unexported fields
}
RedisFlagger is a redis backed flagger
func (*RedisFlagger) GetFlag ¶
func (rf *RedisFlagger) GetFlag(name string) (*Flag, error)
GetFlag loads a flag without tags
func (*RedisFlagger) GetFlagWithTags ¶
func (rf *RedisFlagger) GetFlagWithTags(name string, tags []string) (*Flag, error)
GetFlagWithTags loads a flag from a redis client
func (*RedisFlagger) ListFlags ¶
func (rf *RedisFlagger) ListFlags() (flags []*Flag, err error)
ListFlags returns a list of flags grouped by name and environment
func (*RedisFlagger) SaveFlag ¶
func (rf *RedisFlagger) SaveFlag(flag *Flag) error
SaveFlag saves a flag to redis
Click to show internal directories.
Click to hide internal directories.