serializer

package
v1.1.75 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AutoString      = "Auto"
	JSONString      = "JSON"
	ProtobufString  = "Protobuf"
	RawStringString = "RawString"
)

Variables

This section is empty.

Functions

func ToString added in v1.1.37

func ToString(s Serializer) string

func TypeToStr added in v1.1.37

func TypeToStr(t Type) string

Types

type Marshaler

type Marshaler interface {
	Marshal(interface{}) ([]byte, error)
}

Marshaler represents a marshal interface

type Serializer

type Serializer interface {
	Marshaler
	Unmarshaler
}

Serializer is the interface that groups the basic Marshal and Unmarshal methods.

func FromString added in v1.1.37

func FromString(s string) Serializer

func FromType added in v1.1.37

func FromType(t Type) Serializer

type Type added in v1.1.37

type Type = uint32
const (
	AutoType Type = iota
	JSONType
	ProtobufType
	RawStringType
)

func StrToType added in v1.1.37

func StrToType(s string) Type

func ToType added in v1.1.37

func ToType(s Serializer) Type

type Unmarshaler

type Unmarshaler interface {
	Unmarshal([]byte, interface{}) error
}

Unmarshaler represents a Unmarshal interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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