Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DummyRegistry ¶
DummyRegistry represents simple slice-based codec registry.
type SmartRegistry ¶
SmartRegistry is a smart codec registry that is used to store available codecs and retrieve them by mime type.
func NewSmartRegistry ¶
func NewSmartRegistry() *SmartRegistry
NewSmartRegistry is a SmartRegistry constructor func.
func (*SmartRegistry) Default ¶
func (r *SmartRegistry) Default(mime string) error
Default allows setting Codec as a default by mime type. If codec was not found function returns an error. This function can be called multiple times overriding the previous values.
func (*SmartRegistry) Lookup ¶
func (r *SmartRegistry) Lookup(mime string) codec.Codec
Lookup searches for appropriate codec by MimeType, if there is no exact match (that is possible using codecs such as Multipart), it tries to detect a codec in an opposite way, comparing default codec MimeType to the provided argument.
func (*SmartRegistry) Register ¶
func (r *SmartRegistry) Register(mime string, f codecInitFunc) error
Register makes codec available for provided mime type.