import "code.cloudfoundry.org/scalable-syslog/adapter/app"
type Adapter struct {
// contains filtered or unexported fields
}
Adapter receives bindings from the scheduler, connects to the RLP for log data, and streams it out to a syslog endpoint.
func NewAdapter( logsEgressAPIAddr string, logsEgressAPIAddrWithAZ string, logsEgressAPITLSConfig *tls.Config, adapterServerTLSConfig *tls.Config, metricClient MetricClient, logClient LogClient, sourceIndex string, opts ...AdapterOption, ) *Adapter
NewAdapter returns an Adapter
Start starts the adapter health endpoint and gRPC service.
AdapterOption is a type that will manipulate a config
func WithAdapterServerAddr(addr string) AdapterOption
WithAdapterServerAddr sets the address for the gRPC server to bind to.
func WithHealthAddr(addr string) AdapterOption
WithHealthAddr sets the address for the health endpoint to bind to.
func WithLogsEgressAPIConnCount(m int) AdapterOption
WithLogsEgressAPIConnCount sets the maximum number of connections to the Loggregator API
func WithLogsEgressAPIConnTTL(d int) AdapterOption
WithLogsEgressAPIConnTTL sets the number of seconds for a connection to the Loggregator API to live
func WithMaxBindings(i int) AdapterOption
WithMaxBindings sets the maximum bindings allowed per adapter.
func WithMetricsToSyslogEnabled(enabled bool) AdapterOption
WithEnableMetricsToSyslog returns a AdapterOption to override the default setting for writing metrics to syslog. By default this feature is disabled.
func WithSyslogDialTimeout(d time.Duration) AdapterOption
WithSyslogDialTimeout sets the TCP dial timeout for connecting to a syslog drain
func WithSyslogIOTimeout(d time.Duration) AdapterOption
WithSyslogIOTimeout sets the TCP IO timeout for writing to a syslog drain
func WithSyslogKeepalive(d time.Duration) AdapterOption
WithSyslogKeepalive configures the keepalive interval for HTTPS, TCP, and TLS syslog drains.
func WithSyslogSkipCertVerify(b bool) AdapterOption
WithSyslogSkipCertVerify sets the TCP InsecureSkipVerify property for syslog
type Config struct { SourceIndex string `env:"ADAPTER_INSTANCE_INDEX, required"` CAFile string `env:"CA_FILE_PATH, required"` CertFile string `env:"CERT_FILE_PATH, required"` KeyFile string `env:"KEY_FILE_PATH, required"` CommonName string `env:"TLS_COMMON_NAME, required"` RLPCAFile string `env:"LOGS_API_CA_FILE, required"` RLPCertFile string `env:"LOGS_API_CERT_FILE_PATH, required"` RLPKeyFile string `env:"LOGS_API_KEY_FILE_PATH, required"` RLPCommonName string `env:"LOGS_API_COMMON_NAME, required"` LogsAPIAddr string `env:"LOGS_API_ADDR, required"` LogsAPIAddrWithAZ string `env:"LOGS_API_ADDR_WITH_AZ, required"` HealthHostport string `env:"HEALTH_HOSTPORT"` AdapterHostport string `env:"HOSTPORT"` PprofHostport string `env:"PPROF_HOSTPORT"` SyslogKeepalive time.Duration `env:"SYSLOG_KEEPALIVE"` SyslogDialTimeout time.Duration `env:"SYSLOG_DIAL_TIMEOUT"` SyslogIOTimeout time.Duration `env:"SYSLOG_IO_TIMEOUT"` SyslogSkipCertVerify bool `env:"SYSLOG_SKIP_CERT_VERIFY"` MetricsToSyslogEnabled bool `env:"METRICS_TO_SYSLOG_ENABLED"` MaxBindings int `env:"MAX_BINDINGS"` MetricIngressAddr string `env:"METRIC_INGRESS_ADDR, required"` MetricIngressCN string `env:"METRIC_INGRESS_CN, required"` MetricEmitterInterval time.Duration `env:"METRIC_EMITTER_INTERVAL"` }
Config stores configuration settings for the adapter.
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 LogClient interface { EmitLog(message string, opts ...loggregator.EmitLogOption) }
LogClient is used to emit logs.
type MetricClient interface { NewCounterMetric(string, ...pulseemitter.MetricOption) pulseemitter.CounterMetric NewGaugeMetric(string, string, ...pulseemitter.MetricOption) pulseemitter.GaugeMetric }
MetricClient is used to emit metrics.
Package app imports 20 packages (graph) and is imported by 2 packages. Updated 2019-04-16. Refresh now. Tools for package owners.