Documentation ¶
Overview ¶
Package format implements a config client Backend that performs formatting on items.
The available formats are registered during init() time via 'Register'.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearRegistry ¶
func ClearRegistry()
ClearRegistry removes all registered formatters.
Useful in tests that call Register to setup initial state.
Types ¶
type Backend ¶
type Backend struct { // B is the underlying Backend that this Backend will pull data // from. backend.B }
Backend is a backend.B implementation that applies Formatter transformations to the various Items that pass through it.
Formatter transformations are registered explicitly to the Resolver descriptions of the types that they operate on. If an Item is already formatted, no further transformations will be applied.
type Formatter ¶
Formatter applies a transformation to the data's cached representation.
The Formatter is supplied with the content to format along with the formatter-specific metadata, fd.
Formatter operates on a backend.Item's Content via the "format" Backend.