Documentation ¶
Index ¶
- Variables
- func NewConsulPipeRouter(client ConsulClient, prefix, advertise string, userIDer UserIDer) app.PipeRouter
- func NewSQSControlRouter(config *aws.Config, userIDer UserIDer, prefix string) app.ControlRouter
- func NoopUserIDer(context.Context) (string, error)
- type AWSCollector
- type AWSCollectorConfig
- type BillingEmitter
- type BillingEmitterConfig
- type CASCallback
- type ConsulClient
- type MemcacheClient
- type MemcacheConfig
- type ReportStore
- type S3Store
- type UserIDer
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is returned by ConsulClient.Get ErrNotFound = fmt.Errorf("Not found") )
var ErrUserIDNotFound = fmt.Errorf("User ID not found")
ErrUserIDNotFound should be returned by a UserIDer when it fails to ID the user for a request.
Functions ¶
func NewConsulPipeRouter ¶
func NewConsulPipeRouter(client ConsulClient, prefix, advertise string, userIDer UserIDer) app.PipeRouter
NewConsulPipeRouter returns a new consul based router
func NewSQSControlRouter ¶
NewSQSControlRouter the harbinger of death
Types ¶
type AWSCollector ¶ added in v0.16.1
AWSCollector is a Collector which can also CreateTables
func NewAWSCollector ¶ added in v0.16.1
func NewAWSCollector(config AWSCollectorConfig) (AWSCollector, error)
NewAWSCollector the elastic reaper of souls https://github.com/aws/aws-sdk-go/wiki/common-examples
type AWSCollectorConfig ¶ added in v0.16.1
type AWSCollectorConfig struct { UserIDer UserIDer DynamoDBConfig *aws.Config DynamoTable string S3Store *S3Store NatsHost string MemcacheClient *MemcacheClient Window time.Duration }
AWSCollectorConfig has everything we need to make an AWS collector.
type BillingEmitter ¶ added in v1.3.0
type BillingEmitter struct { app.Collector BillingEmitterConfig // contains filtered or unexported fields }
BillingEmitter is the billing emitter
func NewBillingEmitter ¶ added in v1.3.0
func NewBillingEmitter(upstream app.Collector, billingClient *billing.Client, cfg BillingEmitterConfig) (*BillingEmitter, error)
NewBillingEmitter changes a new billing emitter which emits billing events
func (*BillingEmitter) Close ¶ added in v1.3.0
func (e *BillingEmitter) Close() error
Close shuts down the billing emitter and billing client flushing events.
type BillingEmitterConfig ¶ added in v1.3.0
BillingEmitterConfig has everything we need to make a billing emitter
func (*BillingEmitterConfig) RegisterFlags ¶ added in v1.3.0
func (cfg *BillingEmitterConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags registers the billing emitter flags with the main flag set.
type CASCallback ¶
CASCallback is the type of the callback to CAS. If err is nil, out must be non-nil.
type ConsulClient ¶
type ConsulClient interface { Get(key string, out interface{}) error CAS(key string, out interface{}, f CASCallback) error WatchPrefix(prefix string, out interface{}, done chan struct{}, f func(string, interface{}) bool) }
ConsulClient is a high-level client for Consul, that exposes operations such as CAS and Watch which take callbacks. It also deals with serialisation.
func NewConsulClient ¶
func NewConsulClient(addr string) (ConsulClient, error)
NewConsulClient returns a new ConsulClient
type MemcacheClient ¶ added in v0.16.1
type MemcacheClient struct {
// contains filtered or unexported fields
}
MemcacheClient is a memcache client that gets its server list from SRV records, and periodically updates that ServerList.
func NewMemcacheClient ¶ added in v0.16.1
func NewMemcacheClient(config MemcacheConfig) *MemcacheClient
NewMemcacheClient creates a new MemcacheClient that gets its server list from SRV and updates the server list on a regular basis.
func (*MemcacheClient) FetchReports ¶ added in v0.16.1
func (c *MemcacheClient) FetchReports(ctx context.Context, keys []string) (map[string]report.Report, []string, error)
FetchReports gets reports from memcache.
func (*MemcacheClient) Stop ¶ added in v0.16.1
func (c *MemcacheClient) Stop()
Stop the memcache client.
func (*MemcacheClient) StoreReportBytes ¶ added in v1.0.0
StoreReportBytes stores a report.
type MemcacheConfig ¶ added in v0.16.1
type MemcacheConfig struct { Host string Service string Timeout time.Duration UpdateInterval time.Duration Expiration time.Duration CompressionLevel int }
MemcacheConfig defines how a MemcacheClient should be constructed.
type ReportStore ¶ added in v0.16.1
type ReportStore interface {
FetchReports(context.Context, []string) (map[string]report.Report, []string, error)
}
ReportStore is a thing that we can get reports from.
type S3Store ¶ added in v0.16.1
type S3Store struct {
// contains filtered or unexported fields
}
S3Store is an S3 client that stores and retrieves Reports.
func NewS3Client ¶ added in v0.16.1
NewS3Client creates a new S3 client.