struc

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const KeyValueSeparator = ":"
View Source
const ListValuesSeparator = ","
View Source
const ReplaceableValueSeparator = "="

Variables

This section is empty.

Functions

func FindTypePackageFile added in v0.0.2

func FindTypePackageFile(typeName string, fileSet *token.FileSet, pkgs c.ForLoop[*packages.Package]) (*types.Named, *packages.Package, *ast.File, error)

func GetStructType

func GetStructType(t types.Type) (*types.Struct, int)

func GetStructTypeNamed

func GetStructTypeNamed(typ types.Type) (*types.Named, int)

func GetTypeNamed

func GetTypeNamed(typ types.Type) (*types.Named, int)

func ObjectString

func ObjectString(obj types.Object, outPkgPath string) string

func TypeString

func TypeString(typ types.Type, outPkgPath string) string

Types

type FieldName

type FieldName = string

type FieldType

type FieldType struct {
	Embedded       bool
	RefCount       int
	Name, FullName string
	Model          *Model
	Type           types.Type
}

type Model

type Model struct {
	Typ            *types.Named
	TypeName       string
	RefCount       int
	Package        Package
	OutPkgPath     string
	FieldsTagValue map[FieldName]map[TagName]TagValue
	TagsFieldValue map[TagName]map[FieldName]TagValue
	FieldNames     []FieldName
	FieldsType     map[FieldName]FieldType
}

Model struct type model.

func New

func New(outPkgPath string, structType *types.Named, typePkg Package) (*Model, error)

New - Model's default constructor.

type Package

type Package struct{ Name, Path string }

type TagName

type TagName = string

type TagValue

type TagValue = string

Jump to

Keyboard shortcuts

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