Documentation ¶
Index ¶
- Constants
- Variables
- func AddCommand(sub *Command)
- func Ensure(err error)
- func OnClose(fn func())
- func OnInit(fn func() error)
- func Path() string
- func Run(s Server, signals ...os.Signal)
- func RunFunc(runner ServeFunc, closer CloseFunc, signals ...os.Signal)
- func Start()
- type CloseFunc
- type Command
- type CommandSet
- type Context
- type Error
- type ServeFunc
- type Server
Constants ¶
View Source
const PkgName = "auxo.app"
Variables ¶
View Source
var ( // Version is the version of application Version string // SCMRevision is commit hash of source tree SCMRevision string // SCMBranch is current branch name the code is built off SCMBranch string // BuildTime is RFC3339 formatted UTC date, e.g. 2017-12-01T13:04:23Z BuildTime string )
View Source
var ( // Timeout is the amount of time allowed to wait graceful shutdown. Timeout = time.Second * 30 )
Functions ¶
func AddCommand ¶
func AddCommand(sub *Command)
func OnInit ¶
func OnInit(fn func() error)
OnInit register an initializer which execute on app start. If fn return an error, the app will panic.
Types ¶
type Command ¶
type Command struct { Name string Desc string Action func(ctx *Context) error Flags *flag.Set // contains filtered or unexported fields }
func (*Command) AddCommand ¶
type CommandSet ¶
func (CommandSet) Add ¶
func (cs CommandSet) Add(cmd *Command)
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.