structure

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasOptionalTag

func HasOptionalTag(tags string) bool

Types

type Field

type Field struct {
	Name     string
	Exported bool
	Optional bool
}

type Fields

type Fields []*Field

func NewFields

func NewFields(strct *types.Struct) Fields

NewFields creates a new Fields from a given struct type. Fields items are listed in order they appear in the struct.

func (Fields) Skipped

func (sf Fields) Skipped(lit *ast.CompositeLit, onlyExported bool) Fields

Skipped returns a list of fields that are not present in the given literal, but expected to.

func (Fields) String

func (sf Fields) String() string

String returns a comma-separated list of field names.

type FieldsCache

type FieldsCache struct {
	// contains filtered or unexported fields
}

func (*FieldsCache) Get

func (c *FieldsCache) Get(typ *types.Struct) Fields

Get returns a struct fields for a given type. In case if a struct fields is not found, it creates a new one from type definition.

Jump to

Keyboard shortcuts

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