conv

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: MIT Imports: 5 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

itdesigndev/conv

Simple data conversion library.

Data conversion

Conversions between data formats. Currently base64, json and yaml supported.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func B64Dec

func B64Dec(b64s string) (s string, err error)

B64Dec decodes string in base64 format

func B64Enc

func B64Enc(s string) (b64s string)

B64Enc encodes string to base64 format

func B64MustDec

func B64MustDec(b64s string) string

B64MustDec same as B64dec but panics on error

func Dec

func Dec(format string, src string, dst interface{}) (err error)

Dec decodes string in specific format supported format strings are: base64: "b64", "base64" json: "json", "application/json", "application/x-json", "text/json", "text/x-json" yaml: "application/yaml", "application/x-yaml", "text/yaml", "text/x-yaml"

func Enc

func Enc(format string, src interface{}) (dst string, err error)

Enc encodes string to specific format supported format strings are: base64: "b64", "base64" json: "json", "application/json", "application/x-json", "text/json", "text/x-json" yaml: "application/yaml", "application/x-yaml", "text/yaml", "text/x-yaml"

func JsonDec

func JsonDec(s string, v interface{}) error

JsonDec decodes string in json format

func JsonEnc

func JsonEnc(v interface{}) (s string, err error)

JsonEnc encodes value to json string

func JsonMustDec

func JsonMustDec(s string, v interface{})

JsonMustDec same as JsonDec but panics on error

func JsonMustEnc

func JsonMustEnc(v interface{}) string

JsonMustEnc same as JsonEnc but panics on error

func MustDec

func MustDec(format string, src string, dst interface{})

MustDec same as Dec but panics on error

func MustEnc

func MustEnc(format string, src interface{}) (dst string)

MustEnc same as Enc but panics on error

func YamlDec

func YamlDec(s string, v interface{}) error

YamlDec decodes string in yaml format

func YamlEnc

func YamlEnc(v interface{}) (s string, err error)

YamlEnc encodes value to yaml string

func YamlMustDec

func YamlMustDec(s string, v interface{})

YamlMustDec same as YamlDec but panics on error

func YamlMustEnc

func YamlMustEnc(v interface{}) string

YamlMustEnc same as YamlEnc but panics on error

Types

This section is empty.

Jump to

Keyboard shortcuts

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