resolvers

package
v0.115.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallResolver

func CallResolver[C any](resolver ConfigResolver, payload json.RawMessage) (C, error)

CallResolver unmarshals raw JSON into the input type expected by `resolver`, invokes it, and converts the first return value to the requested generic type C.

Types

type ConfigResolver

type ConfigResolver any

ConfigResolver can be *any* function whose signature is:

func(<Input>) (<Output>, error)

The concrete types are discovered at runtime via reflection. Signature check happens at registration time.

type ConfigResolverManager

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

ConfigResolverManager manages config resolvers with thread-safe operations

func NewConfigResolverManager

func NewConfigResolverManager() *ConfigResolverManager

NewConfigResolverManager creates a new ConfigResolverManager

func (*ConfigResolverManager) ListResolvers

func (m *ConfigResolverManager) ListResolvers() []string

ListResolvers returns all registered names in deterministic order.

func (*ConfigResolverManager) NameOf

NameOf returns the registered name for the given resolver, or empty string.

func (*ConfigResolverManager) Register

func (m *ConfigResolverManager) Register(
	fn ConfigResolver,
	info ResolverInfo,
)

Register binds an explicit name to a resolver and stores its metadata. It panics if the name is already taken.

type ResolverInfo

type ResolverInfo struct {
	Description string
	ExampleYAML string
}

ResolverInfo contains metadata about a config resolver

Jump to

Keyboard shortcuts

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