encoding

package
v0.0.0-...-55524bd Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertEncoding

func ConvertEncoding(encoding string, source string, dstEncoding string, pretty bool) (string, error)

ConvertEncoding converts source text from encoding to dstEncoding.

func FromEncoding

func FromEncoding(encoding string, source string) (interface{}, error)

FromEncoding parse specific encoding string to universal Go data.

func FromJSON

func FromJSON(s string) (interface{}, error)

FromJSON decode a json string to universal Go data

func FromXML

func FromXML(s string) (interface{}, error)

FromXML decode a xml string to universal Go data.

func FromYAML

func FromYAML(s string) (interface{}, error)

FromYAML decode a yaml string to universal Go data.

func MustConvertEncoding

func MustConvertEncoding(encoding string, source string, dstEncoding string, pretty bool) string

MustConvertEncoding converts source text from encoding to dstEncoding. It panic if error occur.

func MustFromEncoding

func MustFromEncoding(encoding string, source string) interface{}

MustFromEncoding parse specific encoding string to universal Go data. It panic if error occur.

func MustFromJSON

func MustFromJSON(s string) interface{}

MustFromJSON decode a json string to universal Go data. It panic if error.

func MustFromXML

func MustFromXML(s string) interface{}

MustFromXML decode a xml string to universal Go data. It panic if error.

func MustFromYAML

func MustFromYAML(s string) interface{}

MustFromYAML decode a yaml string to universal Go data. It panic if error.

func MustToEncoding

func MustToEncoding(encoding string, d interface{}, pretty bool) string

MustToEncoding encode a universal Go data into specific encoding string. It panic if error occur.

func MustToJSON

func MustToJSON(v interface{}, pretty bool) string

MustToJSON encode a Go data to json string. It panic if error.

func MustToXML

func MustToXML(v interface{}, pretty bool) string

MustToXML encode a Go data to xml string. It panic if error.

func MustToYAML

func MustToYAML(v interface{}, pretty bool) string

MustToYAML encode a Go data to yaml string. It panic if error.

func ToEncoding

func ToEncoding(encoding string, d interface{}, pretty bool) (string, error)

ToEncoding encode a universal Go data into specific encoding string.

func ToJSON

func ToJSON(v interface{}, pretty bool) (string, error)

ToJSON encode a Go data to json string

func ToXML

func ToXML(v interface{}, pretty bool) (string, error)

ToXML encode a Go data to xml string.

func ToYAML

func ToYAML(v interface{}, pretty bool) (string, error)

ToYAML encode a Go data to yaml string.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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