static

package
v0.53.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 8 Imported by: 7

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

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