tag

package
v1.30.34 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFieldTag added in v1.20.12

func GetFieldTag(field reflect.StructField) string

GetFieldTag get json field tag if no, use HumpToLine

func GetGtTags added in v1.20.12

func GetGtTags(model interface{}) map[string]gtTags

GetGtTags gt:"-" gt:"ignore" gt:"sub_sql" gt:"excel:NAME" gt:"field:table.column" gt:"field:table.column;excel:NAME" GetGtTags use to analyze and obtain GT tags in the structure model

func GetJsonTags added in v1.20.12

func GetJsonTags(model interface{}) map[string]string

GetJsonTags use to analyze and obtain JSON tags in the structure model, but it will ignore the ignored value of json

func GetPartTags added in v1.20.17

func GetPartTags(model interface{}) (arr []string)

GetPartTags remove some like id,_id

func GetTags

func GetTags(model interface{}) (arr []string)

GetTags get struct model fields tag []string include gt tag rule

func IsGtTagIgnore added in v1.20.12

func IsGtTagIgnore(tag reflect.StructTag) bool

IsGtTagIgnore can determine gt-tags whether you do not need to parse

func IsTagIgnore added in v1.20.12

func IsTagIgnore(tag reflect.StructTag, tagName string, exist bool, extTags ...string) bool

IsTagIgnore can determine tags whether you do not need to parse

func ObtainMoreTags added in v1.20.12

func ObtainMoreTags(typ reflect.Type, tagNames []string, fs ...func(reflect.StructTag) bool) map[string]map[string]string

ObtainMoreTags use to get the specified tag in the structure fs use to filter specified tags, true means filtering

func ObtainTags added in v1.20.12

func ObtainTags(ref reflect.Type, tagName string, fs ...func(reflect.StructTag) bool) map[string]string

ObtainTags use to get the specified tag in the structure fs use to filter specified tags, true means filtering

func ParseFieldTag added in v1.30.34

func ParseFieldTag(sTag reflect.StructTag, tagV, field string) (tag, tagTable string, b bool)

ParseFieldTag gorm:"column:field"

func ParseGtTag added in v1.20.12

func ParseGtTag(sTag reflect.StructTag) (tag, tagTable string, b bool)

ParseGtTag gt:"field:table.column"

func ParseGtTags added in v1.20.12

func ParseGtTags(ref reflect.Type, fs ...func(reflect.StructTag) bool) map[string]gtTags

ParseGtTags use to get all gt tags

func ParseJsonTags added in v1.20.12

func ParseJsonTags(ref reflect.Type, fs ...func(reflect.StructTag) bool) map[string]string

func ParseTag added in v1.30.34

func ParseTag(field reflect.StructField) (tag, tagTable, jsonTag string, b bool)

ParseTag parse tag gt:"field:table.field" gorm:"column:field" json:"field" gt > gorm > json > struct field

Types

This section is empty.

Jump to

Keyboard shortcuts

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