storage

package
v0.0.0-...-6903c1e Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigMapBackend

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

func NewConfigMapBackend

func NewConfigMapBackend(namespace string, kubeconfig *restclient.Config) *ConfigMapBackend

func (*ConfigMapBackend) GetAllFeatureFlags

func (db *ConfigMapBackend) GetAllFeatureFlags(authentication_identityt, identity string) ([]*FeatureFlag, error)

func (*ConfigMapBackend) GetFeatureFlagState

func (db *ConfigMapBackend) GetFeatureFlagState(authentication_identity string, identity, flag_name string) (*FeatureFlag, error)

func (*ConfigMapBackend) RegisterFeatureFlags

func (db *ConfigMapBackend) RegisterFeatureFlags(authentication_identity string, identity string, flags []*FeatureFlag) error

func (*ConfigMapBackend) SetFeatureFlagState

func (db *ConfigMapBackend) SetFeatureFlagState(authentication_id string, identity string, flag_name string, flag_state string) error

type FeatureFlag

type FeatureFlag struct {
	Name  string `json:"flag_name"`
	State bool   `json:"state"`
}

type FeatureFlagStore

type FeatureFlagStore interface {
	// RegisterFeatureFlags Registers featureflags for an application
	RegisterFeatureFlags(authentication_id string, identity string, flags []*FeatureFlag) error
	// GetFeatureFlagState Gets the state of a feature flag
	GetFeatureFlagState(authentication_id string, identity string, flag_name string) (*FeatureFlag, error)
	// GetAllFeatureFlags Gets all feature flags for a given identity
	GetAllFeatureFlags(authentication_id string, identity string) ([]*FeatureFlag, error)
	// SetFeatureFlagState Sets the new state for a given feature flag, flag_state should either be a
	//   definitive(on/off) or a context-id and wether is should be on or off for said context
	SetFeatureFlagState(authentication_id string, identity string, flag_name string, flag_state string) error
}

type IdentityStore

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

type InMemoryStorage

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

func NewInMemory

func NewInMemory() *InMemoryStorage

NewInMemory create new in memory storage instance

func (*InMemoryStorage) GetAllFeatureFlags

func (s *InMemoryStorage) GetAllFeatureFlags(auth string, identity string) ([]*FeatureFlag, error)

GetAllFeatureFlags Gets all feature flags for a given identity

func (*InMemoryStorage) GetFeatureFlagState

func (s *InMemoryStorage) GetFeatureFlagState(auth string, identity string, flag_name string) (*FeatureFlag, error)

GetFeatureFlagState Gets the state of a feature flag

func (*InMemoryStorage) RegisterFeatureFlags

func (s *InMemoryStorage) RegisterFeatureFlags(auth string, identity string, flags []*FeatureFlag) error

RegisterFeatureFlags Registers featureflags for an application

func (*InMemoryStorage) SetFeatureFlagState

func (s *InMemoryStorage) SetFeatureFlagState(auth string, identity string, flag_name string, flag_state string) error

SetFeatureFlagState Sets the new state for a given feature flag, flag_state should either be a

definitive(on/off) or a context-id and wether is should be on or off for said context

Jump to

Keyboard shortcuts

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