variant

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RejectMatch

func RejectMatch(self any) error

Types

type Factory

type Factory = func(node *yaml.Node) (any, error)

type InlineUnmarshaler

type InlineUnmarshaler interface {
	UnmarshalInline(text string) (err error)
}

type Registration

type Registration struct {
	FromNode   func(node *yaml.Node) (any, error)
	FromString func(str string) (any, error)
	Instance   any
}

type Registry

type Registry[I any] struct {
	Tags map[string]*Registration
}

func NewRegistry

func NewRegistry[IFace any]() *Registry[IFace]

func (*Registry[I]) Define

func (r *Registry[I]) Define(tag string, defaults func() any)

func (*Registry[I]) Unmarshal

func (r *Registry[I]) Unmarshal(node *yaml.Node) (res I, err error)

Jump to

Keyboard shortcuts

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