state

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package state contains the traefik configuration by environment

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment struct {
	Master *dynamic.Configuration
	Agents map[string]*dynamic.Configuration
	Local  *dynamic.Configuration
}

type State

type State struct {
	Envs map[string]*Environment // Map of group names to their environments
	// contains filtered or unexported fields
}

func New

func New() *State

func (*State) GetEnvNames

func (s *State) GetEnvNames() []string

GetEnvNames returns a list of all environment names.

func (*State) GetMaster

func (s *State) GetMaster(env string) *dynamic.Configuration

GetMaster safely returns a snapshot of the master configuration for the given environment.

func (*State) LoadLocalFile

func (s *State) LoadLocalFile(env, path string) error

LoadLocalFile reads a JSON or YAML dynamic config and stores it

func (*State) Subscribe

func (s *State) Subscribe(env string) chan *dynamic.Configuration

Subscribe creates a channel that receives updates for a specific environment.

func (*State) Unsubscribe

func (s *State) Unsubscribe(env string, ch chan *dynamic.Configuration)

Unsubscribe removes a channel from the pool and closes it.

func (*State) UpdateAgent

func (s *State) UpdateAgent(env, name string, data []byte)

UpdateAgent completely replaces the state for a specific agent and rebuilds the Master.

Jump to

Keyboard shortcuts

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