destroyer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MIT Imports: 10 Imported by: 2

Documentation

Overview

Package destroyer provides an API for chaos servers.

Index

Constants

View Source
const (
	Up = Status(iota)
	Down
	Pending
	Any
)

Status allowed values

Variables

View Source
var ErrNotMatchingService = errors.New("Some service has no instance matching")

ErrNotMatchingService indicates that some service has no instance matching

Functions

This section is empty.

Types

type ChaosServer

type ChaosServer interface {
	// Shutdown turns down instances.
	// For Chaos Server implementation especific
	Shutdown(svc string) error
	// ListInstances lists all instances that are in any state
	ListInstances(status Status) ([]Instance, error)
	LifeCycle
}

ChaosServer is an interface for chaos server implementation

type Destroyer

type Destroyer struct {
	ChaosSrv ChaosServer
}

Destroyer implements chaos server operations

func (*Destroyer) Shutdown

func (d *Destroyer) Shutdown(svcs []april.Service) error

Shutdown turns down services listed on svcs

type Instance

type Instance struct {
	Name string
	Sts  Status
}

Instance holds the an instance data

type LifeCycle

type LifeCycle interface {
	// OnStart runs before the host is served.
	// Could be used as configuration routine for before stating the server
	OnStart()
}

LifeCycle contains routines that execute in the chaos server lifecycle

type Server

type Server struct {
	Cred *auth.Credentials
	// contains filtered or unexported fields
}

Server implements chaos server API

func New

func New(port int, cs ChaosServer) *Server

New creates a chaos server instance

func (*Server) Serve

func (s *Server) Serve()

Serve hosts aprils API over HTTP protocol

type Status

type Status uint8

Status represents instance status

Directories

Path Synopsis
Package request implements requests for destroyer server.
Package request implements requests for destroyer server.

Jump to

Keyboard shortcuts

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