Documentation
¶
Overview ¶
Package formatter holds utilities for working with different data formats.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AwareFormatter ¶
type AwareFormatter struct { JSONFormatter JSONFormatter YAMLFormatter YAMLFormatter }
AwareFormatter is entity that has ability to deserialize data in JSON or YAML format
func NewAwareFormatter ¶
func NewAwareFormatter(JSONFormatter JSONFormatter, YAMLFormatter YAMLFormatter) AwareFormatter
func (AwareFormatter) Deserialize ¶
func (a AwareFormatter) Deserialize(data []byte, v interface{}) error
Deserialize data in format of JSON or YAML on v
type Deserializer ¶
type Deserializer interface { // Deserialize deserializes data on v Deserialize(data []byte, v interface{}) error }
Deserializer describes ability to deserialize []byte in given format into v
type JSONFormatter ¶
type JSONFormatter struct{}
JSONFormatter is entity that has ability to deserialize data in JSON format
func NewJSONFormatter ¶
func NewJSONFormatter() JSONFormatter
func (JSONFormatter) Deserialize ¶
func (J JSONFormatter) Deserialize(data []byte, v interface{}) error
Deserialize data in format of JSON on v
type YAMLFormatter ¶
type YAMLFormatter struct{}
YAMLFormatter is entity that has ability to deserialize data in YAML format
func NewYAMLFormatter ¶
func NewYAMLFormatter() YAMLFormatter
func (YAMLFormatter) Deserialize ¶
func (Y YAMLFormatter) Deserialize(data []byte, v interface{}) error
Deserialize data in format of YAML on v
Click to show internal directories.
Click to hide internal directories.