atc

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: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Forwarder  string = "forwarder"
	Redirector string = "redirector"
	Server     string = "server"
	Consul     string = "consul"
	All        string = "all"
)

Variables

View Source
var UserVisibleModules = []string{
	Consul,
	Forwarder,
	Redirector,
	All,
}

Functions

func NewMultiHandler

func NewMultiHandler(handlers ...slog.Handler) slog.Handler

func OkHandler

func OkHandler() http.HandlerFunc

func RenderServicesTable

func RenderServicesTable(enabledModules map[string]bool) string

Types

type Atc

type Atc struct {
	Cfg Config

	Server *atc_server.Server

	Forwarder  *forwarder.Forwarder
	Redirector *redirector.Redirector
	// contains filtered or unexported fields
}

func New

func New(cfg Config) (*Atc, error)

func (*Atc) ApplyFailoverOverride

func (t *Atc) ApplyFailoverOverride(ctx context.Context, service string, targetDc string) error

func (*Atc) DependenciesForModule

func (t *Atc) DependenciesForModule(mod string) []string

func (*Atc) GetAtcEnabledServices

func (t *Atc) GetAtcEnabledServices(ctx context.Context) ([]string, error)

func (*Atc) GetEnabledModulesTable

func (t *Atc) GetEnabledModulesTable() string

func (*Atc) GetFederationStatus

func (t *Atc) GetFederationStatus(ctx context.Context) (map[string]string, error)

func (*Atc) IsLeader

func (t *Atc) IsLeader() bool

func (*Atc) PurgeServiceResolver

func (t *Atc) PurgeServiceResolver(ctx context.Context, name string) error

func (*Atc) ReloadConfig

func (t *Atc) ReloadConfig(cfg Config)

func (*Atc) Run

func (t *Atc) Run() error

func (*Atc) TriggerManualRedirect

func (t *Atc) TriggerManualRedirect(ctx context.Context, service string, redirectDc string) error

func (*Atc) UserVisibleModuleNames

func (t *Atc) UserVisibleModuleNames() []string

type Config

type Config struct {
	Name               string            `yaml:"service" mapstructure:"service"`
	Server             atc_server.Config `yaml:"server" mapstructure:"server"`
	Target             []string          `yaml:"target" mapstructure:"target"`
	ConsulAddr         string            `yaml:"consul_addr" mapstructure:"consul_addr"`
	ConsulToken        string            `yaml:"consul_token" mapstructure:"consul_token"`
	ConsulDC           string            `yaml:"consul_dc" mapstructure:"consul_dc"`
	DampeningPeriod    string            `yaml:"dampening_period" mapstructure:"dampening_period"`
	MinDampeningPeriod string            `yaml:"min_dampening_period" mapstructure:"min_dampening_period"`
	Strategies         StrategiesConfig  `yaml:"strategies" json:"strategies" mapstructure:"strategies"`
	HA                 HaConfig          `yaml:"ha" json:"ha" mapstructure:"ha"`
}

type HaConfig

type HaConfig struct {
	Enabled    bool   `yaml:"enabled" json:"enabled" mapstructure:"enabled"`
	LockKey    string `yaml:"lock_key" json:"lock_key" mapstructure:"lock_key"`
	SessionTTL string `yaml:"session_ttl" json:"session_ttl" mapstructure:"session_ttl"`
}

type MultiHandler

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

MultiHandler multiplexes slog records to multiple slog Handlers.

func (*MultiHandler) Enabled

func (m *MultiHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*MultiHandler) Handle

func (m *MultiHandler) Handle(ctx context.Context, r slog.Record) error

func (*MultiHandler) WithAttrs

func (m *MultiHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*MultiHandler) WithGroup

func (m *MultiHandler) WithGroup(name string) slog.Handler

type StrategiesConfig

type StrategiesConfig struct {
	Failover map[string]forwarder.FailoverStrategy  `yaml:"failover" json:"failover" mapstructure:"failover"`
	Redirect map[string]redirector.RedirectStrategy `yaml:"redirect" json:"redirect" mapstructure:"redirect"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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