Documentation
¶
Overview ¶
Package strategy is a strategy pattern wrapper around the store implementations
NOTE: this may be refactored out into the store package directly
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTokenInvalid = errors.New("invalid token - cannot get prefix")
Functions ¶
This section is empty.
Types ¶
type Opts ¶ added in v2.1.3
type Opts func(*RetrieveStrategy)
func WithStrategyFuncMap ¶ added in v2.1.3
func WithStrategyFuncMap(funcMap StrategyFuncMap) Opts
WithStrategyFuncMap Adds custom implementations for prefix
Mainly used for testing NOTE: this may lead to eventual optional configurations by users
type RetrieveStrategy ¶
type RetrieveStrategy struct {
// contains filtered or unexported fields
}
func New ¶
func New(config config.GenVarsConfig, logger log.ILogger, opts ...Opts) *RetrieveStrategy
New
func (*RetrieveStrategy) RetrieveByToken ¶
func (rs *RetrieveStrategy) RetrieveByToken(ctx context.Context, impl store.Strategy, tokenConf *config.ParsedTokenConfig) *TokenResponse
retrieveSpecificCh wraps around the specific strategy implementation and publishes results to a channel
func (*RetrieveStrategy) SelectImplementation ¶
func (rs *RetrieveStrategy) SelectImplementation(ctx context.Context, token *config.ParsedTokenConfig) (store.Strategy, error)
type StrategyFunc ¶
type StrategyFunc func(ctx context.Context, token *config.ParsedTokenConfig) (store.Strategy, error)
StrategyFunc
type StrategyFuncMap ¶
type StrategyFuncMap map[config.ImplementationPrefix]StrategyFunc
StrategyFuncMap
type TokenResponse ¶
type TokenResponse struct { Err error // contains filtered or unexported fields }
func (*TokenResponse) Key ¶
func (tr *TokenResponse) Key() *config.ParsedTokenConfig
func (*TokenResponse) Value ¶
func (tr *TokenResponse) Value() string
Click to show internal directories.
Click to hide internal directories.