Documentation ¶
Index ¶
- type Processor
- type Registry
- func (r *Registry) Decoder(identifier datatransfer.TypeIdentifier) (encoding.Decoder, bool)
- func (r *Registry) Each(process func(datatransfer.TypeIdentifier, encoding.Decoder, Processor) error) error
- func (r *Registry) Processor(identifier datatransfer.TypeIdentifier) (Processor, bool)
- func (r *Registry) Register(entry datatransfer.Registerable, processor Processor) error
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 (*Registry) Decoder ¶
func (r *Registry) Decoder(identifier datatransfer.TypeIdentifier) (encoding.Decoder, bool)
Decoder gets a decoder for the given identifier
func (*Registry) Each ¶ added in v0.4.0
func (r *Registry) Each(process func(datatransfer.TypeIdentifier, encoding.Decoder, 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(entry datatransfer.Registerable, processor Processor) error
Register registers the given processor for the given entry type