Documentation
¶
Overview ¶
Package boot contains an extension of goyek.Main which additionally defines flags and configures the flow in a convenient way.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Main ¶
func Main()
Main is an extension of goyek.Main which additionally defines reusable flags and configures the flow with the most useful middlewares.
It automatically sets up:
- Colored output via color.ReportFlow and color.ReportStatus
- Standard middlewares (middleware.BufferParallel, middleware.SilentNonFailed, middleware.ReportLongRun)
- Command line flags for common options (-v, -dry-run, -long-run, etc.)
The command line syntax is: [tasks] [flags] [--] [args]
To add custom flags, define them before calling Main (see the example).
Example ¶
package main
import (
"flag"
"github.com/goyek/goyek/v3"
"github.com/goyek/x/boot"
)
var msg = flag.String("msg", "hello world", `message to display by "hi" task`)
var _ = goyek.Define(goyek.Task{
Name: "hi",
Usage: "Greetings",
Action: func(a *goyek.A) {
a.Log(*msg)
},
})
func main() {
boot.Main()
}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.