sss

package
v0.0.0-...-1eec387 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller is sabakan-state-setter controller

func NewController

func NewController(etcdClient *clientv3.Client, sabakanAddress, serfAddress, configFile, electionValue string, interval time.Duration, parallelSize int, sessionTTL time.Duration) (*Controller, error)

NewController returns controller for sabakan-state-setter

func (*Controller) ClearUnhealthy

func (c *Controller) ClearUnhealthy(m *machine)

ClearUnhealthy removes machine from unhealthy registry.

func (*Controller) RegisterUnhealthy

func (c *Controller) RegisterUnhealthy(m *machine, now time.Time) bool

RegisterUnhealthy registers unhealthy machine and returns true if the machine has been unhealthy longer than the GracePeriod specified in its machine type.

func (*Controller) Run

func (c *Controller) Run(ctx context.Context) error

type NecoCmdExecutor

type NecoCmdExecutor interface {
	PowerStop(ctx context.Context, serial string) ([]byte, error)
	PowerStatus(ctx context.Context, serial string) ([]byte, error)
	TPMClear(ctx context.Context, serial string) ([]byte, error)
}

NecoCmdExecutor is interface for the neco command

type PrometheusClient

type PrometheusClient interface {
	ConnectMetricsServer(ctx context.Context, addr string) (map[string]*dto.MetricFamily, error)
}

PrometheusClient is interface for prometheus client

type SabakanClientWrapper

type SabakanClientWrapper interface {
	GetAllMachines(ctx context.Context) ([]*machine, error)
	GetRetiredMachines(ctx context.Context) ([]*machine, error)
	UpdateSabakanState(ctx context.Context, serial string, state sabakan.MachineState) error
	CryptsDelete(ctx context.Context, serial string) error
}

SabakanClientWrapper is interface of the sabakan client for sbakan-state-setter

type SerfClient

type SerfClient interface {
	GetSerfStatus() (map[string]*serfStatus, error)
}

SerfClient is interface for serf client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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