json

package
v0.0.0-...-6725582 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentType = "application/json;charset=utf-8"
)

Variables

This section is empty.

Functions

func Marshal

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

func MarshalIndent

func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)

func MustMarshal

func MustMarshal(v interface{}) []byte

func MustMarshalIndent

func MustMarshalIndent(v interface{}, prefix, indent string) []byte

func MustSplitPath

func MustSplitPath(path string) []interface{}

func MustUnmarshal

func MustUnmarshal(data []byte, v interface{})

func MustUnmarshalReader

func MustUnmarshalReader(data io.Reader, v interface{})

func NewDecoder

func NewDecoder(r io.Reader) *json.Decoder

func SplitPath

func SplitPath(path string) ([]interface{}, error)

func Unmarshal

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

func UnmarshalReader

func UnmarshalReader(data io.Reader, v interface{}) error

Types

type Json

type Json struct {
	// contains filtered or unexported fields
}

func FromBytes

func FromBytes(b []byte) (*Json, error)

func FromFile

func FromFile(file string) (*Json, error)

func FromInterface

func FromInterface(i interface{}) *Json

func FromReadCloser

func FromReadCloser(rc io.ReadCloser) (*Json, error)

func FromReader

func FromReader(r io.Reader) (*Json, error)

func FromString

func FromString(str string) (*Json, error)

func MustFromBytes

func MustFromBytes(b []byte) *Json

func MustFromFile

func MustFromFile(file string) *Json

func MustFromReadCloser

func MustFromReadCloser(rc io.ReadCloser) *Json

func MustFromReader

func MustFromReader(r io.Reader) *Json

func MustFromString

func MustFromString(str string) *Json

func MustNew

func MustNew() *Json

func New

func New() (*Json, error)

func (*Json) Bool

func (j *Json) Bool(path ...interface{}) (bool, error)

func (*Json) BoolOrDefault

func (j *Json) BoolOrDefault(pathThenDefault ...interface{}) bool

func (*Json) Del

func (j *Json) Del(path ...interface{}) error

func (*Json) Duration

func (j *Json) Duration(path ...interface{}) (time.Duration, error)

func (*Json) DurationOrDefault

func (j *Json) DurationOrDefault(pathThenDefault ...interface{}) time.Duration

func (*Json) DurationSlice

func (j *Json) DurationSlice(path ...interface{}) ([]time.Duration, error)

func (*Json) DurationSliceOrDefault

func (j *Json) DurationSliceOrDefault(pathThenDefault ...interface{}) []time.Duration

func (*Json) Exists

func (j *Json) Exists(path ...interface{}) bool

func (*Json) Float64

func (j *Json) Float64(path ...interface{}) (float64, error)

func (*Json) Float64OrDefault

func (j *Json) Float64OrDefault(pathThenDefault ...interface{}) float64

func (*Json) Float64Slice

func (j *Json) Float64Slice(path ...interface{}) ([]float64, error)

func (*Json) Float64SliceOrDefault

func (j *Json) Float64SliceOrDefault(pathThenDefault ...interface{}) []float64

func (*Json) Get

func (j *Json) Get(path ...interface{}) (*Json, error)

func (*Json) ID

func (j *Json) ID(path ...interface{}) (ID, error)

func (*Json) IDOrDefault

func (j *Json) IDOrDefault(pathThenDefault ...interface{}) ID

func (*Json) Int

func (j *Json) Int(path ...interface{}) (int, error)

func (*Json) Int64

func (j *Json) Int64(path ...interface{}) (int64, error)

func (*Json) Int64OrDefault

func (j *Json) Int64OrDefault(pathThenDefault ...interface{}) int64

func (*Json) Int64Slice

func (j *Json) Int64Slice(path ...interface{}) ([]int64, error)

func (*Json) Int64SliceDefault

func (j *Json) Int64SliceDefault(pathThenDefault ...interface{}) []int64

func (*Json) IntOrDefault

func (j *Json) IntOrDefault(pathThenDefault ...interface{}) int

func (*Json) IntSlice

func (j *Json) IntSlice(path ...interface{}) ([]int, error)

func (*Json) IntSliceOrDefault

func (j *Json) IntSliceOrDefault(pathThenDefault ...interface{}) []int

func (*Json) Interface

func (j *Json) Interface(path ...interface{}) (interface{}, error)

func (*Json) InterfaceOrDefault

func (j *Json) InterfaceOrDefault(pathThenDefault ...interface{}) interface{}

func (*Json) Map

func (j *Json) Map(path ...interface{}) (map[string]interface{}, error)

func (*Json) MapOrDefault

func (j *Json) MapOrDefault(pathThenDefault ...interface{}) map[string]interface{}

func (*Json) MapString

func (j *Json) MapString(path ...interface{}) (map[string]string, error)

func (*Json) MapStringOrDefault

func (j *Json) MapStringOrDefault(pathThenDefault ...interface{}) map[string]string

func (*Json) MarshalJSON

func (j *Json) MarshalJSON() ([]byte, error)

func (*Json) MustBool

func (j *Json) MustBool(path ...interface{}) bool

func (*Json) MustDel

func (j *Json) MustDel(path ...interface{})

