Documentation ¶
Index ¶
- func IsBoolType(kind reflect.Kind) bool
- func IsFloatType(kind reflect.Kind) bool
- func IsIntType(kind reflect.Kind) bool
- func IsStringType(kind reflect.Kind) bool
- func IsStructType(kind reflect.Kind) bool
- func IsTimeType(typ reflect.Type) bool
- func ParseFieldDesc(field *reflect.StructField) string
- func ParseStructFieldName(field *reflect.StructField) string
- func ParseValueCheckers(prop *TypeProp, field *reflect.StructField)
- func StructFieldTypeToGraphType(field *reflect.StructField) (grapghType graphql.Output, isStruct bool)
- func TypeToGraphQLType(typ reflect.Type) (outType graphql.Output, isStruct bool, err error)
- type FloatMax
- type FloatMin
- type FuncInfo
- type IntegerMax
- type IntegerMin
- type StringMax
- type StringMin
- type TypeProp
- type ValueChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseStructFieldName ¶
func ParseStructFieldName(field *reflect.StructField) string
ParseStructFieldName 解析结构字段名称
func ParseValueCheckers ¶
func ParseValueCheckers(prop *TypeProp, field *reflect.StructField)
ParseValueCheckers 解析数据验证定义
func StructFieldTypeToGraphType ¶
func StructFieldTypeToGraphType(field *reflect.StructField) (grapghType graphql.Output, isStruct bool)
StructFieldTypeToGraphType 结构字段类型对应 graphql 类型
Types ¶
type IntegerMax ¶
IntegerMax 监测整形最大值
func (*IntegerMax) Passed ¶
func (imax *IntegerMax) Passed(val interface{}) error
type IntegerMin ¶
IntegerMax 监测整形最小值
func (*IntegerMin) Passed ¶
func (imin *IntegerMin) Passed(val interface{}) error
type TypeProp ¶
type TypeProp struct { SrcType reflect.Type // 原始类型 TypeName string // 真正的类型名称 PackageName string // 包名称 Kind reflect.Kind // 真正的类型 RealType reflect.Type // 真正的类型,对于 切片和指针 来说 IsPrimitive bool // 是否原生类型 IsPtr bool // 是否指针 IsList bool // 是否列表,切片 // 以下属性来自于对 tag 的解析 ValChecker []ValueChecker Desc string }
TypeProp 类型属性
Click to show internal directories.
Click to hide internal directories.