Documentation
¶
Index ¶
- Constants
- Variables
- func Decode(r io.Reader, v any, limitSize ...int64) error
- func FieldIs(field, value string) func(item Raw) bool
- func KeyIs(field string) func(item Raw) string
- func MarshalToFile(file string, v any) error
- func UnmarshalFromFile(file string, v any) error
- type Duration
- type Ints
- type List
- type Raw
- func From(v any) Raw
- func FromE(v any) (Raw, error)
- func Get[T ~string | ~[]byte](src T, key ...string) Raw
- func Load(file string) Raw
- func LoadE(file string) (Raw, error)
- func LoadYaml(file string) Raw
- func LoadYamlE(file string) (Raw, error)
- func New(key string, value any) Raw
- func ParseYaml(yaml []byte) Raw
- func ParseYamlE(yaml []byte) (Raw, error)
- func Read(r io.Reader) (Raw, error)
- func (r Raw) Del(keys ...string) Raw
- func (r Raw) Exists(key string) bool
- func (r Raw) Get(key string) Raw
- func (r Raw) GetBool(key string, def ...bool) bool
- func (r Raw) GetBools(key string) []bool
- func (r Raw) GetDuration(key string) time.Duration
- func (r Raw) GetFloat(key string) float64
- func (r Raw) GetFloats(key string) []float64
- func (r Raw) GetInt(key string) int64
- func (r Raw) GetInts(key string) []int64
- func (r Raw) GetRet(key string) Result
- func (r Raw) GetString(key string) string
- func (r Raw) GetStrings(key string) []string
- func (r Raw) GetTime(key string) (dst time.Time)
- func (r Raw) Gets(key string) []Raw
- func (r Raw) Index(key string) int
- func (r Raw) Indexes(key string) []int
- func (r Raw) IsEmpty() bool
- func (r Raw) Map(key string) (out map[string]Raw)
- func (r Raw) MarshalJSON() ([]byte, error)
- func (r Raw) Pretty() Raw
- func (r Raw) Save(file string) error
- func (r Raw) Set(key string, value any) Raw
- func (r Raw) String() string
- func (r Raw) Ugly() Raw
- func (r Raw) Unmarshal(obj any) error
- func (r *Raw) UnmarshalJSON(bytes []byte) error
- func (r Raw) WriteTo(w io.Writer) (int64, error)
- type Result
- type Strings
Constants ¶
View Source
const ( Nanosecond Duration = 1 Microsecond = 1000 * Nanosecond Millisecond = 1000 * Microsecond Second = 1000 * Millisecond Minute = 60 * Second Hour = 60 * Minute )
Variables ¶
View Source
var ( Unmarshal = json.Unmarshal Marshal = json.Marshal )
Functions ¶
func MarshalToFile ¶
func UnmarshalFromFile ¶
Types ¶
type Raw ¶
type Raw string
Raw 原始json数据, 封装了一些常用便捷的操作
func ParseYamlE ¶
func (Raw) GetStrings ¶
func (Raw) MarshalJSON ¶
func (*Raw) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.