controller

package
v0.0.0-...-2875ce1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package controller is responsible for creating VMs in various regions, according to * the provided configuration string * The controller is also responsible for initiating probing on the VMs that are created

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommunicatorServer

type CommunicatorServer struct {
	UnimplementedProbeCommunicatorServer
}

Handles communication between controller and regional VMs

func (*CommunicatorServer) Ping

func (cs *CommunicatorServer) Ping(ctx context.Context, in *Heartbeat) (*Heartbeat, error)

Processes incoming information from probes

func (*CommunicatorServer) Register

func (cs *CommunicatorServer) Register(ctx context.Context, in *RegisterRequest) (*RegisterResponse, error)

Provides regional VMs with information about which probes to run

type Controller

type Controller struct{}

func NewController

func NewController(cfg *ControllerConfig, cmd utils.CommandMaker, clk utils.Timer, log Logger) *Controller

Create a new controller with a provided configuration

func (*Controller) InitProbes

func (ctrl *Controller) InitProbes()

Start all VMs in regions in which the required hardware is available, and for which there are probes specified

func (*Controller) InitServer

func (ctrl *Controller) InitServer()

Start gRPC server for regional VMs to connect to

func (*Controller) MonitorProbes

func (ctrl *Controller) MonitorProbes()

type ControllerLogger

type ControllerLogger struct {
	Destination string // Location in Cloud Logger to which errors are logged
}

Logs controller-based errors

func (*ControllerLogger) LogError

func (c *ControllerLogger) LogError(desc string)

Log error to Cloud Logger

func (*ControllerLogger) LogErrorf

func (c *ControllerLogger) LogErrorf(desc string, args ...interface{})

Log error with format

func (*ControllerLogger) LogFatal

func (c *ControllerLogger) LogFatal(desc string)

Log error and terminate program

func (*ControllerLogger) LogFatalf

func (c *ControllerLogger) LogFatalf(desc string, args ...interface{})

Log error with format and terminate program

type Logger

type Logger interface {
	LogFatal(desc string)
	LogFatalf(desc string, args ...interface{})
	LogError(desc string)
	LogErrorf(desc string, args ...interface{})
}

Wrapper for controller error logging to Cloud Logger

Jump to

Keyboard shortcuts

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