Documentation
¶
Overview ¶
Package state contains the traefik configuration by environment
Index ¶
- type Environment
- type State
- func (s *State) GetEnvNames() []string
- func (s *State) GetMaster(env string) *dynamic.Configuration
- func (s *State) LoadLocalFile(env, path string) error
- func (s *State) Subscribe(env string) chan *dynamic.Configuration
- func (s *State) Unsubscribe(env string, ch chan *dynamic.Configuration)
- func (s *State) UpdateAgent(env, name string, data []byte)
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 (*State) GetEnvNames ¶
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 ¶
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 ¶
UpdateAgent completely replaces the state for a specific agent and rebuilds the Master.
Click to show internal directories.
Click to hide internal directories.