utils

package
v2.0.0-alpha.2+incompa... Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2017 License: Apache-2.0 Imports: 4 Imported by: 37

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONDecode

func JSONDecode(content []byte, destinations ...interface{}) (interface{}, error)

JSONDecode decode given json byte slice to corresponding struct.

func JSONEncode

func JSONEncode(source interface{}, unescape bool) ([]byte, error)

JSONEncode encode given interface to json byte slice.

func JSONFormatToReadable

func JSONFormatToReadable(source []byte) ([]byte, error)

JSONFormatToReadable formats given json byte slice prettily.

func StringToTime

func StringToTime(timeString, format string) (time.Time, error)

StringToTime transforms given string to time.

func StringToUnixInt

func StringToUnixInt(timeString, format string) int

StringToUnixInt transforms given string to unix time int.

func TimeToString

func TimeToString(timeValue time.Time, format string) string

TimeToString transforms given time to string.

func YAMLDecode

func YAMLDecode(content []byte, destinations ...interface{}) (interface{}, error)

YAMLDecode decode given yaml byte slice to corresponding struct.

func YAMLEncode

func YAMLEncode(source interface{}) ([]byte, error)

YAMLEncode encode given interface to yaml byte slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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