utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllTypes

func GetAllTypes(sourceTypes []*types.TypeName, maxDepth int64) ([]*types.TypeName, error)

func GetStructDefinition

func GetStructDefinition(typeName *types.TypeName) (types.Type, error)

GetStructDefinition retrieves the struct definition for a given type name. For that it needs to load the package.

func Parse

func Parse(sourceTypePath string) (*types.TypeName, error)

Parse parses a source type path (examples: "github.com/antoninferrand/pergolator/tests/basic.Struct", "http/http.Request") and returns a types.TypeName.

func ParseAll

func ParseAll(sourceTypePaths ...string) ([]*types.TypeName, error)

ParseAll parses all source type paths (examples: "github.com/antoninferrand/pergolator/tests/basic.Struct", "http/http.Request") and returns a slice of types.TypeName.

Types

type FieldOptions

type FieldOptions struct {
	Aliases []string
	Flatten bool
}

type FieldOptionsGetter

type FieldOptionsGetter func(typeName *types.TypeName, field *types.Var, unparsedTag string) FieldOptions

func GetTagGetter

func GetTagGetter(descriptorPath string, renameFieldsToSnakeCase bool) (FieldOptionsGetter, error)

Jump to

Keyboard shortcuts

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