Documentation
¶
Index ¶
- Variables
- func Print(kind printKind, v interface{})
- func Printf(kind printKind, format string, args ...interface{})
- func Println(kind printKind, v interface{})
- func Sprint(kind printKind, args ...interface{}) string
- func Sprintf(kind printKind, format string, args ...interface{}) string
- type Config
- type GenerationFlow
- type GeneratorPool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFileOutOfBasePath = errors.New("result file out of base path") // This error used when we generate not main.go files without _gen.go or _gen_test.go postfix. ErrResultFileWithoutGenPostfix = errors.New("result file without specific gen postfix") )
Functions ¶
func Print ¶
func Print(kind printKind, v interface{})
Println prints some value to stdout using coloring driven by kind.
func Printf ¶
func Printf(kind printKind, format string, args ...interface{})
Printf formats given string with parameters and after calls Println with a result of formatting.
Types ¶
type Config ¶
type Config struct {
Files []struct {
Path string `json:"path"`
RepoWithQuery string `json:"repository"`
Params json.RawMessage `json:"params"`
} `json:"files"`
}
It is a general config structure which is represents parsed gen.json file.
type GenerationFlow ¶
type GenerationFlow interface {
Run() error
}
GenerationFlow declare basic generation flow.
func NewBasicGenerationFlow ¶
func NewBasicGenerationFlow(cfg *Config, currentDir string, genPool GeneratorPool) GenerationFlow
Returns new basic generation flow.
type GeneratorPool ¶
It is an interface which real generator pool holder must implement.
func BuildGeneratorPool ¶
func BuildGeneratorPool(cfg *Config, gopath string) (_ GeneratorPool, err error)
Returns new GeneratorPool implementation with necessary generators. Returns non nil error when something went wrong. All generators in output GeneratorPool already initialized and ready to use.
Click to show internal directories.
Click to hide internal directories.