ifacer

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 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

	//implements interface context
	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(imports []*types.Package) bool

func (*Ifacer) Process

func (f *Ifacer) Process() error

Process parsed template and formats and adjusts imports for the parsed content

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 file_dir.IfaceWriter) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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