strategy

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

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

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromStrategy

func FromStrategy(strategy *Strategy, providers map[string]StrategyProvider) interface{}

Types

type Strategy

type Strategy struct {
	Provider      string            `json:"provider"`
	Configuration map[string]string `json:"configuration,omitempty"`
}

+kubebuilder:object:generate=true

func (*Strategy) DeepCopy

func (in *Strategy) DeepCopy() *Strategy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Strategy.

func (*Strategy) DeepCopyInto

func (in *Strategy) DeepCopyInto(out *Strategy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StrategyProvider

type StrategyProvider interface {
	New(configuration map[string]string) interface{}
}

func NewProviderForType

func NewProviderForType(template interface{}) StrategyProvider

func NewProviderFunction

func NewProviderFunction(new func(map[string]string) interface{}) StrategyProvider

type StrategyProviderForType

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

StrategyProviderForType is a StrategyProvider implementation that creates a strategy by creating an instance of the same type of the template object

func (*StrategyProviderForType) New

func (p *StrategyProviderForType) New(_ map[string]string) interface{}

type StrategyProviderFunction

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

StrategyProviderFuncion is a Strategy provider implementation that delegates the strategy construction into a `new` function.

func (*StrategyProviderFunction) New

func (p *StrategyProviderFunction) New(configuration map[string]string) interface{}

Jump to

Keyboard shortcuts

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