Documentation ¶
Index ¶
- Constants
- func Marshal(v interface{}) ([]byte, error)
- func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)
- func MustMarshal(v interface{}) []byte
- func MustMarshalIndent(v interface{}, prefix, indent string) []byte
- func MustSplitPath(path string) []interface{}
- func MustUnmarshal(data []byte, v interface{})
- func MustUnmarshalReader(data io.Reader, v interface{})
- func NewDecoder(r io.Reader) *json.Decoder
- func SplitPath(path string) ([]interface{}, error)
- func Unmarshal(data []byte, v interface{}) error
- func UnmarshalReader(data io.Reader, v interface{}) error
- type Json
- func FromBytes(b []byte) (*Json, error)
- func FromFile(file string) (*Json, error)
- func FromInterface(i interface{}) *Json
- func FromReadCloser(rc io.ReadCloser) (*Json, error)
- func FromReader(r io.Reader) (*Json, error)
- func FromString(str string) (*Json, error)
- func MustFromBytes(b []byte) *Json
- func MustFromFile(file string) *Json
- func MustFromReadCloser(rc io.ReadCloser) *Json
- func MustFromReader(r io.Reader) *Json
- func MustFromString(str string) *Json
- func MustNew() *Json
- func New() (*Json, error)
- func (j *Json) Bool(path ...interface{}) (bool, error)
- func (j *Json) BoolOrDefault(pathThenDefault ...interface{}) bool
- func (j *Json) Del(path ...interface{}) error
- func (j *Json) Duration(path ...interface{}) (time.Duration, error)
- func (j *Json) DurationOrDefault(pathThenDefault ...interface{}) time.Duration
- func (j *Json) DurationSlice(path ...interface{}) ([]time.Duration, error)
- func (j *Json) DurationSliceOrDefault(pathThenDefault ...interface{}) []time.Duration
- func (j *Json) Exists(path ...interface{}) bool
- func (j *Json) Float64(path ...interface{}) (float64, error)
- func (j *Json) Float64OrDefault(pathThenDefault ...interface{}) float64
- func (j *Json) Float64Slice(path ...interface{}) ([]float64, error)
- func (j *Json) Float64SliceOrDefault(pathThenDefault ...interface{}) []float64
- func (j *Json) Get(path ...interface{}) (*Json, error)
- func (j *Json) ID(path ...interface{}) (ID, error)
- func (j *Json) IDOrDefault(pathThenDefault ...interface{}) ID
- func (j *Json) Int(path ...interface{}) (int, error)
- func (j *Json) Int64(path ...interface{}) (int64, error)
- func (j *Json) Int64OrDefault(pathThenDefault ...interface{}) int64
- func (j *Json) Int64Slice(path ...interface{}) ([]int64, error)
- func (j *Json) Int64SliceDefault(pathThenDefault ...interface{}) []int64
- func (j *Json) IntOrDefault(pathThenDefault ...interface{}) int
- func (j *Json) IntSlice(path ...interface{}) ([]int, error)
- func (j *Json) IntSliceOrDefault(pathThenDefault ...interface{}) []int
- func (j *Json) Interface(path ...interface{}) (interface{}, error)
- func (j *Json) InterfaceOrDefault(pathThenDefault ...interface{}) interface{}
- func (j *Json) Map(path ...interface{}) (map[string]interface{}, error)
- func (j *Json) MapOrDefault(pathThenDefault ...interface{}) map[string]interface{}
- func (j *Json) MapString(path ...interface{}) (map[string]string, error)
- func (j *Json) MapStringOrDefault(pathThenDefault ...interface{}) map[string]string
- func (j *Json) MarshalJSON() ([]byte, error)
- func (j *Json) MustBool(path ...interface{}) bool
- func (j *Json) MustDel(path ...interface{})
- func (j *Json) MustDuration(path ...interface{}) time.Duration
- func (j *Json) MustDurationSlice(path ...interface{}) []time.Duration
- func (j *Json) MustFloat64(path ...interface{}) float64
- func (j *Json) MustFloat64Slice(path ...interface{}) []float64
- func (j *Json) MustGet(path ...interface{}) *Json
- func (j *Json) MustID(path ...interface{}) ID
- func (j *Json) MustInt(path ...interface{}) int
- func (j *Json) MustInt64(path ...interface{}) int64
- func (j *Json) MustInt64Slice(path ...interface{}) []int64
- func (j *Json) MustIntSlice(path ...interface{}) []int
- func (j *Json) MustInterface(path ...interface{}) interface{}
- func (j *Json) MustMap(path ...interface{}) map[string]interface{}
- func (j *Json) MustMapString(path ...interface{}) map[string]string
- func (j *Json) MustSet(pathThenValue ...interface{}) *Json
- func (j *Json) MustSlice(path ...interface{}) []interface{}
- func (j *Json) MustString(path ...interface{}) string
- func (j *Json) MustStringSlice(path ...interface{}) []string
- func (j *Json) MustTime(path ...interface{}) time.Time
- func (j *Json) MustTimeSlice(path ...interface{}) []time.Time
- func (j *Json) MustToBytes() []byte
- func (j *Json) MustToFile(file string, perm os.FileMode)
- func (j *Json) MustToPrettyBytes() []byte
- func (j *Json) MustToPrettyString() string
- func (j *Json) MustToReader() io.Reader
- func (j *Json) MustToString() string
- func (j *Json) MustUint64(path ...interface{}) uint64
- func (j *Json) MustUint64Slice(path ...interface{}) []uint64
- func (j *Json) Scan(src interface{}) error
- func (j *Json) Set(pathThenValue ...interface{}) error
- func (j *Json) Slice(path ...interface{}) ([]interface{}, error)
- func (j *Json) SliceOrDefault(pathThenDefault ...interface{}) []interface{}
- func (j *Json) String(path ...interface{}) (string, error)
- func (j *Json) StringOrDefault(pathThenDefault ...interface{}) string
- func (j *Json) StringSlice(path ...interface{}) ([]string, error)
- func (j *Json) StringSliceOrDefault(pathThenDefault ...interface{}) []string
- func (j *Json) Time(path ...interface{}) (time.Time, error)
- func (j *Json) TimeOrDefault(pathThenDefault ...interface{}) time.Time
- func (j *Json) TimeSlice(path ...interface{}) ([]time.Time, error)
- func (j *Json) TimeSliceOrDefault(pathThenDefault ...interface{}) []time.Time
- func (j *Json) ToBytes() ([]byte, error)
- func (j *Json) ToFile(file string, perm os.FileMode) error
- func (j *Json) ToPrettyBytes() ([]byte, error)
- func (j *Json) ToPrettyString() (string, error)
- func (j *Json) ToReader() (io.Reader, error)
- func (j *Json) ToString() (string, error)
- func (j *Json) Uint64(path ...interface{}) (uint64, error)
- func (j *Json) Uint64OrDefault(pathThenDefault ...interface{}) uint64
- func (j *Json) Uint64Slice(path ...interface{}) ([]uint64, error)
- func (j *Json) Uint64SliceOrDefault(pathThenDefault ...interface{}) []uint64
- func (j *Json) UnmarshalBinary(p []byte) error
- func (j *Json) UnmarshalJSON(p []byte) error
- func (j *Json) UnmarshalText(p []byte) error
- func (j *Json) Value() (driver.Value, error)
Constants ¶
View Source
const (
ContentType = "application/json;charset=utf-8"
)
Variables ¶
This section is empty.
Functions ¶
func MarshalIndent ¶
func MustMarshal ¶
func MustMarshal(v interface{}) []byte
func MustMarshalIndent ¶
func MustSplitPath ¶
func MustSplitPath(path string) []interface{}
func MustUnmarshal ¶
func MustUnmarshal(data []byte, v interface{})
func MustUnmarshalReader ¶
func UnmarshalReader ¶
Types ¶
type Json ¶
type Json struct {
// contains filtered or unexported fields
}
func FromInterface ¶
func FromInterface(i interface{}) *Json
func FromReadCloser ¶
func FromReadCloser(rc io.ReadCloser) (*Json, error)
func FromString ¶
func MustFromBytes ¶
func MustFromFile ¶
func MustFromReadCloser ¶
func MustFromReadCloser(rc io.ReadCloser) *Json
func MustFromReader ¶
func MustFromString ¶
func (*Json) BoolOrDefault ¶
func (*Json) DurationOrDefault ¶
func (*Json) DurationSlice ¶
func (*Json) DurationSliceOrDefault ¶
func (*Json) Float64OrDefault ¶
func (*Json) Float64Slice ¶
func (*Json) Float64SliceOrDefault ¶
func (*Json) IDOrDefault ¶
func (j *Json) IDOrDefault(pathThenDefault ...interface{}) ID
func (*Json) Int64OrDefault ¶
func (*Json) Int64Slice ¶
func (*Json) Int64SliceDefault ¶
func (*Json) IntOrDefault ¶
func (*Json) IntSliceOrDefault ¶
func (*Json) InterfaceOrDefault ¶
func (j *Json) InterfaceOrDefault(pathThenDefault ...interface{}) interface{}
func (*Json) MapOrDefault ¶
func (*Json) MapStringOrDefault ¶
func (*Json) MarshalJSON ¶
func (*Json) MustDuration ¶
func (*Json) MustDurationSlice ¶
func (*Json) MustFloat64 ¶
func (*Json) MustFloat64Slice ¶
func (*Json) MustInt64Slice ¶
func (*Json) MustIntSlice ¶
func (*Json) MustInterface ¶
func (j *Json) MustInterface(path ...interface{}) interface{}
func (*Json) MustMapString ¶
func (*Json) MustString ¶
func (*Json) MustStringSlice ¶
func (*Json) MustTimeSlice ¶
func (*Json) MustToBytes ¶
func (*Json) MustToPrettyBytes ¶
func (*Json) MustToPrettyString ¶
func (*Json) MustToReader ¶
func (*Json) MustToString ¶
func (*Json) MustUint64 ¶
func (*Json) MustUint64Slice ¶
func (*Json) SliceOrDefault ¶
func (j *Json) SliceOrDefault(pathThenDefault ...interface{}) []interface{}
func (*Json) StringOrDefault ¶
func (*Json) StringSlice ¶
func (*Json) StringSliceOrDefault ¶
func (*Json) TimeOrDefault ¶
func (*Json) TimeSliceOrDefault ¶
func (*Json) ToPrettyBytes ¶
func (*Json) ToPrettyString ¶
func (*Json) Uint64OrDefault ¶
func (*Json) Uint64Slice ¶
func (*Json) Uint64SliceOrDefault ¶
func (*Json) UnmarshalBinary ¶
func (*Json) UnmarshalJSON ¶
func (*Json) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.