Documentation ¶
Index ¶
- type Context
- func (context *Context) Failed() int64
- func (context *Context) IncrementFailed() int64
- func (context *Context) IncrementSucceeded() int64
- func (context *Context) LogStats()
- func (context *Context) PathToJsonLog() string
- func (context *Context) PathToLogFile() string
- func (context *Context) Succeeded() int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Config *models.Config MessageLog *logging.Logger JsonLog *stdlog.Logger NSQClient *network.NSQClient PharosClient *network.PharosClient VolumeClient *network.VolumeClient // contains filtered or unexported fields }
Context sets up the items common to many of the bag processing services (bag_processor, bag_restorer, cleanup, etc.). It also encapsulates some functions common to all of those services.
func NewContext ¶
Creates and returns a new Context object. Because some items are absolutely required by this object and the processes that use it, this method will panic if it gets an invalid config param from the command line, or if it cannot set up some essential services, such as logging.
This object is meant to used as a singleton with any of the stand-along processing services (bag_processor, bag_restorer, cleanup, etc.).
func (*Context) IncrementFailed ¶
Increases the count of unsuccessfully processed items by one.
func (*Context) IncrementSucceeded ¶
Increases the count of successfully processed items by one.
func (*Context) LogStats ¶
func (context *Context) LogStats()
Logs info about the number of items that have succeeded and failed.
func (*Context) PathToJsonLog ¶
Returns the path to this process' JSON log file
func (*Context) PathToLogFile ¶
Returns the path to this process' log file