loader

package module
v0.0.0-...-50c2ad6 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(bts []byte, cfg any) error

func Register

func Register[T any](name string, factory func() Builder[T])

Types

type Builder

type Builder[T any] interface {
	Configure() (T, error)
}

type Loader

type Loader[T any] struct {
	Builder[T]
}

func (Loader[T]) Configure

func (l Loader[T]) Configure() (T, error)

func (*Loader[T]) UnmarshalJSON

func (b *Loader[T]) UnmarshalJSON(raw []byte) error

type Registry

type Registry[T any] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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