Documentation
¶
Index ¶
- type Bool
- func (x *Bool) Bool(def ...bool) bool
- func (x *Bool) Float64(def ...float64) float64
- func (x *Bool) Int(def ...int) int
- func (x *Bool) Int64(def ...int64) int64
- func (x *Bool) MarshalJSON() ([]byte, error)
- func (x *Bool) String(def ...string) string
- func (x *Bool) UnmarshalJSON(bytes []byte) error
- func (x *Bool) Valid() bool
- func (x *Bool) Value(def ...bool) bool
- type Date
- type Enum
- func (e *Enum[K, V]) Add(k K, v V) *Enum[K, V]
- func (e *Enum[K, V]) Clear()
- func (e *Enum[K, V]) Exist(k K) bool
- func (e *Enum[K, V]) Get(k K) V
- func (e *Enum[K, V]) Keys() []K
- func (e *Enum[K, V]) Len() int
- func (e *Enum[K, V]) Range(fn func(k K, v V) bool)
- func (e *Enum[K, V]) RangeWithIndex(fn func(i int, k K, v V) bool)
- func (e *Enum[K, V]) Remove(k K)
- func (e *Enum[K, V]) Values() []V
- type Float64
- func (x *Float64) Bool(def ...bool) bool
- func (x *Float64) Float64(def ...float64) float64
- func (x *Float64) Int(def ...int) int
- func (x *Float64) Int64(def ...int64) int64
- func (x *Float64) MarshalJSON() ([]byte, error)
- func (x *Float64) String(def ...string) string
- func (x *Float64) UnmarshalJSON(bytes []byte) error
- func (x *Float64) Valid() bool
- func (x *Float64) Value(def ...float64) float64
- type Int
- func (x *Int) Bool(def ...bool) bool
- func (x *Int) Float64(def ...float64) float64
- func (x *Int) Int(def ...int) int
- func (x *Int) Int64(def ...int64) int64
- func (x *Int) MarshalJSON() ([]byte, error)
- func (x *Int) String(def ...string) string
- func (x *Int) UnmarshalJSON(bytes []byte) error
- func (x *Int) Valid() bool
- func (x *Int) Value(def ...int) int
- type Int64
- func (x *Int64) Bool(def ...bool) bool
- func (x *Int64) Float64(def ...float64) float64
- func (x *Int64) Int(def ...int) int
- func (x *Int64) Int64(def ...int64) int64
- func (x *Int64) MarshalJSON() ([]byte, error)
- func (x *Int64) String(def ...string) string
- func (x *Int64) UnmarshalJSON(bytes []byte) error
- func (x *Int64) Valid() bool
- func (x *Int64) Value(def ...int64) int64
- type Link
- type Node
- type String
- func (x *String) Bool(def ...bool) bool
- func (x *String) Float64(def ...float64) float64
- func (x *String) Int(def ...int) int
- func (x *String) Int64(def ...int64) int64
- func (x *String) MarshalJSON() ([]byte, error)
- func (x *String) String(def ...string) string
- func (x *String) UnmarshalJSON(bytes []byte) error
- func (x *String) Valid() bool
- func (x *String) Value(def ...string) string
- type Time
- type TreeNode
- type Trie
- type Unique
- type Value
- type Zero
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bool ¶
type Bool struct {
// contains filtered or unexported fields
}
Bool 布尔值
func (*Bool) MarshalJSON ¶
func (*Bool) UnmarshalJSON ¶
type Date ¶
type Date struct {
// contains filtered or unexported fields
}
func (*Date) MarshalJSON ¶
func (*Date) UnmarshalJSON ¶
type Enum ¶
type Enum[K comparable, V any] struct { // contains filtered or unexported fields }
Enum 枚举类
func NewStringEnum ¶
NewStringEnum key为string类型,value为任意类型
func (*Enum[K, V]) RangeWithIndex ¶ added in v1.25.2
RangeWithIndex 遍历枚举值
type Float64 ¶
type Float64 struct {
// contains filtered or unexported fields
}
Float64 浮点数值
func (*Float64) MarshalJSON ¶
func (*Float64) UnmarshalJSON ¶
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
Int 整数值
func (*Int) MarshalJSON ¶
func (*Int) UnmarshalJSON ¶
type Int64 ¶
type Int64 struct {
// contains filtered or unexported fields
}
Int64 整数值
func (*Int64) MarshalJSON ¶
func (*Int64) UnmarshalJSON ¶
type String ¶
type String struct {
// contains filtered or unexported fields
}
String 字符串值
func (*String) MarshalJSON ¶
func (*String) UnmarshalJSON ¶
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
func (*Time) MarshalJSON ¶
func (*Time) UnmarshalJSON ¶
type TreeNode ¶
type TreeNode[T any] struct { Id string `json:"id"` Pid string `json:"pid"` Data T `json:"data"` Child []*TreeNode[T] `json:"child"` }
TreeNode 树形节点
func Convert2Tree ¶
Convert2Tree 平铺数组转为树形结构
type Value ¶
type Value interface {
Valid() bool // 是否有效
String(def ...string) string // 转为字符串,若无效则返回默认值
Int(def ...int) int // 转为整数,若无效则返回默认值
Int64(def ...int64) int64 // 转为整数,若无效则返回默认值
Float64(def ...float64) float64 // 转为浮点数,若无效则返回默认值
Bool(def ...bool) bool // 转为布尔值,若无效则返回默认值
}
Value 任意值
Click to show internal directories.
Click to hide internal directories.