registry

package
v2.0.0-rc7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor

type Processor interface{}

Processor is an interface that processes a certain type of encodable objects in a registry. The actual specifics of the interface that must be satisfied are left to the user of the registry

type Registry

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

Registry maintans a register of types of encodable objects and a corresponding processor for those objects The encodable types must have a method Type() that specifies and identifier so they correct decoding function and processor can be identified based on this unique identifier

func NewRegistry

func NewRegistry() *Registry

NewRegistry initialzes a new registy

func (*Registry) Each

func (r *Registry) Each(process func(datatransfer.TypeIdentifier, Processor) error) error

Each iterates through all of the entries in this registry

func (*Registry) Processor

func (r *Registry) Processor(identifier datatransfer.TypeIdentifier) (Processor, bool)

Processor gets the processing interface for the given identifer

func (*Registry) Register

func (r *Registry) Register(identifier datatransfer.TypeIdentifier, processor Processor) error

Register registers the given processor for the given entry type

Jump to

Keyboard shortcuts

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