binding

package
v0.0.0-...-96cdf77 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateBindingCount

func CalculateBindingCount(bindings []Binding) int

Types

type AggBinding

type AggBinding struct {
	Url  string `yaml:"url"`
	Cert string `yaml:"cert"`
	Key  string `yaml:"key"`
	CA   string `yaml:"ca"`
}

type AggregateStore

type AggregateStore struct {
	Drains []Binding
}

func NewAggregateStore

func NewAggregateStore(drainFileName string) *AggregateStore

func (*AggregateStore) Get

func (store *AggregateStore) Get() []Binding

type App

type App struct {
	Hostname string `json:"hostname"`
	AppID    string `json:"app_id"`
}

type Binding

type Binding struct {
	Url         string        `json:"url" yaml:"url"`
	Credentials []Credentials `json:"credentials" yaml:"credentials"`
}

type Connector

type Connector interface {
	Connect(context.Context, syslog.Binding) (egress.Writer, error)
}

type Credentials

type Credentials struct {
	Cert string `json:"cert" yaml:"cert"`
	Key  string `json:"key" yaml:"key"`
	CA   string `json:"ca" yaml:"ca"`
	Apps []App  `json:"apps"`
}

type Fetcher

type Fetcher interface {
	FetchBindings() ([]syslog.Binding, error)
	DrainLimit() int
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(
	bf Fetcher,
	af Fetcher,
	c Connector,
	m Metrics,
	pollingInterval time.Duration,
	idleTimeout time.Duration,
	aggregateConnectionRefreshInterval time.Duration,
	log *log.Logger,
) *Manager

func (*Manager) GetDrains

func (m *Manager) GetDrains(sourceID string) []egress.Writer

func (*Manager) Run

func (m *Manager) Run()

type Metrics

type Metrics interface {
	NewGauge(name, helpText string, o ...metrics.MetricOption) metrics.Gauge
	NewCounter(name, helpText string, o ...metrics.MetricOption) metrics.Counter
}

type Poller

type Poller struct {
	// contains filtered or unexported fields
}

func NewPoller

func NewPoller(ac client, pi time.Duration, s Setter, m Metrics, logger *log.Logger) *Poller

func (*Poller) Poll

func (p *Poller) Poll()

type Setter

type Setter interface {
	Set(bindings []Binding, bindingCount int)
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(m Metrics) *Store

func (*Store) Get

func (s *Store) Get() []Binding

func (*Store) Set

func (s *Store) Set(bindings []Binding, bindingCount int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL