common

package
v0.0.0-...-dbc791b Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSVMain

func CSVMain(csvGenerateHelper CSVGenerateHelper)

CSVMain is the main function for csv commands.

func Main

func Main(generateHelper GenerateHelper)

Main is the main function for commands.

Types

type CSVGenerateEnv

type CSVGenerateEnv struct {
	GenerateEnv
	// relative to RepoDir
	CSVFile string `env:"CSV_FILE"`
}

CSVGenerateEnv is the environment for CSVGenerators.

type CSVGenerateHelper

type CSVGenerateHelper interface {
	GenerateHelper
	TmplData(records [][]string) (interface{}, error)
}

CSVGenerateHelper does stuff for CSVGenerators.

type GenerateEnv

type GenerateEnv struct {
	// must be absolute path
	RepoDir string `env:"REPO_DIR"`
	// relative to RepoDir
	TmplDir string `env:"TMPL_DIR"`
	// relative to RepoDir/TmplDir, comma separated
	GoTmplFiles string `env:"GO_TMPL_FILES"`
	// relative to RepoDir/TmplDir, comma separated
	PbTmplFiles string `env:"PB_TMPL_FILES"`
}

GenerateEnv is the environment for Generators.

type GenerateHelper

type GenerateHelper interface {
	ExtraTmplFuncs() map[string]interface{}
}

GenerateHelper does stuff for Generators.

type TmplData

type TmplData struct {
	// either proto, go, or gogo
	Type string
	// The data from the GenerateHelper
	Data interface{}
}

TmplData is what is passed into the template.

Jump to

Keyboard shortcuts

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