Documentation
¶
Index ¶
- func CopyStruct(originData, targetStruct any)
- func CopyStructError(originData, targetStruct any) error
- func CopyStructPanic(originData, targetStruct any)
- func GlobalWrapperSetting(opt ...SetWrapperOption)
- func ParseBytes(bytes []byte, any any)
- func ParseBytesError(bytes []byte, any any) error
- func ParseBytesPanic(bytes []byte, any any)
- func ParseJson(jsonString string, any any)
- func ParseJsonError(jsonString string, any any) error
- func ParseJsonPanic(jsonString string, any any)
- func Time2Timestamp(time time.Time) ([]byte, error)
- func Timestamp2Time(timestampBytes []byte) (time.Time, error)
- func ToJson(any any) (json string)
- func ToJsonBytes(any any) (bytes []byte)
- func ToJsonBytesError(any any) ([]byte, error)
- func ToJsonBytesPanic(any any) (jsonBytes []byte)
- func ToJsonError(any any) (jsonString string, err error)
- func ToJsonFormat(any any) (jsonFormat string)
- func ToJsonFormatError(any any) (string, error)
- func ToJsonPanic(any any) (jsonString string)
- type SetWrapperOption
- type TimeStampType
- type Timestamp
- type TypeWrapperOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyStruct ¶
func CopyStruct(originData, targetStruct any)
CopyStruct 通过json序列化/反序列化将origin struct复制给target struct 忽略任何错误
func CopyStructError ¶
CopyStructError 通过json序列化/反序列化将origin struct复制给target struct 返回任何错误
func CopyStructPanic ¶
func CopyStructPanic(originData, targetStruct any)
CopyStructPanic 通过json序列化/反序列化将origin struct复制给target struct 任何错误将触发panic
func GlobalWrapperSetting ¶ added in v0.0.29
func GlobalWrapperSetting(opt ...SetWrapperOption)
func ParseBytes ¶ added in v0.0.6
ParseBytes 将byte数据转化成对象 忽略任何错误
func ParseBytesError ¶ added in v0.0.6
ParseBytesError 将byte数据转化成对象 返回任何错误
func ParseBytesPanic ¶ added in v0.0.6
ParseBytesPanic 将byte数据转化成对象 任何错误将触发panic
func ParseJsonError ¶
ParseJsonError 转对象 返回任何错误
func ParseJsonPanic ¶
ParseJsonPanic 转对象 任何错误将触发panic
func Timestamp2Time ¶ added in v0.0.30
func ToJsonBytesError ¶
ToJsonBytesError 转json字节 返回任何错误
func ToJsonBytesPanic ¶
ToJsonBytesPanic 转json字节 任何错误将触发panic
func ToJsonError ¶
ToJsonError 转json字符串 返回任何错误
func ToJsonFormat ¶
ToJsonFormat 转json字符串并格式化输出 忽略任何错误
func ToJsonFormatError ¶
ToJsonFormatError 转json字符串并格式化输出 返回任何错误
Types ¶
type SetWrapperOption ¶ added in v0.0.29
type SetWrapperOption func(*TypeWrapperOptions)
type TimeStampType ¶ added in v0.0.29
type TimeStampType int
const ( // TimestampTypeMilli 时间戳类型 毫秒级别 TimestampTypeMilli TimeStampType = 0 // TimestampTypeSecond 时间戳类型 秒级别 TimestampTypeSecond TimeStampType = 1 )
type Timestamp ¶ added in v0.0.29
func (Timestamp) MarshalJSON ¶ added in v0.0.29
func (Timestamp) UnmarshalJSON ¶ added in v0.0.29
type TypeWrapperOptions ¶ added in v0.0.29
type TypeWrapperOptions struct { // 序列化/反序列化 时间戳类型 TimestampType TimeStampType }
Click to show internal directories.
Click to hide internal directories.