forwarder

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 13 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 string, failoverStrategies map[string]FailoverStrategy, dampeningPeriod, minDampeningPeriod string) (*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 string)

Jump to

Keyboard shortcuts

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