birger

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL                    string `json:"url,omitempty" yaml:"url,omitempty"`
	Token                  string `json:"token,omitempty" yaml:"token,omitempty"`
	UpdateFrequencySeconds int    `json:"updateFrequencySeconds,omitempty" yaml:"updateFrequencySeconds,omitempty"`
}

type ControllerManager

type ControllerManager struct {
	UpdateChan chan ServiceUpdate
	// contains filtered or unexported fields
}

ControllerManager checks the services available on the controller, and fetches new tokens for newly discovered services. It will update the ArgoManager with new endpoints, and remove old ones.

func MakeControllerManager

func MakeControllerManager(conf Config, serviceTypes []string) *ControllerManager

MakeControllerManager returns a new ControllerManager which will periodically poll the controller for services, and send

func (*ControllerManager) Check

func (m *ControllerManager) Check() error

Check returns the last error received during a sync, if any. Used for a healthcheck status.

func (*ControllerManager) Shutdown

func (m *ControllerManager) Shutdown()

Shutdown tells the manager to stop doing updates and causes all goprocs started to exit as cleanly as possible.

type ServiceUpdate

type ServiceUpdate struct {
	Operation   string // delete, update (implies add)
	Name        string
	Type        string
	AgentName   string
	Annotations map[string]string // Only set for update
	Token       string            // Only set for update
	URL         string            // Only set for update
}

ServiceUpdate contains an update message sent when a new service type is discovered or is no longer present in the controller.

Operation is either 'update' or 'delete'. For both, Name, Type, and AgentName will be set. For update only, the URL and Token will also be included.

Jump to

Keyboard shortcuts

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