Documentation ¶
Index ¶
- Variables
- func BuildTool(d *Descriptor) *cli.App
- func CliFunc(d *Descriptor, a Action) func(*cli.Context) error
- func GoImports(c *Context, target string) error
- func InstallTool(c *Context, name, source string) (string, error)
- func Start(d *Descriptor)
- type Action
- type Actions
- type BuildVars
- type Command
- type Commander
- type Context
- type Descriptor
- type DotEnv
- type EnvLoader
- type Environment
- type GoBuild
- type GoTest
- type LogHeader
- type Logger
- type MockCommand
- type MockCommandRunner
- type NewAction
- type RunBinary
- type Task
- type TaskNames
- type Tasker
Constants ¶
This section is empty.
Variables ¶
var ( // ProjectName of application. ProjectName string // ProjectVersion of applicatoin. ProjectVersion string )
only available in project scope as supplied when compile using typgo.GoBuild or ldflags
var ( // ProjectPkg only available in BuildTool scope. The BuildTool must be compiled by wrapper. ProjectPkg string // TypicalTmp only available in BuildTool scope. The BuildTool must be compiled by wrapper. TypicalTmp string )
only available in build-tool scope
var ColorSet = struct { Project color.Attribute Task color.Attribute Command color.Attribute Warn color.Attribute }{ Project: color.FgHiCyan, Task: color.FgCyan, Command: color.FgGreen, Warn: color.FgYellow, }
ColorSet color set
Functions ¶
func CliFunc ¶
func CliFunc(d *Descriptor, a Action) func(*cli.Context) error
CliFunc return urfave cli function from Action
func InstallTool ¶ added in v0.10.3
InstallTool install tool to typical-tmp folder
Types ¶
type Command ¶ added in v0.10.0
type Command struct { Name string Args []string Stdout io.Writer Stderr io.Writer Stdin io.Reader Dir string Env []string }
Command is wrapper to exec.Command
func CommandLine ¶ added in v0.11.6
CommandLine create bash command line
type Context ¶
type Context struct { *cli.Context Logger Descriptor *Descriptor // contains filtered or unexported fields }
Context related with build task
func NewContext ¶ added in v0.11.1
func NewContext(c *cli.Context, d *Descriptor) *Context
NewContext return instance of context
func (*Context) ExecuteCommand ¶ added in v0.11.6
Execute command
func (*Context) ExecuteCommandLine ¶ added in v0.11.6
ExecuteCommandLine execute bash command
type Descriptor ¶
type Descriptor struct { ProjectName string // By default is same with project folder. Only allowed characters(a-z,A-Z), underscore or dash. ProjectVersion string // By default it is 0.0.1 Environment EnvLoader Tasks []Tasker Stdout io.Writer }
Descriptor describe the project
type Environment ¶ added in v0.11.3
Environment variable
type GoBuild ¶ added in v0.10.17
type GoBuild struct { MainPackage string // By default is "cmd/PROJECT_NAME" Output string // By default is "bin/PROJECT_NAME" // By default is set variable typgo.ProjectName to PROJECT_NAME // and typgo.ProjectVersion to PROJECT-VERSION Ldflags fmt.Stringer }
GoBuild command
type GoTest ¶ added in v0.10.17
type GoTest struct { Timeout time.Duration NoCover bool Verbose bool Includes []string Excludes []string }
GoTest command test
type LogHeader ¶ added in v0.11.4
func LogHeaders ¶ added in v0.11.4
type Logger ¶ added in v0.11.3
Logger logger
type MockCommand ¶ added in v0.11.6
type MockCommand struct { CommandLine string OutputBytes []byte ErrorBytes []byte ReturnError error }
MockCommand is test expectation
type MockCommandRunner ¶ added in v0.11.6
type MockCommandRunner struct { Mocks []*MockCommand Ptr int }
MockCommandRunner mocking bash
func (*MockCommandRunner) Close ¶ added in v0.11.6
func (r *MockCommandRunner) Close() error
Close mocker
func (*MockCommandRunner) Expectation ¶ added in v0.11.6
func (r *MockCommandRunner) Expectation() *MockCommand
Expectation for bash
func (*MockCommandRunner) Run ¶ added in v0.11.6
func (r *MockCommandRunner) Run(bash *Command) error
Run bash
type RunBinary ¶ added in v0.10.17
RunBinary standard run
type Task ¶ added in v0.10.17
type Task struct { Name string Aliases []string Usage string Flags []cli.Flag SkipFlagParsing bool Action Action Before Action SubTasks []*Task }
Task to run action
func (*Task) CliCommand ¶ added in v0.11.1
func (t *Task) CliCommand(d *Descriptor) *cli.Command
CliCommand return cli command from task