internal

package
v0.0.0-...-0425162 Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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.

func Println

func Println(kind printKind, v interface{})

Println prints some value to stdout using coloring driven by kind.

func Sprint

func Sprint(kind printKind, args ...interface{}) string

func Sprintf

func Sprintf(kind printKind, format string, args ...interface{}) string

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

type GeneratorPool interface {
	Get(repoWithQuery string) pkg.Generator
	Close()
}

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.

Jump to

Keyboard shortcuts

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