maker

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Maker

type Maker struct {
	// StructName is the name of the struct from which to generate an interface.
	StructName string
	// If CopyDocs is true, doc comments will be copied to the generated interface.
	CopyDocs bool
	// contains filtered or unexported fields
}

Maker generates interfaces from structs.

func (*Maker) AddImport

func (m *Maker) AddImport(alias, path string)

func (*Maker) GetGoFiles

func (m *Maker) GetGoFiles(paths ...string) (allFiles []string, err error)

func (*Maker) MakeInterface

func (m *Maker) MakeInterface(pkgName, ifaceName string) ([]byte, error)

MakeInterface creates the go file with the generated interface. The package will be named pkgName, and the interface will be named ifaceName.

func (*Maker) OmitGeneratedComment

func (m *Maker) OmitGeneratedComment()

func (*Maker) ParseDeclarations

func (m *Maker) ParseDeclarations(src []byte, filename string) (declarations map[string]int32, err error)

ParseSource parses the source code in src. filename is used for position information only.

func (*Maker) ParseFiles

func (m *Maker) ParseFiles(files ...string) error

func (*Maker) ParseSource

func (m *Maker) ParseSource(src []byte, filename string) error

ParseSource parses the source code in src. filename is used for position information only.

func (*Maker) ReadStructs

func (m *Maker) ReadStructs(files ...string) (allStructs map[string]int32, err error)

func (*Maker) SourcePackage

func (m *Maker) SourcePackage(p string)

Jump to

Keyboard shortcuts

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