Documentation ¶
Overview ¶
Logger is a simple logging interface.
Index ¶
- Variables
- func NewRunner(interval time.Duration) runner
- func SetLoggerOutput(l Logger, w io.Writer)
- type Batch
- type BatchFinder
- type BatchProcessor
- type BatchSender
- type Event
- type HttpBatchSender
- type Logger
- func (l Logger) Error(messages ...interface{})
- func (l Logger) Errorf(str string, messages ...interface{})
- func (l Logger) Info(messages ...interface{})
- func (l Logger) Infof(str string, messages ...interface{})
- func (l Logger) Notice(messages ...interface{})
- func (l Logger) Noticef(str string, messages ...interface{})
- func (l Logger) Warning(messages ...interface{})
- func (l Logger) Warningf(str string, messages ...interface{})
- type ReadyFinder
- type RedisBatchFinder
- type RedisBatchProcessor
- type RedisReadyFinder
- type RedisSubFinder
- type Sub
- type SubFinder
Constants ¶
This section is empty.
Variables ¶
var (
Redis *redis.Client
)
Functions ¶
func SetLoggerOutput ¶
Types ¶
type Batch ¶
type Batch struct { DomainId string `json:"domain_id"` Timestamp string `json:"-"` StartedAt time.Time `json:"-"` Events []Event `json:"events"` }
Batch represents a group of events that occurred in a given timeperiod for a domain
func (Batch) BlankClone ¶
type BatchFinder ¶
BatchFinder is responsible for returning batches ready to process.
type BatchProcessor ¶
BatchProcessor is responsible for the processing of batches to their subs.
type BatchSender ¶
BatchSender is responsible for sending a batch to a sub.
type HttpBatchSender ¶
type HttpBatchSender struct{}
func (HttpBatchSender) Retry ¶
func (s HttpBatchSender) Retry(batch Batch, sub Sub)
Fail is responsible for placing the batch sub combo into failed state and setting retry count, time etc.
func (HttpBatchSender) Send ¶
func (s HttpBatchSender) Send(batch Batch, sub Sub)
Send will submit the batch to the given sub according to the sub configuration. Anything which is considered an error at the client end shall return false, nil Anything which is an error at the server end shall return true, err
type ReadyFinder ¶
type RedisBatchFinder ¶
type RedisBatchFinder struct {
// contains filtered or unexported fields
}
func (RedisBatchFinder) ReadyBatchKeys ¶
func (f RedisBatchFinder) ReadyBatchKeys() ([]Batch, error)
ReadyBatches returns an batches over a minute old from Redis.
type RedisBatchProcessor ¶
type RedisBatchProcessor struct { }
func (RedisBatchProcessor) PersistBatch ¶
func (RedisBatchProcessor) ProcessBatch ¶
func (p RedisBatchProcessor) ProcessBatch(batch Batch) error
ProcessBatch gets any subs from redis, and sends the batch to the sub.
type RedisReadyFinder ¶
type RedisReadyFinder struct{}
func (RedisReadyFinder) BatchSubFromKey ¶
func (f RedisReadyFinder) BatchSubFromKey(key string) (*Batch, *Sub, error)
func (RedisReadyFinder) ProcessReadyRetries ¶
func (f RedisReadyFinder) ProcessReadyRetries() (int, error)
type RedisSubFinder ¶
type RedisSubFinder struct { }