ifacer

package
v0.0.0-...-6d34543 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 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

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 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

type Option func(*Ifacer)

func WithIfacerLogger

func WithIfacerLogger(logger log.Logger) Option

func WithIfacerTpl

func WithIfacerTpl(tpl templates.Tpl) Option

func WithIfacerWriter

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