gen

package
v0.0.0-...-4c599b4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Process

func Process(opts *Option) error

Process takes a list of options and generate codes based on those options.

Types

type Data

type Data struct {
	TypeName    string
	Package     string
	PackageName string
	Methods     []*Method
	Imports     []*Import
}

Data includes data for templates.

type DataParser

type DataParser interface {
	Parse([]*packages.Package) (*Data, error)
}

type Field

type Field struct {
	Name string
	Type string
}

Field presents a field.

type Generator

type Generator interface {
	Generate(writer io.Writer, data *Data) error
}

type Import

type Import struct {
	Path string
	Name string
}

type Method

type Method struct {
	Name    string
	Params  []*Field
	Results []*Field
}

Method presents a method.

type Option

type Option struct {
	TemplateFile string
	TemplateName string
	Identifier   string
	Dir          string
	Output       string
}

Option includes golang options

Jump to

Keyboard shortcuts

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