Documentation ¶
Index ¶
- type Maker
- func (m *Maker) AddImport(alias, path string)
- func (m *Maker) GetGoFiles(paths ...string) (allFiles []string, err error)
- func (m *Maker) MakeInterface(pkgName, ifaceName string) ([]byte, error)
- func (m *Maker) OmitGeneratedComment()
- func (m *Maker) ParseDeclarations(src []byte, filename string) (declarations map[string]int32, err error)
- func (m *Maker) ParseFiles(files ...string) error
- func (m *Maker) ParseSource(src []byte, filename string) error
- func (m *Maker) ReadStructs(files ...string) (allStructs map[string]int32, err error)
- func (m *Maker) SourcePackage(p string)
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) GetGoFiles ¶
func (*Maker) MakeInterface ¶
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 (*Maker) ParseSource ¶
ParseSource parses the source code in src. filename is used for position information only.
func (*Maker) ReadStructs ¶
func (*Maker) SourcePackage ¶
Click to show internal directories.
Click to hide internal directories.