Documentation ¶
Index ¶
- func NewRedisConn(options Options) (redis.Conn, error)
- type Client
- func (c *Client) Ban(channels []string, host string, value []string) error
- func (c *Client) BanURL(channels []string, host string, value []string) error
- func (c *Client) Do(channels []string, req Request) error
- func (c *Client) Purge(channels []string, host string, value []string) error
- func (c *Client) Xkey(channels []string, host string, value []string) error
- func (c *Client) XkeySoft(channels []string, host string, value []string) error
- type Listener
- type Options
- type Request
- type RequestProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
Options Options
}
Client is the client used to connect to redis and send pubsub messages
type Listener ¶
type Listener struct {
Options Options
}
Listener is used to connect to redis pubsub and listen for incoming requests
func NewListener ¶
NewListener creates a new Listener instance
type Options ¶
type Options struct { Redis struct { URI string Password string Subscribe []string } Endpoint struct { URI string XkeyHeader string SoftXkeyHeader string BanHeader string BanURLHeader string } }
Options contains all settings read from the configuration file
type Request ¶
type Request struct { Host string `json:"host,omitempty"` Command string `json:"command"` Value []string `json:"value"` }
Request contains the purge message received from or sent to redis
func NewRequest ¶
NewRequest create a new Request instance
type RequestProcessor ¶
type RequestProcessor struct {
Config Options
}
RequestProcessor converts an incoming pubsub message on redis to a purge request to be sent to varnish
func NewRequestProcessor ¶
func NewRequestProcessor(options Options) *RequestProcessor
NewRequestProcessor creates a new RequestProcessor
func (*RequestProcessor) Process ¶
func (rp *RequestProcessor) Process(jsonInput string) error
Process parses the request and sends it to varnish
func (*RequestProcessor) Send ¶
func (rp *RequestProcessor) Send(req *Request) error
Send sends a purge request to varnish
Source Files ¶
Click to show internal directories.
Click to hide internal directories.