json

package
v0.0.0-...-07f0968 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 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) BoolOr

func (j *Json) BoolOr(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) DurationOr

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

func (*Json) DurationSlice

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

func (*Json) DurationSliceOr

func (j *Json) DurationSliceOr(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) Float64Or

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

func (*Json) Float64Slice

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

func (*Json) Float64SliceOr

func (j *Json) Float64SliceOr(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) IDOr

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

func (*Json) IDs

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

func (*Json) IDsOr

func (j *Json) IDsOr(pathThenDefault ...interface{}) IDs

func (*Json) Int

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

func (*Json) Int64

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

func (*Json) Int64Or

func (j *Json) Int64Or(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) IntOr

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

func (*Json) IntSlice

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

func (*Json) IntSliceOr

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

func (*Json) Interface

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

func (*Json) InterfaceOr

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

func (*Json) Key

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

func (*Json) KeyOr

func (j *Json) KeyOr(pathThenDefault ...interface{}) Key

func (*Json) Keys

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

func (*Json) KeysOr

func (j *Json) KeysOr(pathThenDefault ...interface{}) Keys

func (*Json) Map

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

func (*Json) MapOr

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

func (*Json) MapString

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

func (*Json) MapStringOr

func (j *Json) MapStringOr(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) MustIDs

func (j *Json) MustIDs(path ...interface{}) IDs

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) MustKey

func (j *Json) MustKey(path ...interface{}) Key

func (*Json) MustKeys

func (j *Json) MustKeys(path ...interface{}) Keys

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) SliceOr

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

func (*Json) String

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

func (*Json) StringOr

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

func (*Json) StringSlice

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

func (*Json) StringSliceOr

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

func (*Json) Time

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

func (*Json) TimeOr

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

func (*Json) TimeSlice

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

func (*Json) TimeSliceOr

func (j *Json) TimeSliceOr(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) Uint64Or

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

func (*Json) Uint64Slice

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

func (*Json) Uint64SliceOr

func (j *Json) Uint64SliceOr(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