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) BoolOr(pathThenDefault ...interface{}) bool
- func (j *Json) Del(path ...interface{}) error
- func (j *Json) Duration(path ...interface{}) (time.Duration, error)
- func (j *Json) DurationOr(pathThenDefault ...interface{}) time.Duration
- func (j *Json) DurationSlice(path ...interface{}) ([]time.Duration, error)
- func (j *Json) DurationSliceOr(pathThenDefault ...interface{}) []time.Duration
- func (j *Json) Exists(path ...interface{}) bool
- func (j *Json) Float64(path ...interface{}) (float64, error)
- func (j *Json) Float64Or(pathThenDefault ...interface{}) float64
- func (j *Json) Float64Slice(path ...interface{}) ([]float64, error)
- func (j *Json) Float64SliceOr(pathThenDefault ...interface{}) []float64
- func (j *Json) Get(path ...interface{}) (*Json, error)
- func (j *Json) ID(path ...interface{}) (ID, error)
- func (j *Json) IDOr(pathThenDefault ...interface{}) ID
- func (j *Json) IDs(path ...interface{}) (IDs, error)
- func (j *Json) IDsOr(pathThenDefault ...interface{}) IDs
- func (j *Json) Int(path ...interface{}) (int, error)
- func (j *Json) Int64(path ...interface{}) (int64, error)
- func (j *Json) Int64Or(pathThenDefault ...interface{}) int64
- func (j *Json) Int64Slice(path ...interface{}) ([]int64, error)
- func (j *Json) Int64SliceDefault(pathThenDefault ...interface{}) []int64
- func (j *Json) IntOr(pathThenDefault ...interface{}) int
- func (j *Json) IntSlice(path ...interface{}) ([]int, error)
- func (j *Json) IntSliceOr(pathThenDefault ...interface{}) []int
- func (j *Json) Interface(path ...interface{}) (interface{}, error)
- func (j *Json) InterfaceOr(pathThenDefault ...interface{}) interface{}
- func (j *Json) Key(path ...interface{}) (Key, error)
- func (j *Json) KeyOr(pathThenDefault ...interface{}) Key
- func (j *Json) Keys(path ...interface{}) (Keys, error)
- func (j *Json) KeysOr(pathThenDefault ...interface{}) Keys
- func (j *Json) Map(path ...interface{}) (map[string]interface{}, error)
- func (j *Json) MapOr(pathThenDefault ...interface{}) map[string]interface{}
- func (j *Json) MapString(path ...interface{}) (map[string]string, error)
- func (j *Json) MapStringOr(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) MustIDs(path ...interface{}) IDs
- 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) MustKey(path ...interface{}) Key
- func (j *Json) MustKeys(path ...interface{}) Keys
- 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) SliceOr(pathThenDefault ...interface{}) []interface{}
- func (j *Json) String(path ...interface{}) (string, error)
- func (j *Json) StringOr(pathThenDefault ...interface{}) string
- func (j *Json) StringSlice(path ...interface{}) ([]string, error)
- func (j *Json) StringSliceOr(pathThenDefault ...interface{}) []string
- func (j *Json) Time(path ...interface{}) (time.Time, error)
- func (j *Json) TimeOr(pathThenDefault ...interface{}) time.Time
- func (j *Json) TimeSlice(path ...interface{}) ([]time.Time, error)
- func (j *Json) TimeSliceOr(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) Uint64Or(pathThenDefault ...interface{}) uint64
- func (j *Json) Uint64Slice(path ...interface{}) ([]uint64, error)
- func (j *Json) Uint64SliceOr(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) DurationOr ¶
func (*Json) DurationSlice ¶
func (*Json) DurationSliceOr ¶
func (*Json) Float64Slice ¶
func (*Json) Float64SliceOr ¶
func (*Json) Int64Slice ¶
func (*Json) Int64SliceDefault ¶
func (*Json) IntSliceOr ¶
func (*Json) InterfaceOr ¶
func (j *Json) InterfaceOr(pathThenDefault ...interface{}) interface{}
func (*Json) MapStringOr ¶
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) StringSlice ¶
func (*Json) StringSliceOr ¶
func (*Json) TimeSliceOr ¶
func (*Json) ToPrettyBytes ¶
func (*Json) ToPrettyString ¶
func (*Json) Uint64Slice ¶
func (*Json) Uint64SliceOr ¶
func (*Json) UnmarshalBinary ¶
func (*Json) UnmarshalJSON ¶
func (*Json) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.