Documentation ¶
Index ¶
- func WithAPIBatchSize(size int) func(*Scheduler)
- func WithBlacklist(r *ingress.BlacklistRanges) func(*Scheduler)
- func WithHTTPClient(client *http.Client) func(*Scheduler)
- func WithHealthAddr(addr string) func(*Scheduler)
- func WithPollingInterval(interval time.Duration) func(*Scheduler)
- type Config
- type Emitter
- type LogClient
- type Scheduler
- type SchedulerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAPIBatchSize ¶
WithAPIBatchSize sets the batch size to request from the syslog drain binding provider. It defaults to 1000.
func WithBlacklist ¶
func WithBlacklist(r *ingress.BlacklistRanges) func(*Scheduler)
WithBlacklist sets the blacklist for the syslog IPs.
func WithHTTPClient ¶
WithHTTPClient sets the http.Client to poll the syslog drain binding provider.
func WithHealthAddr ¶
WithHealthAddr sets the address for the health endpoint to bind to.
func WithPollingInterval ¶
WithPollingInterval sets the interval to poll the syslog drain binding provider.
Types ¶
type Config ¶
type Config struct { APIURL string `env:"API_URL, required"` APICAFile string `env:"API_CA_FILE_PATH, required"` APICertFile string `env:"API_CERT_FILE_PATH, required"` APIKeyFile string `env:"API_KEY_FILE_PATH, required"` APICommonName string `env:"API_COMMON_NAME, required"` APISkipCertVerify bool `env:"API_SKIP_CERT_VERIFY"` APIPollingInterval time.Duration `env:"API_POLLING_INTERVAL"` APIBatchSize int `env:"API_BATCH_SIZE"` CAFile string `env:"CA_FILE_PATH, required"` CertFile string `env:"CERT_FILE_PATH, required"` KeyFile string `env:"KEY_FILE_PATH, required"` AdapterCommonName string `env:"ADAPTER_COMMON_NAME, required"` Blacklist *ingress.BlacklistRanges `env:"BLACKLIST"` AdapterPort string `env:"ADAPTER_PORT, required"` AdapterAddrs []string `env:"ADAPTER_ADDRS, required"` MetricIngressAddr string `env:"METRIC_INGRESS_ADDR, required"` MetricIngressCN string `env:"METRIC_INGRESS_CN, required"` MetricEmitterInterval time.Duration `env:"METRIC_EMITTER_INTERVAL"` HealthHostport string `env:"HEALTH_HOSTPORT"` PprofHostport string `env:"PPROF_HOSTPORT"` }
Config stores configuration settings for the scheduler.
func LoadConfig ¶
LoadConfig will load and validate the config from the current environment. If validation fails LoadConfig will log the error and exit the process with status code 1.
type Emitter ¶
type Emitter interface { NewGaugeMetric(name, unit string, opts ...pulseemitter.MetricOption) pulseemitter.GaugeMetric NewCounterMetric(name string, opts ...pulseemitter.MetricOption) pulseemitter.CounterMetric }
Emitter sends gauge metrics
type LogClient ¶
type LogClient interface {
EmitLog(message string, opts ...loggregator.EmitLogOption)
}
LogClient is used to emit logs.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler represents the scheduler component. It is responsible for polling and/or streaming events from the cloud controller about syslog drains and updating a pool of adapters to service those drains.
func NewScheduler ¶
func NewScheduler( apiURL string, adapterAddrs []string, adapterTLSConfig *tls.Config, e Emitter, logClient LogClient, opts ...SchedulerOption, ) *Scheduler
NewScheduler returns a new unstarted scheduler.
type SchedulerOption ¶
type SchedulerOption func(c *Scheduler)
SchedulerOption represents a function that can configure a scheduler.