pkg

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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WireCmd = "wire"

	MockeryCmd = "mockery"

	LintCmd = "lint"

	GolangCiLintCmd = "golangci-lint"
)

Variables

View Source
var ZoreTime = time.Time{}

Functions

func DirPathToImportPath

func DirPathToImportPath(dirPath string) string

./a/b/c/ => /a/b/c.

func ParseExpr

func ParseExpr(expr ast.Expr, fileContent string) string

Types

type CmdExec

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

func (*CmdExec) ExecBuild added in v0.0.7

func (ce *CmdExec) ExecBuild(dir string, args ...string) error

func (*CmdExec) ExecFmt

func (ce *CmdExec) ExecFmt(dir string, args ...string) error

func (*CmdExec) ExecLint added in v0.1.2

func (ce *CmdExec) ExecLint(dir string, args ...string) error

func (*CmdExec) ExecMock added in v0.1.2

func (ce *CmdExec) ExecMock(dir string, args ...string) error

func (*CmdExec) ExecTest added in v0.1.1

func (ce *CmdExec) ExecTest(dir string, args ...string) error

func (*CmdExec) ExecWire

func (ce *CmdExec) ExecWire(dir string, args ...string) error

type CmdExecOption added in v0.1.1

type CmdExecOption func(*CmdExec)

func WithCmdExecLogger added in v0.1.1

func WithCmdExecLogger(logger log.Logger) CmdExecOption

type Exec

type Exec interface {
	ExecWire(string, ...string) error

	ExecFmt(string, ...string) error

	ExecTest(string, ...string) error

	ExecBuild(string, ...string) error

	ExecMock(string, ...string) error

	ExecLint(string, ...string) error
}

func NewCmdExec

func NewCmdExec(options ...CmdExecOption) Exec

func NewNullExec

func NewNullExec() Exec

type Field

type Field struct {
	Name string

	Type string

	TypeName string

	// Name + type or type.
	Field string

	Size int

	Doc []string

	Tag string
}

Struct field.

type Fields

type Fields []Field

func (Fields) Len

func (fs Fields) Len() int

func (Fields) Less

func (fs Fields) Less(i, j int) bool

func (*Fields) ParseFromAst

func (fs *Fields) ParseFromAst(genDecl *ast.GenDecl, fileContent string)

func (Fields) String

func (fs Fields) String() (string, error)

func (Fields) Swap

func (fs Fields) Swap(i, j int)

type Import

type Import struct {
	Name string

	Path string

	Doc []string
}

type Imports

type Imports []Import

func (Imports) Len

func (is Imports) Len() int

func (*Imports) ParseFromAst

func (is *Imports) ParseFromAst(genDecl *ast.GenDecl)

func (Imports) String

func (is Imports) String() string

type NullExec

type NullExec struct{}

func (*NullExec) ExecBuild added in v0.0.7

func (ce *NullExec) ExecBuild(dir string, args ...string) error

func (*NullExec) ExecFmt

func (ce *NullExec) ExecFmt(dir string, args ...string) error

func (*NullExec) ExecLint added in v0.1.2

func (ce *NullExec) ExecLint(dir string, args ...string) error

func (*NullExec) ExecMock added in v0.1.2

func (ce *NullExec) ExecMock(dir string, args ...string) error

func (*NullExec) ExecTest added in v0.1.1

func (ce *NullExec) ExecTest(dir string, args ...string) error

func (*NullExec) ExecWire

func (ce *NullExec) ExecWire(dir string, args ...string) error

type Var

type Var struct {
	Doc []string

	// name and val
	Body string

	Name []string

	// now is empty
	Val []string
}

type Vars

type Vars []Var

func (Vars) Len

func (vs Vars) Len() int

func (*Vars) ParseFromAst

func (vs *Vars) ParseFromAst(genDecl *ast.GenDecl, src string)

func (Vars) String

func (vs Vars) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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