forwarder

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailoverStrategy

type FailoverStrategy struct {
	ConnectTimeout string           `yaml:"connect_timeout" json:"connect_timeout" mapstructure:"connect_timeout"`
	Targets        []FailoverTarget `yaml:"targets" json:"targets" mapstructure:"targets"`
}

type FailoverTarget

type FailoverTarget struct {
	Service       string `yaml:"service" json:"service" mapstructure:"service"`
	Datacenter    string `yaml:"datacenter" json:"datacenter" mapstructure:"datacenter"`
	Namespace     string `yaml:"namespace" json:"namespace" mapstructure:"namespace"`
	ServiceSubset string `yaml:"service_subset" json:"service_subset" mapstructure:"service_subset"`
}

type Forwarder

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

func New

func New(logger *slog.Logger, consulAddr, consulToken, consulDC, consulNamespace, writeRateLimit string, failoverStrategies map[string]FailoverStrategy, dampeningPeriod, minDampeningPeriod string, dryRun bool) (*Forwarder, error)

func (*Forwarder) CancelPendingWrite

func (f *Forwarder) CancelPendingWrite(svcName string)

func (*Forwarder) GetCachedStrategies

func (f *Forwarder) GetCachedStrategies(svcName string) (string, string)

func (*Forwarder) Run

func (f *Forwarder) Run(ctx context.Context) error

func (*Forwarder) SetRedirector

func (f *Forwarder) SetRedirector(r writeCanceler)

func (*Forwarder) UpdateConfig

func (f *Forwarder) UpdateConfig(failoverStrategies map[string]FailoverStrategy, dampeningPeriod, minDampeningPeriod, consulNamespace, writeRateLimit string, dryRun bool)

Jump to

Keyboard shortcuts

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