Documentation
¶
Index ¶
- Constants
- Variables
- func NewConfigCtor(configID string, f controller.Factory) config.Constructor
- type ConfigCtor
- type Resolver
- func (r *Resolver) AddFactory(factory controller.Factory)
- func (r *Resolver) GetConfigCtorByID(ctx context.Context, id string) (config.Constructor, error)
- func (r *Resolver) GetFactories() []controller.Factory
- func (r *Resolver) GetFactoryMatchingConfig(ctx context.Context, c config.Config) (controller.Factory, error)
- func (r *Resolver) GetFactoryMatchingConfigWatch(ctx context.Context, c config.Config) (controller.Factory, <-chan struct{}, error)
- func (r *Resolver) GetResolverID() string
- func (r *Resolver) GetResolverVersion() semver.Version
Constants ¶
const ResolverID = "static"
ResolverID is the resolver identifier.
Variables ¶
var Version = semver.MustParse("0.0.1")
Version is the resolver version.
Functions ¶
func NewConfigCtor ¶
func NewConfigCtor(configID string, f controller.Factory) config.Constructor
NewConfigCtor builds a new configuration constructor.
Types ¶
type ConfigCtor ¶
type ConfigCtor struct {
// contains filtered or unexported fields
}
ConfigCtor implements config.Constructor
func (*ConfigCtor) ConstructConfig ¶
func (c *ConfigCtor) ConstructConfig() config.Config
ConstructConfig constructs a new configuration object.
func (*ConfigCtor) GetConfigID ¶
func (c *ConfigCtor) GetConfigID() string
GetConfigID returns the unique string for this configuration type.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver implements the controller resolver using a list of built-in controller implementations.
func NewResolver ¶
func NewResolver(factories ...controller.Factory) *Resolver
NewResolver constructs a new resolver.
func (*Resolver) AddFactory ¶
func (r *Resolver) AddFactory(factory controller.Factory)
AddFactory adds a factory to the resolver.
func (*Resolver) GetConfigCtorByID ¶
GetConfigCtorByID returns a config constructor matching the ID. If none found, return nil, nil
func (*Resolver) GetFactories ¶ added in v0.45.2
func (r *Resolver) GetFactories() []controller.Factory
GetFactories returns the factories associated w/ the resolver.
func (*Resolver) GetFactoryMatchingConfig ¶
func (r *Resolver) GetFactoryMatchingConfig( ctx context.Context, c config.Config, ) (controller.Factory, error)
GetFactoryMatchingConfig returns the factory that matches the config. If no factory is found, return nil. If an unexpected error occurs, return it.
func (*Resolver) GetFactoryMatchingConfigWatch ¶ added in v0.53.2
func (r *Resolver) GetFactoryMatchingConfigWatch( ctx context.Context, c config.Config, ) (controller.Factory, <-chan struct{}, error)
GetFactoryMatchingConfigWatch returns the factory matching the config and a wait channel that will be closed when the resolver's factory set changes. Use this to wake idle resolvers when new factories are registered. Returns (nil, waitCh, nil) when no factory currently matches.
func (*Resolver) GetResolverID ¶
GetResolverID returns the resolver identifier.
func (*Resolver) GetResolverVersion ¶
GetResolverVersion returns the resolver version.