Documentation
¶
Index ¶
- type DBOptions
- type Info
- type NewRunner
- type NilValidator
- type Runner
- type Starter
- func (tm *Starter) AppOpt() interface{}
- func (tm *Starter) Description(description string) *Starter
- func (tm *Starter) HandleRequest(w http.ResponseWriter, r *http.Request)
- func (tm *Starter) Initialize() *Starter
- func (tm *Starter) NewConsumer() bus.Consumer
- func (tm *Starter) NewProducer() bus.Producer
- func (tm *Starter) Run()
- func (tm *Starter) SetHandler(fn func(http.ResponseWriter, *http.Request))
- func (tm *Starter) Version(version string) *Starter
- type Utility
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBOptions ¶
type DBOptions struct {
Username string `toml:"username" commented:"true"`
Password string `toml:"password" commented:"true"`
Host string `toml:"host" comment:"host can be 'host:port', 'host', 'host:' or ':port'"`
DBName string `toml:"dbname"`
Serializable bool `toml:"serializable" comment:"set isolation level to serializable, required for proper writing to database" commented:"true"`
SSLMode string `toml:"sslmode" comment:"default is disable, use require for ssl"`
SSLCert string `toml:"sslcert"`
SSLKey string `toml:"sslkey"`
SSLRootcert string `toml:"sslrootcert"`
}
type Info ¶ added in v0.2.0
type Info struct {
AppName string `json:"app_name"`
Version string `json:"version"`
LauncherStats task.LauncherStats `json:"launcher,omitempty"`
}
type NilValidator ¶
type NilValidator struct{}
NilValidator satisfies the Validator interface but does nothing.
func (*NilValidator) Validate ¶
func (v *NilValidator) Validate() error
type Starter ¶ added in v0.29.0
type Starter struct {
Utility
StatusPort int `toml:"status_port" comment:"http service port for request health status"`
// options
BusOpt *bus.Options `toml:"bus"`
LauncherOpt *task.LauncherOptions `toml:"launcher"`
// contains filtered or unexported fields
}
func NewTaskMaster ¶ added in v0.2.0
NewTaskMaster will create a new taskmaster bootstrap application. *appName: defines the taskmaster name; acts as a name for identification and easy-of-use (required) *mkr: MakeWorker function that the launcher will call to create a new worker. *options: a struct pointer to additional specific application options. Note that the bootstrapped WorkerApp already provides bus and launcher options
func NewWorkerApp ¶
NewWorkerApp will create a new worker bootstrap application. *tskType: defines the worker type; the type of tasks the worker is expecting. Also acts as a name for identification (required) *mkr: MakeWorker function that the launcher will call to create a new worker. *options: a struct pointer to additional specific application options. Note that the bootstrapped Worker already provides bus and launcher options
func (*Starter) Description ¶ added in v0.29.0
Description allows the user to set a description of the worker that will be shown with the help screen.
The description should also include information about what the worker expects from the NewWorker 'info' string.
func (*Starter) HandleRequest ¶ added in v0.29.0
func (tm *Starter) HandleRequest(w http.ResponseWriter, r *http.Request)
HandleRequest is a simple http handler function that takes the compiled status functions that are called and the results marshaled to return as the body of the response
func (*Starter) Initialize ¶ added in v0.29.0
Initialize is non-blocking and will perform application startup tasks such as: *Parsing and handling flags *Parsing and validating the options file *Setting options defaults
Note that start will handle application closure if there was an error during startup or a flag option was provided that asked the application to show the version, for example. So, if start is able to finish by returning, the user knows it is safe to move on.
func (*Starter) NewConsumer ¶ added in v0.29.0
NewConsumer is a convenience method that will use the bus options information to create a new consumer instance. Can optionally provide a topic and channel on which to consume. All other bus options are the same.
func (*Starter) NewProducer ¶ added in v0.29.0
NewProducer will use the bus options information to create a new producer instance.
func (*Starter) Run ¶ added in v0.29.0
func (tm *Starter) Run()
Run until the application is complete and then exit.
func (*Starter) SetHandler ¶ added in v0.29.0
func (tm *Starter) SetHandler(fn func(http.ResponseWriter, *http.Request))
SetHandler will overwrite the current HandleRequest function on root requests
type Utility ¶ added in v0.2.0
type Utility struct {
// contains filtered or unexported fields
}