Documentation ¶
Index ¶
- Constants
- func CodingTypeFromExtension(ext string) (string, error)
- func Decode(codingType string, b []byte, v interface{}) error
- func DecodeJSON(b []byte, v interface{}) error
- func DecodeMsgPack(b []byte, v interface{}) error
- func DecodeTOML(b []byte, v interface{}) error
- func DecodeYAML(b []byte, v interface{}) error
- func Encode(codingType string, v interface{}) ([]byte, error)
- func EncodeJSON(v interface{}) ([]byte, error)
- func EncodeMsgPack(v interface{}) ([]byte, error)
- func EncodePrettyJSON(v interface{}) ([]byte, error)
- func EncodeTOML(v interface{}) ([]byte, error)
- func EncodeYAML(v interface{}) ([]byte, error)
- func Print(kind string, v interface{})
- func PrintJSON(v interface{})
- func PrintTOML(v interface{})
- func PrintYAML(v interface{})
- func ReadFile(v interface{}, filename string) error
- func ReadFileEx(codingType string, v interface{}, filename string) error
- func WriteFile(v interface{}, filename string) error
- func WriteFileEx(codingType string, v interface{}, filename string) error
- type Coding
- type JSONCoding
- type JSONPrettyCoding
- type MsgPackCoding
- type TomlCoding
- type YamlCoding
Constants ¶
View Source
const ( JSON = "json" TOML = "toml" YAML = "yaml" MSGPACK = "msgpack" )
Variables ¶
This section is empty.
Functions ¶
func CodingTypeFromExtension ¶
func DecodeJSON ¶
func DecodeMsgPack ¶
func DecodeTOML ¶
func DecodeYAML ¶
func EncodeJSON ¶
func EncodeMsgPack ¶
func EncodePrettyJSON ¶
func EncodeTOML ¶
func EncodeYAML ¶
func ReadFileEx ¶
func WriteFileEx ¶
Types ¶
type Coding ¶
type Coding interface { Encode(v interface{}) ([]byte, error) Decode(d []byte, v interface{}) error }
func CodingFromType ¶
type JSONCoding ¶
type JSONCoding struct { }
func (*JSONCoding) Decode ¶
func (coder *JSONCoding) Decode(b []byte, v interface{}) error
func (*JSONCoding) Encode ¶
func (coder *JSONCoding) Encode(v interface{}) ([]byte, error)
type JSONPrettyCoding ¶
type JSONPrettyCoding struct { }
func (*JSONPrettyCoding) Decode ¶
func (coder *JSONPrettyCoding) Decode(b []byte, v interface{}) error
func (*JSONPrettyCoding) Encode ¶
func (coder *JSONPrettyCoding) Encode(v interface{}) ([]byte, error)
type MsgPackCoding ¶
type MsgPackCoding struct { }
func (*MsgPackCoding) Decode ¶
func (coder *MsgPackCoding) Decode(b []byte, v interface{}) error
func (*MsgPackCoding) Encode ¶
func (coder *MsgPackCoding) Encode(v interface{}) ([]byte, error)
type TomlCoding ¶
type TomlCoding struct { }
func (*TomlCoding) Decode ¶
func (coder *TomlCoding) Decode(b []byte, v interface{}) error
func (*TomlCoding) Encode ¶
func (coder *TomlCoding) Encode(v interface{}) ([]byte, error)
type YamlCoding ¶
type YamlCoding struct { }
func (*YamlCoding) Decode ¶
func (coder *YamlCoding) Decode(b []byte, v interface{}) error
func (*YamlCoding) Encode ¶
func (coder *YamlCoding) Encode(v interface{}) ([]byte, error)
Click to show internal directories.
Click to hide internal directories.