model

package
v0.0.0-...-5dfba8e Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name string
	Tags Tags
}

type Struct

type Struct struct {
	Fields    []Field
	MaxLenTag map[string]int
	Node      ast.Node
}

Struct is data type for struct type

type Tags

type Tags struct {
	// Str is the actual tag without parsing
	Str       string
	Node      ast.Node
	StrResult string
}

func (Tags) Get

func (t Tags) Get(key string) string

func (Tags) GetKeys

func (t Tags) GetKeys() (keys []string)

GetKeys get the list keys of a struct tag the algorithm is not originally mine I copied from go/src/reflect/type.go:1136 then modify some lines

func (Tags) IsValid

func (t Tags) IsValid() bool

IsValid check whether the validity of struct tag

Jump to

Keyboard shortcuts

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