htypes

package
v1.1.30 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTypeBool          = "Bool"
	HTypeString        = "String"
	HTypeStringArray   = "StringArray" //字符串数组
	HTypeNumber        = "Number"
	HTypeNumberRange   = "NumberRange" //数字边界,格式为[a,b],a、b只能是数字
	HTypeNumberArray   = "NumberArray" //数字数组
	HTypeBytes         = "Bytes"       //二进制数据
	HTypeBytesArray    = "BytesArray"  //二进制数据数组
	HTypeDate          = "Date"
	HTypeDateRange     = "DateRange" //日期边界,格式为[a,b],a、b只能是日期字符串:格式为yyyy-mm-dd
	HTypeDateArray     = "DateArray"
	HTypeDateTime      = "Datetime"
	HTypeDateTimeRange = "DatetimeRange" //日期时间边界,格式为[a,b],a、b只能是日期时间字符串,格式为:yyy-mm-dd hh-MM-ss
	HTypeDateTimeArray = "DatetimeArray"
	HTypeObject        = "Object"
	HTypeObjectArray   = "ObjectArray"
)

类型定义

Variables

This section is empty.

Functions

func GetKindName

func GetKindName(k reflect.Kind) string

func IsNumber

func IsNumber(v Any) bool

func ParseNumberRange

func ParseNumberRange(v interface{}) (from float64, to float64)

func ToNumber

func ToNumber(v Any) (float64, bool)

func Validate

func Validate(v interface{}, typ HType) error

Types

type Any

type Any interface{}

type HType

type HType string

type Map

type Map map[string]interface{}

func (*Map) From

func (this *Map) From(v map[string]interface{})

func (*Map) To

func (this *Map) To() map[string]interface{}

Jump to

Keyboard shortcuts

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