json

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendBool

func AppendBool(dst []byte, val bool) []byte

AppendBool converts the input bool to a string and appends the encoded string to the input byte slice.

func AppendBools

func AppendBools(dst []byte, vals []bool) []byte

AppendBools encodes the input bools to json and appends the encoded string list to the input byte slice.

func AppendBytes

func AppendBytes(dst, s []byte) []byte

AppendBytes is a mirror of appendString with []byte arg

func AppendDuration

func AppendDuration(dst []byte, d time.Duration, unit time.Duration, useInt bool) []byte

AppendDuration formats the input duration with the given unit & format and appends the encoded string to the input byte slice.

func AppendDurations

func AppendDurations(dst []byte, vals []time.Duration, unit time.Duration, useInt bool) []byte

AppendDurations formats the input durations with the given unit & format and appends the encoded string list to the input byte slice.

func AppendError

func AppendError(dst []byte, err error) []byte

AppendError encodes the error string to json and appends the encoded string to the input byte slice.

func AppendErrors

func AppendErrors(dst []byte, errs []error) []byte

AppendErrors encodes the error strings to json and appends the encoded string list to the input byte slice.

func AppendFloat

func AppendFloat(dst []byte, val float64, bitSize int) []byte

AppendFloat converts the input float to a string and appends the encoded string to the input byte slice.

func AppendFloat32

func AppendFloat32(dst []byte, val float32) []byte

AppendFloat32 converts the input float32 to a string and appends the encoded string to the input byte slice.

func AppendFloat64

func AppendFloat64(dst []byte, val float64) []byte

AppendFloat64 converts the input float64 to a string and appends the encoded string to the input byte slice.

func AppendFloats32

func AppendFloats32(dst []byte, vals []float32) []byte

AppendFloats32 encodes the input float32s to json and appends the encoded string list to the input byte slice.

func AppendFloats64

func AppendFloats64(dst []byte, vals []float64) []byte

AppendFloats64 encodes the input float64s to json and appends the encoded string list to the input byte slice.

func AppendHex added in v1.6.0

func AppendHex(dst, s []byte) []byte

AppendHex encodes the input bytes to a hex string and appends the encoded string to the input byte slice.

The operation loops though each byte and encodes it as hex using the hex lookup table.

func AppendInt

func AppendInt(dst []byte, val int) []byte

AppendInt converts the input int to a string and appends the encoded string to the input byte slice.

func AppendInt16

func AppendInt16(dst []byte, val int16) []byte

AppendInt16 converts the input int16 to a string and appends the encoded string to the input byte slice.

func AppendInt32

func AppendInt32(dst []byte, val int32) []byte

AppendInt32 converts the input int32 to a string and appends the encoded string to the input byte slice.

func AppendInt64

func AppendInt64(dst []byte, val int64) []byte

AppendInt64 converts the input int64 to a string and appends the encoded string to the input byte slice.

func AppendInt8

func AppendInt8(dst []byte, val int8) []byte

AppendInt8 converts the input []int8 to a string and appends the encoded string to the input byte slice.

func AppendInterface

func AppendInterface(dst []byte, i interface{}) []byte

AppendInterface marshals the input interface to a string and appends the encoded string to the input byte slice.

func AppendInts

func AppendInts(dst []byte, vals []int) []byte

AppendInts encodes the input ints to json and appends the encoded string list to the input byte slice.

func AppendInts16

func AppendInts16(dst []byte, vals []int16) []byte

AppendInts16 encodes the input int16s to json and appends the encoded string list to the input byte slice.

func AppendInts32

func AppendInts32(dst []byte, vals []int32) []byte

AppendInts32 encodes the input int32s to json and appends the encoded string list to the input byte slice.

func AppendInts64

func AppendInts64(dst []byte, vals []int64) []byte

AppendInts64 encodes the input int64s to json and appends the encoded string list to the input byte slice.

func AppendInts8

func AppendInts8(dst []byte, vals []int8) []byte

AppendInts8 encodes the input int8s to json and appends the encoded string list to the input byte slice.

func AppendKey

func AppendKey(dst []byte, key string) []byte

AppendKey appends a new key to the output JSON.

func AppendObjectData added in v1.6.0

func AppendObjectData(dst []byte, o []byte) []byte

func AppendString

func AppendString(dst []byte, s string) []byte

AppendString encodes the input string to json and appends the encoded string to the input byte slice.

The operation loops though each byte in the string looking for characters that need json or utf8 encoding. If the string does not need encoding, then the string is appended in it's entirety to the byte slice. If we encounter a byte that does need encoding, switch up the operation and perform a byte-by-byte read-encode-append.

func AppendStrings

func AppendStrings(dst []byte, vals []string) []byte

AppendStrings encodes the input strings to json and appends the encoded string list to the input byte slice.

func AppendTime

func AppendTime(dst []byte, t time.Time, format string) []byte

AppendTime formats the input time with the given format and appends the encoded string to the input byte slice.

func AppendTimes

func AppendTimes(dst []byte, vals []time.Time, format string) []byte

AppendTimes converts the input times with the given format and appends the encoded string list to the input byte slice.

func AppendUint

func AppendUint(dst []byte, val uint) []byte

AppendUint converts the input uint to a string and appends the encoded string to the input byte slice.

func AppendUint16

func AppendUint16(dst []byte, val uint16) []byte

AppendUint16 converts the input uint16 to a string and appends the encoded string to the input byte slice.

func AppendUint32

func AppendUint32(dst []byte, val uint32) []byte

AppendUint32 converts the input uint32 to a string and appends the encoded string to the input byte slice.

func AppendUint64

func AppendUint64(dst []byte, val uint64) []byte

AppendUint64 converts the input uint64 to a string and appends the encoded string to the input byte slice.

func AppendUint8

func AppendUint8(dst []byte, val uint8) []byte

AppendUint8 converts the input uint8 to a string and appends the encoded string to the input byte slice.

func AppendUints

func AppendUints(dst []byte, vals []uint) []byte

AppendUints encodes the input uints to json and appends the encoded string list to the input byte slice.

func AppendUints16

func AppendUints16(dst []byte, vals []uint16) []byte

AppendUints16 encodes the input uint16s to json and appends the encoded string list to the input byte slice.

func AppendUints32

func AppendUints32(dst []byte, vals []uint32) []byte

AppendUints32 encodes the input uint32s to json and appends the encoded string list to the input byte slice.

func AppendUints64

func AppendUints64(dst []byte, vals []uint64) []byte

AppendUints64 encodes the input uint64s to json and appends the encoded string list to the input byte slice.

func AppendUints8

func AppendUints8(dst []byte, vals []uint8) []byte

AppendUints8 encodes the input uint8s to json and appends the encoded string list to the input 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