tag

package
v1.30.32 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFieldTag

func GetFieldTag(field reflect.StructField) string

GetFieldTag get json field tag if no, use HumpToLine

func GetGtTags

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

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

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

func IsGtTagIgnore(tag reflect.StructTag) bool

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

func IsTagIgnore

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

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

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.30

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

ParseFieldTag gorm:"column:field"

func ParseGtTag

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

ParseGtTag gt:"field:table.column"

func ParseGtTags

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

ParseGtTags use to get all gt tags

func ParseJsonTags

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

func ParseTag added in v1.30.30

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