formats

package
v0.0.0-...-7ea2635 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FormatMapping = map[FormatName]Format{
	Gob:         &gobFormat{},
	JSON:        &jsonFormat{},
	XML:         &xmlFormat{},
	YAML:        &yamlFormat{},
	Protobuf:    &protoFormat{},
	MessagePack: &msgPackFormat{},
}

Functions

This section is empty.

Types

type Format

type Format interface {
	Serialize(value entity.AnimalShelter) ([]byte, error)
	Deserialize(value []byte, result *entity.AnimalShelter) error
}

type FormatName

type FormatName string
const (
	Gob         FormatName = "gob" // "native" format
	JSON        FormatName = "json"
	XML         FormatName = "xml"
	Protobuf    FormatName = "protobuf"
	YAML        FormatName = "yaml"
	MessagePack FormatName = "message_pack"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL