json

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r io.Reader, v interface{}) error

Decode decodes the reader data.

func Marshal

func Marshal(v interface{}) ([]byte, error)

Marshal delegates to json.Marshal It is only here so this package can be a drop-in for common encoding/json uses

func NewEncoder

func NewEncoder(w io.Writer) *json.Encoder

NewEncoder delegates to json.NewEncoder It is only here so this package can be a drop-in for common encoding/json uses

func Unmarshal

func Unmarshal(b []byte, v interface{}) error

Unmarshal unmarshals the given data.

Types

type Duration

type Duration time.Duration

A Duration represents the elapsed time between two instants.

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals b from string if double quotes around e.g. "1m10s" or an int in nanosecond.

Jump to

Keyboard shortcuts

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