Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(t SerializerType, serializer *Serializer) *errorAVA.Error
Types ¶
type Factory ¶
type Factory map[SerializerType]*Serializer
func GetInstance ¶
func GetInstance() *Factory
func (Factory) Register ¶
func (s Factory) Register(t SerializerType, serializer *Serializer) *errorAVA.Error
func (Factory) SerializerFactory ¶
func (s Factory) SerializerFactory(t SerializerType) (*Serializer, *errorAVA.Error)
type JSON ¶
type JSON struct { }
func (*JSON) Deserializer ¶
func (*JSON) Type ¶
func (j *JSON) Type() SerializerType
type Serializer ¶
type Serializer struct { }
func GetSerializer ¶
func GetSerializer(t SerializerType) *Serializer
func (*Serializer) Deserializer ¶
func (h *Serializer) Deserializer(data []byte, out interface{}) *errorAVA.Error
func (*Serializer) Serializer ¶
func (h *Serializer) Serializer(data interface{}) ([]byte, *errorAVA.Error)
func (*Serializer) String ¶
func (h *Serializer) String() string
func (*Serializer) Type ¶
func (h *Serializer) Type() SerializerType
type SerializerI ¶
type SerializerType ¶
type SerializerType int32
SerializerType x ENUM( json xml yaml toml hcl proto unknown )
const ( // SerializerTypeJson is a SerializerType of type Json SerializerTypeJson SerializerType = iota // SerializerTypeXml is a SerializerType of type Xml SerializerTypeXml // SerializerTypeYaml is a SerializerType of type Yaml SerializerTypeYaml // SerializerTypeToml is a SerializerType of type Toml SerializerTypeToml // SerializerTypeHcl is a SerializerType of type Hcl SerializerTypeHcl // SerializerTypeProto is a SerializerType of type Proto SerializerTypeProto // SerializerTypeUnknown is a SerializerType of type Unknown SerializerTypeUnknown )
func ParseSerializerType ¶
func ParseSerializerType(name string) (SerializerType, *errorAVA.Error)
ParseSerializerType attempts to convert a string to a SerializerType
func (SerializerType) MarshalText ¶
func (x SerializerType) MarshalText() ([]byte, *errorAVA.Error)
MarshalText implements the text marshaller method
func (SerializerType) String ¶
func (x SerializerType) String() string
String implements the Stringer interface.
func (SerializerType) UnmarshalText ¶
func (x SerializerType) UnmarshalText(text []byte) (SerializerType, *errorAVA.Error)
UnmarshalText implements the text unmarshaller method
type TOML ¶
type TOML struct { }
func (*TOML) Deserializer ¶
func (*TOML) Serializer ¶
func (*TOML) Type ¶
func (t *TOML) Type() SerializerType
type YAML ¶
type YAML struct { }
func (*YAML) Deserializer ¶
func (*YAML) Type ¶
func (y *YAML) Type() SerializerType
Source Files ¶
Click to show internal directories.
Click to hide internal directories.