Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct { StandardOutput io.WriteCloser ErrorHandlerCallback func(err error) }
type Formatter ¶
Formatter defines a formatter for serializing an input object into a byte slice. The Serialize method serializes the input object and returns the resulting byte slice. The CheckErr method handles any error encountered during the serialization process.
func New ¶
New creates a new instance of the Formatter interface. It takes an Options struct as input and sets default values for some of the fields if they are not specified. The SerializationFormat field of the Options struct is used to determine which implementation of the Formatter interface to return. If the specified format is not supported, the function will panic.
type Options ¶
type Options struct { SerializationFormat string StandardOutput io.WriteCloser ErrorHandler func(err error) }
Options defines the options for creating a new Formatter instance.