methodgenhelper

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteTemplate

func ExecuteTemplate(
	w io.Writer,
	templ *template.Template,
	packageName string,
	autoGenerationNotice string,
	tyInfo []any,
) (err error)

func GetMemberNames

func GetMemberNames(node *ast.StructType) []string

func ToAnySlice

func ToAnySlice[T any](sl []T) []any

Types

type TypeInfo

type TypeInfo struct {
	TypeName        string
	TypeParams      string
	InnerMemberName string
	StructTyp       *ast.StructType
}

func ParseDir

func ParseDir(
	dir string,
	targetTypeName []string,
	ignoreList []string,
) (typeInfos []TypeInfo, packageName string, err error)

func ParseTypeInfo

func ParseTypeInfo(
	fset *token.FileSet,
	direntName string,
	file io.Reader,
	targetTypeName []string,
) (typeInfos []TypeInfo, packageName string, err error)

ParseTypeInfo traverse through ast of a given file and retrieves TypeInfo that matches to targetTyName.

Jump to

Keyboard shortcuts

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