ifacer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ifacer

type Ifacer struct {
	IfaceName string

	StructName string

	IfacePath string

	PackageName string

	Methods []Method

	Content string

	Star string

	OutFile string

	UsingImportStr string
	// contains filtered or unexported fields
}

func NewIfacer added in v0.0.7

func NewIfacer(options ...Option) *Ifacer

func (*Ifacer) GenMethods

func (f *Ifacer) GenMethods(interacer *types.Interface)

func (*Ifacer) ManageNoConflictImport

func (f *Ifacer) ManageNoConflictImport(imps []*types.Package) bool

func (*Ifacer) Process

func (f *Ifacer) Process() error

Process 解析模板并美化.

func (*Ifacer) Run

func (f *Ifacer) Run(v *viper.Viper) error

type Method

type Method struct {
	FuncName string

	ArgStr string

	ReturnTypeStr string

	ReturnStr string

	InitReturnVarStr string

	ReturnVar []string
}

type Option added in v0.0.7

type Option func(*Ifacer)

func WithIfacerLogger added in v0.0.7

func WithIfacerLogger(logger log.Logger) Option

func WithIfacerTpl added in v0.0.7

func WithIfacerTpl(tpl templates.Tpl) Option

func WithIfacerWriter added in v0.0.7

func WithIfacerWriter(writer filedir.IfaceWriter) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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