scalable-syslog: code.cloudfoundry.org/scalable-syslog/scheduler/app Index | Files

package app

import "code.cloudfoundry.org/scalable-syslog/scheduler/app"

Index

Package Files

config.go scheduler.go

func WithAPIBatchSize Uses

func WithAPIBatchSize(size int) func(*Scheduler)

WithAPIBatchSize sets the batch size to request from the syslog drain binding provider. It defaults to 1000.

func WithBlacklist Uses

func WithBlacklist(r *ingress.BlacklistRanges) func(*Scheduler)

WithBlacklist sets the blacklist for the syslog IPs.

func WithHTTPClient Uses

func WithHTTPClient(client *http.Client) func(*Scheduler)

WithHTTPClient sets the http.Client to poll the syslog drain binding provider.

func WithHealthAddr Uses

func WithHealthAddr(addr string) func(*Scheduler)

WithHealthAddr sets the address for the health endpoint to bind to.

func WithPollingInterval Uses

func WithPollingInterval(interval time.Duration) func(*Scheduler)

WithPollingInterval sets the interval to poll the syslog drain binding provider.

type Config Uses

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 Uses

func LoadConfig(args []string) (*Config, error)

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 Uses

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 Uses

type LogClient interface {
    EmitLog(message string, opts ...loggregator.EmitLogOption)
}

LogClient is used to emit logs.

type Scheduler Uses

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 Uses

func NewScheduler(
    apiURL string,
    adapterAddrs []string,
    adapterTLSConfig *tls.Config,
    e Emitter,
    logClient LogClient,
    opts ...SchedulerOption,
) *Scheduler

NewScheduler returns a new unstarted scheduler.

func (*Scheduler) Start Uses

func (s *Scheduler) Start() string

Start starts polling the syslog drain binding provider and serves the HTTP health endpoint.

type SchedulerOption Uses

type SchedulerOption func(c *Scheduler)

SchedulerOption represents a function that can configure a scheduler.

Package app imports 15 packages (graph) and is imported by 2 packages. Updated 2019-05-06. Refresh now. Tools for package owners.