types

package
v1.0.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2023 License: BSD-2-Clause Imports: 5 Imported by: 0

README

功能说明

1、保存任意类型的基础数据,并可以自由转换

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	// contains filtered or unexported fields
}

func (*Base) GetVal

func (this *Base) GetVal() any

获取值原始数据

func (*Base) IsNil

func (this *Base) IsNil() bool

该值是否为空

func (*Base) SetVal

func (this *Base) SetVal(val any) *Base

设置数据值

func (*Base) ToFloat32

func (this *Base) ToFloat32() float32

func (*Base) ToFloat64

func (this *Base) ToFloat64() float64

func (*Base) ToInt

func (this *Base) ToInt() int

func (*Base) ToInt32

func (this *Base) ToInt32() int32

func (*Base) ToInt64

func (this *Base) ToInt64() int64

func (*Base) ToString

func (this *Base) ToString() string

func (*Base) ToUnit

func (this *Base) ToUnit() uint

func (*Base) ToUnit32

func (this *Base) ToUnit32() uint32

func (*Base) ToUnit64

func (this *Base) ToUnit64() uint64

type Json added in v1.0.3

type Json struct {
	// contains filtered or unexported fields
}

func NewJson added in v1.0.3

func NewJson(val any) *Json

func (*Json) GetVal added in v1.0.3

func (this *Json) GetVal() any

获取值原始数据

func (*Json) MarshalJSON added in v1.0.3

func (this *Json) MarshalJSON() ([]byte, error)

序列

func (*Json) SetVal added in v1.0.3

func (this *Json) SetVal(val any) any

设置数据值

func (*Json) UnmarshalJSON added in v1.0.3

func (this *Json) UnmarshalJSON(data []byte) error

反序列

type StrNumber added in v1.0.3

type StrNumber float64

针对json的不是数字类型的反序列化

func (*StrNumber) UnmarshalJSON added in v1.0.3

func (self *StrNumber) UnmarshalJSON(data []byte) error

反序列化

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL