replicator

package
v1.1.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2018 License: MIT Imports: 17 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ClusterType = "worker_pool"
	JobType     = "job_group"
)

Provides failsafe notification types.

Variables

View Source
var HashiMsgpackHandle = func() *hcodec.MsgpackHandle {
	h := &hcodec.MsgpackHandle{RawToString: true}
	h.MapType = reflect.TypeOf(map[string]interface{}(nil))
	return h
}()

HashiMsgpackHandle is some magic.

Functions

func FailsafeCheck added in v0.0.2

func FailsafeCheck(state *structs.ScalingState, config *structs.Config,
	threshold int, message *notifier.FailureMessage) (passing bool)

FailsafeCheck implements the failsafe mode circuit breaker that will trip automatically if enough critical failures are detected. Once tripped, the circuit breaker must be reset by a human operator.

func NewServerCodec

func NewServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec

NewServerCodec returns a new rpc.ServerCodec to be used by the Replicator Server to process RPC requests.

func SetFailsafeMode added in v0.0.2

func SetFailsafeMode(state *structs.ScalingState, config *structs.Config,
	enabled bool, message *notifier.FailureMessage) (err error)

SetFailsafeMode is used to toggle the distributed failsafe mode lock.

Types

type LeaderCandidate added in v0.0.2

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

LeaderCandidate runs the leader election.

type Server

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

Server is the Replicator server that is responsible for running the API and all scaling tasks.

func NewServer

func NewServer(config *structs.Config) (*Server, error)

NewServer is the main entry point into Replicator and launches processes based on the configuration.

func (*Server) RPC

func (s *Server) RPC(method string, reply interface{}) error

RPC is used to make an RPC call.

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown halts the execution of the server.

type Status

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

Status endpoint is used to get information on the server status.

func (*Status) Leader

func (s *Status) Leader(args interface{}, reply *structs.LeaderResponse) error

Leader gets information regarding the Replicator instance which is holding leadership.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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