req/global_params.go

56 lines
1.1 KiB
Go
Raw Permalink Normal View History

2024-05-08 21:35:26 +08:00
package req
import (
"time"
)
type GlobalParams interface {
User() User
// 获取路径内容
Get(p string) GlobalParams
// 路径包裹
Wrapped(p string) GlobalParams
// 追加到新 json
AppendTo(root, p string) GlobalParams
// 通过路径设置参数
Set(p string, v any) bool
// 通过路径设置原始参数
SetRaw(p string, v string) bool
// 删除路径参数
Delete(p string) bool
// 获取原始JOSN字符串
Raw() string
// 转数组 GlobalParams
Array() []GlobalParams
// 判断内容是否存在
Exists() bool
Value() any
Bool() bool
Time() time.Time
TimeInDefaultLocation(l *time.Location) time.Time
Float64() float64
Float32() float32
Int64() int64
Int32() int32
Int16() int16
Int8() int8
Int() int
Uint() uint
Uint64() uint64
Uint32() uint32
Uint16() uint16
Uint8() uint8
String() string
StringMapString() map[string]string
StringMapStringSlice() map[string][]string
StringMapBool() map[string]bool
StringMapInt() map[string]int
StringMapInt64() map[string]int64
StringMap() map[string]any
Slice() []any
BoolSlice() []bool
StringSlice() []string
IntSlice() []int
}