Documentation ¶
Index ¶
Constants ¶
const TYPE = "job-logger"
Type is a short name for the middleware
Variables ¶
This section is empty.
Functions ¶
func CliFlags ¶
CliFlags will be used by Vulcand construct help and CLI command for the vctl command
func FromCli ¶
func FromCli(context *cli.Context) (plugin.Middleware, error)
FromCli constructs the middleware from the command line
func FromOther ¶
func FromOther(middleware Middleware) (plugin.Middleware, error)
FromOther Will be called by Vulcand when engine or API will read the middleware from the serialized format. It's important that the signature of the function will be exactly the same, otherwise Vulcand will fail to register this middleware. The first and the only parameter should be the struct itself, no pointers and other variables. Function should return middleware interface and error in case if the parameters are wrong.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler implements http.Handler
func NewHandler ¶
func NewHandler(conn *connection.Connection, backendID string, next http.Handler) *Handler
NewHandler constructs a new handler
type Middleware ¶
type Middleware struct {
BackendID, RedisURI, RedisQueueName string
Conn *connection.Connection
}
Middleware is a vulcand middleware that logs to redis
func NewMiddleware ¶
func NewMiddleware(RedisURI, RedisQueueName, BackendID string) (*Middleware, error)
NewMiddleware constructs new Middleware instances
func (*Middleware) NewHandler ¶
NewHandler returns a new Handler instance
func (*Middleware) String ¶
func (middleware *Middleware) String() string
String will be called by loggers inside Vulcand and command line tool.