code

package
v0.0.0-...-c955e10 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Caster

type Caster interface {
	Expr(arg dst.Expr) dst.Expr
}

type CommentedMapExpr

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

func (CommentedMapExpr) Comment

func (c CommentedMapExpr) Comment() (string, bool)

func (CommentedMapExpr) Dest

func (c CommentedMapExpr) Dest() string

func (CommentedMapExpr) DstExpr

func (c CommentedMapExpr) DstExpr(_ string) (dst.Expr, bool)

func (CommentedMapExpr) Src

func (c CommentedMapExpr) Src() string

type File

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

func LoadFile

func LoadFile(filePath, pkgPath string) (*File, error)

func NewFile

func NewFile(pkgPath string) *File

func (*File) Attach

func (f *File) Attach(inpFn *Func, mode Mode) error

func (*File) FindFunc

func (f *File) FindFunc(name string) (idx int, fn *Func, ok bool)

func (*File) Write

func (f *File) Write(w io.Writer) error

type Func

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

func NewFuncFromMapping

func NewFuncFromMapping(m *mapping.Mapping, opt *FuncOption) *Func

func (Func) Decl

func (f Func) Decl() (*dst.FuncDecl, error)

func (Func) FillMapExprs

func (f Func) FillMapExprs(x *Func) (*Func, error)

func (Func) Name

func (f Func) Name() string

type FuncCallCaster

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

func (FuncCallCaster) Expr

func (c FuncCallCaster) Expr(arg dst.Expr) dst.Expr

type FuncOption

type FuncOption struct {
	Name                 string
	NameTemplate         *template.Template
	Private              bool
	ArgName              string
	FuncComment          bool
	NoMapperFieldComment bool
	Editable             bool
}

type MapExpr

type MapExpr interface {
	Src() string
	Dest() string
	DstExpr(arg string) (dst.Expr, bool)
	Comment() (string, bool)
}

type MapExprList

type MapExprList []MapExpr

func (MapExprList) DstExprs

func (mel MapExprList) DstExprs(arg string) (exprs []dst.Expr, startComments []string)

func (MapExprList) SeparateCommented

func (mel MapExprList) SeparateCommented() (normal, commented MapExprList)

type Mode

type Mode int
const (
	PrioritizeGenerated Mode = iota
	PrioritizeExisted
	Deterministic
)

type SimpleMapExpr

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

func (SimpleMapExpr) Comment

func (e SimpleMapExpr) Comment() (string, bool)

func (SimpleMapExpr) Dest

func (e SimpleMapExpr) Dest() string

func (SimpleMapExpr) DstExpr

func (e SimpleMapExpr) DstExpr(arg string) (dst.Expr, bool)

func (SimpleMapExpr) Src

func (e SimpleMapExpr) Src() string

type Typ

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

func (Typ) Equal

func (t Typ) Equal(x *Typ) bool

type TypeCaster

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

func (TypeCaster) Expr

func (t TypeCaster) Expr(arg dst.Expr) dst.Expr

type UnaryCaster

type UnaryCaster byte

func (UnaryCaster) Expr

func (u UnaryCaster) Expr(arg dst.Expr) dst.Expr

type UnknownMapExpr

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

func (UnknownMapExpr) Comment

func (e UnknownMapExpr) Comment() (string, bool)

func (UnknownMapExpr) Dest

func (e UnknownMapExpr) Dest() string

func (UnknownMapExpr) DstExpr

func (e UnknownMapExpr) DstExpr(_ string) (dst.Expr, bool)

func (UnknownMapExpr) Src

func (e UnknownMapExpr) Src() string

Jump to

Keyboard shortcuts

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