refiller

package module
v0.0.0-...-75258ed Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStructNotFound = errors.New("struct is not found")
	ErrNotStruct      = errors.New("not a struct")
	ErrInvalidTarget  = errors.New("invalid target")
)

Functions

func FindStructFromFile

func FindStructFromFile(file *ast.File, name string) (*ast.StructType, error)

func FindStructFromPackage

func FindStructFromPackage(pkg *ast.Package, name string) (*ast.StructType, error)

func FindStructFromPackages

func FindStructFromPackages(pkgs map[string]*ast.Package, name string) (*ast.StructType, error)

func Generate

func Generate(w io.Writer, packageName, dest, src string) error

Types

type Pair

type Pair struct {
	Dest string
	Src  string
}

func InspectPairs

func InspectPairs(destPath, destName, srcPath, srcName string) ([]*Pair, error)

func MakePairs

func MakePairs(dst, src *ast.StructType) []*Pair

type RenderArgs

type RenderArgs struct {
	Package  string
	Imports  []string
	DestType string
	DestName string
	SrcType  string
	SrcName  string
	Pairs    []*Pair
}

type Target

type Target struct {
	Package    string
	StructName string
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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