func (*Json) MustDuration

func (j *Json) MustDuration(path ...interface{}) time.Duration

func (*Json) MustDurationSlice

func (j *Json) MustDurationSlice(path ...interface{}) []time.Duration

func (*Json) MustFloat64

func (j *Json) MustFloat64(path ...interface{}) float64

func (*Json) MustFloat64Slice

func (j *Json) MustFloat64Slice(path ...interface{}) []float64

func (*Json) MustGet

func (j *Json) MustGet(path ...interface{}) *Json

func (*Json) MustID

func (j *Json) MustID(path ...interface{}) ID

func (*Json) MustInt

func (j *Json) MustInt(path ...interface{}) int

func (*Json) MustInt64

func (j *Json) MustInt64(path ...interface{}) int64

func (*Json) MustInt64Slice

func (j *Json) MustInt64Slice(path ...interface{}) []int64

func (*Json) MustIntSlice

func (j *Json) MustIntSlice(path ...interface{}) []int

func (*Json) MustInterface

func (j *Json) MustInterface(path ...interface{}) interface{}

func (*Json) MustMap

func (j *Json) MustMap(path ...interface{}) map[string]interface{}

func (*Json) MustMapString

func (j *Json) MustMapString(path ...interface{}) map[string]string

func (*Json) MustSet

func (j *Json) MustSet(pathThenValue ...interface{}) *Json

func (*Json) MustSlice

func (j *Json) MustSlice(path ...interface{}) []interface{}

func (*Json) MustString

func (j *Json) MustString(path ...interface{}) string

func (*Json) MustStringSlice

func (j *Json) MustStringSlice(path ...interface{}) []string

func (*Json) MustTime

func (j *Json) MustTime(path ...interface{}) time.Time

func (*Json) MustTimeSlice

func (j *Json) MustTimeSlice(path ...interface{}) []time.Time

func (*Json) MustToBytes

func (j *Json) MustToBytes() []byte

func (*Json) MustToFile

func (j *Json) MustToFile(file string, perm os.FileMode)

func (*Json) MustToPrettyBytes

func (j *Json) MustToPrettyBytes() []byte

func (*Json) MustToPrettyString

func (j *Json) MustToPrettyString() string

func (*Json) MustToReader

func (j *Json) MustToReader() io.Reader

func (*Json) MustToString

func (j *Json) MustToString() string

func (*Json) MustUint64

func (j *Json) MustUint64(path ...interface{}) uint64

func (*Json) MustUint64Slice

func (j *Json) MustUint64Slice(path ...interface{}) []uint64

func (*Json) Scan

func (j *Json) Scan(src interface{}) error

func (*Json) Set

func (j *Json) Set(pathThenValue ...interface{}) error

func (*Json) Slice

func (j *Json) Slice(path ...interface{}) ([]interface{}, error)

func (*Json) SliceOrDefault

func (j *Json) SliceOrDefault(pathThenDefault ...interface{}) []interface{}

func (*Json) String

func (j *Json) String(path ...interface{}) (string, error)

func (*Json) StringOrDefault

func (j *Json) StringOrDefault(pathThenDefault ...interface{}) string

func (*Json) StringSlice

func (j *Json) StringSlice(path ...interface{}) ([]string, error)

func (*Json) StringSliceOrDefault

func (j *Json) StringSliceOrDefault(pathThenDefault ...interface{}) []string

func (*Json) Time

func (j *Json) Time(path ...interface{}) (time.Time, error)

func (*Json) TimeOrDefault

func (j *Json) TimeOrDefault(pathThenDefault ...interface{}) time.Time

func (*Json) TimeSlice

func (j *Json) TimeSlice(path ...interface{}) ([]time.Time, error)

func (*Json) TimeSliceOrDefault

func (j *Json) TimeSliceOrDefault(pathThenDefault ...interface{}) []time.Time

func (*Json) ToBytes

func (j *Json) ToBytes() ([]byte, error)

func (*Json) ToFile

func (j *Json) ToFile(file string, perm os.FileMode) error

func (*Json) ToPrettyBytes

func (j *Json) ToPrettyBytes() ([]byte, error)

func (*Json) ToPrettyString

func (j *Json) ToPrettyString() (string, error)

func (*Json) ToReader

func (j *Json) ToReader() (io.Reader, error)

func (*Json) ToString

func (j *Json) ToString() (string, error)

func (*Json) Uint64

func (j *Json) Uint64(path ...interface{}) (uint64, error)

func (*Json) Uint64OrDefault

func (j *Json) Uint64OrDefault(pathThenDefault ...interface{}) uint64

func (*Json) Uint64Slice

func (j *Json) Uint64Slice(path ...interface{}) ([]uint64, error)

func (*Json) Uint64SliceOrDefault

func (j *Json) Uint64SliceOrDefault(pathThenDefault ...interface{}) []uint64

func (*Json) UnmarshalBinary

func (j *Json) UnmarshalBinary(p []byte) error

func (*Json) UnmarshalJSON

func (j *Json) UnmarshalJSON(p []byte) error

func (*Json) UnmarshalText

func (j *Json) UnmarshalText(p []byte) error

func (*Json) Value

func (j *Json) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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