static

package
v0.44.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 5 Imported by: 6

README

Static Resolver

The static resolver is constructed with a compiled-in (statically linked) list of controller factories.

Documentation

Index

Constants

View Source
const ResolverID = "static"

ResolverID is the resolver identifier.

Variables

View Source
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

func (r *Resolver) GetConfigCtorByID(
	ctx context.Context, id string,
) (config.Constructor, error)

GetConfigCtorByID returns a config constructor matching the ID. If none found, return nil, nil

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) GetResolverID

func (r *Resolver) GetResolverID() string

GetResolverID returns the resolver identifier.

func (*Resolver) GetResolverVersion

func (r *Resolver) GetResolverVersion() semver.Version

GetResolverVersion returns the resolver version.

Jump to

Keyboard shortcuts

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