beacon

package
v4.2.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2019 License: Apache-2.0, Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReaperPort = "7799"
)

Variables

View Source
var ErrFailedToReachAnyTSA = errors.New("failed to connect to TSA")

Functions

This section is empty.

Types

type Beacon

type Beacon struct {
	Logger           lager.Logger
	Worker           atc.Worker
	Client           Client
	RegistrationMode RegistrationMode
	KeepAlive        bool

	GardenAddr       string
	GardenClient     garden.Client
	BaggageclaimAddr string
}

func (*Beacon) DeleteWorker

func (beacon *Beacon) DeleteWorker(signals <-chan os.Signal, ready chan<- struct{}) error

func (*Beacon) DisableKeepAlive

func (beacon *Beacon) DisableKeepAlive()

func (*Beacon) LandWorker

func (beacon *Beacon) LandWorker(signals <-chan os.Signal, ready chan<- struct{}) error

func (*Beacon) Register

func (beacon *Beacon) Register(signals <-chan os.Signal, ready chan<- struct{}) error

func (*Beacon) ReportContainers

func (beacon *Beacon) ReportContainers(gardenClient garden.Client) error

func (*Beacon) ReportVolumes

func (beacon *Beacon) ReportVolumes() error

func (*Beacon) RetireWorker

func (beacon *Beacon) RetireWorker(signals <-chan os.Signal, ready chan<- struct{}) error

RetireWorker sends a message via the TSA to retire the worker

func (*Beacon) SweepContainers

func (beacon *Beacon) SweepContainers(gardenClient garden.Client) error

func (*Beacon) SweepVolumes

func (beacon *Beacon) SweepVolumes() error

type BeaconClient

type BeaconClient interface {
	Register(signals <-chan os.Signal, ready chan<- struct{}) error
	RetireWorker(signals <-chan os.Signal, ready chan<- struct{}) error

	SweepContainers(garden.Client) error
	ReportContainers(garden.Client) error

	SweepVolumes() error
	ReportVolumes() error

	LandWorker(signals <-chan os.Signal, ready chan<- struct{}) error
	DeleteWorker(signals <-chan os.Signal, ready chan<- struct{}) error
	DisableKeepAlive()
}

type Client

type Client interface {
	KeepAlive() (<-chan error, chan<- struct{})
	NewSession(stdin io.Reader, stdout io.Writer, stderr io.Writer) (Session, error)
	Listen(n, addr string) (net.Listener, error)
	Proxy(from, to string) error
	Dial() (Closeable, error)
}

func NewSSHClient

func NewSSHClient(logger lager.Logger, config Config) Client

type Closeable

type Closeable interface {
	Close() error
}

type Config

type Config struct {
	TSAConfig tsa.Config `group:"TSA Configuration" namespace:"tsa"`

	GardenForwardAddr       string           `long:"garden-forward-addr" description:"Garden address to forward through SSH to the TSA."`
	BaggageclaimForwardAddr string           `long:"baggageclaim-forward-addr" description:"Baggageclaim address to forward through SSH to the TSA."`
	RegistrationMode        RegistrationMode `long:"registration-mode" default:"forward" choice:"forward" choice:"direct"`
}

type FileFlag

type FileFlag string

func (*FileFlag) UnmarshalFlag

func (f *FileFlag) UnmarshalFlag(value string) error

type IPFlag

type IPFlag net.IP

func (IPFlag) IP

func (f IPFlag) IP() net.IP

func (*IPFlag) UnmarshalFlag

func (f *IPFlag) UnmarshalFlag(value string) error

type RegistrationMode

type RegistrationMode string
const (
	Direct  RegistrationMode = "direct"
	Forward RegistrationMode = "forward"
)

type Session

type Session interface {
	Wait() error
	// Read out of session
	Close() error
	Start(command string) error
	Output(command string) ([]byte, error)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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