gen

package
v0.0.0-...-b05c880 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func FindAllDir

func FindAllDir(from string, m map[string]struct{})

Types

type GenCode

type GenCode struct {
	RootPath   string
	WorkPath   string
	PluginList PluginList
	// contains filtered or unexported fields
}

func (*GenCode) Init

func (code *GenCode) Init(workPath string)

func (*GenCode) PluginWork

func (code *GenCode) PluginWork(body, header *bytes.Buffer, spec *ast.TypeSpec, smTag string, path string, pkg string)

func (*GenCode) Register

func (code *GenCode) Register(Plugin Plugin)

func (*GenCode) Watch

func (code *GenCode) Watch()

func (*GenCode) Work

func (code *GenCode) Work(path string)

type Plugin

type Plugin interface {
	Tag() string
	Handle(writer *bytes.Buffer, imports *bytes.Buffer, spec *ast.TypeSpec, tag string, path string, pkg string)
}

type PluginList

type PluginList []Plugin

type SortPlugin

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

func NewSortPlugin

func NewSortPlugin() *SortPlugin

func (*SortPlugin) Handle

func (SortPlugin *SortPlugin) Handle(body *bytes.Buffer, imports *bytes.Buffer, spec *ast.TypeSpec, tag string, path string, pkg string)

func (*SortPlugin) Tag

func (SortPlugin *SortPlugin) Tag() string

type Watcher

type Watcher struct {
	Ignores  []*regexp.Regexp
	Root     string
	Callback func(string)
}

func (*Watcher) Ignore

func (Watcher *Watcher) Ignore(path string)

func (*Watcher) Init

func (watcher *Watcher) Init(Root string, callback func(string))

func (*Watcher) Loop

func (watcher *Watcher) Loop()

Jump to

Keyboard shortcuts

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