redirector

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 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 RedirectStrategy

type RedirectStrategy 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 Redirector

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

func New

func New(logger *slog.Logger, consulAddr, consulToken, consulDC, consulNamespace, writeRateLimit string, forwarderEnabled bool, redirectStrategies map[string]RedirectStrategy, dampeningPeriod, minDampeningPeriod string, hasDefaultFailover bool, dryRun bool) (*Redirector, error)

func (*Redirector) CancelPendingWrite

func (r *Redirector) CancelPendingWrite(svcName string)

func (*Redirector) GetCachedStrategies

func (r *Redirector) GetCachedStrategies(svcName string) (string, string)

func (*Redirector) Run

func (r *Redirector) Run(ctx context.Context) error

func (*Redirector) SetForwarder

func (r *Redirector) SetForwarder(f writeCanceler)

func (*Redirector) UpdateConfig

func (r *Redirector) UpdateConfig(redirectStrategies map[string]RedirectStrategy, 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