scheme

package
v0.0.0-...-99e2fb8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element[T any] struct {
	// contains filtered or unexported fields
}

func NewElement

func NewElement[T any](typ string, spec T) Element[T]

func (Element[T]) MarshalJSON

func (e Element[T]) MarshalJSON() ([]byte, error)

func (*Element[T]) UnmarshalJSON

func (e *Element[T]) UnmarshalJSON(bytes []byte) error

type Factory

type Factory[T any, R any] interface {
	Create(R) (T, error)
}

type Scheme

type Scheme[T any, F any] struct {
	// contains filtered or unexported fields
}

func NewScheme

func NewScheme[T any, F any](f F) *Scheme[T, F]

func (*Scheme[T, F]) Copy

func (s *Scheme[T, F]) Copy(f F) *Scheme[T, F]

func (*Scheme[T, F]) Get

func (s *Scheme[T, F]) Get(data []byte) (T, error)

func (*Scheme[T, F]) GetFromElement

func (s *Scheme[T, F]) GetFromElement(d *Element[Factory[T, F]]) (T, error)

func (*Scheme[T, F]) Register

func (s *Scheme[T, F]) Register(name string, proto Factory[T, F])

Jump to

Keyboard shortcuts

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