Documentation ¶
Overview ¶
Package serializing defines the various serializing Algorithms supported by the gormcrypto package
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAlgo ¶
RegisterAlgo adds an Algorithm to the internal algos map so it can be used in YAML configs
func SupportedAlgos ¶
func SupportedAlgos() []string
SupportedAlgos returns a list of registered Algorithms that can be used in YAML configs
Types ¶
type Algorithm ¶
type Algorithm interface { // Name identifies the Algorithm as a string for exporting configurations Name() string // Config converts an Algorthim's internal configuration into a map for export Config() map[string]interface{} // Serialize transforms an arbitrary Go typed value into a byte slice that can be easily encrypted/signed. Serialize(interface{}) ([]byte, error) // Unserialize transforms a byte slice representation of a value into the Go type it represents. Unserialize([]byte, interface{}) error }
Algorithm is a bad name for the core interface all gormcrypto serializers implement. The name was chosen for consistency more than anything. A type implementing serializing.Algorithm will convert a value between its Go type and a serialized text form, in a manner consistent with its type. The types implemented here wrap the Go standard library's various encoding packages.
type GOB ¶
type GOB struct {
Algorithm
}
GOB supports GOB serialization of arbitrary data structures
func (GOB) Unserialize ¶
Unserialize ::: GOB
type JSON ¶
type JSON struct {
Algorithm
}
JSON supports JSON serialization of arbitrary data structures
func (JSON) Unserialize ¶
Unserialize ::: JSON