Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrStackAlreadyExists occurs when a given stack name is already being used ErrStackAlreadyExists = errors.New("the given stack name is already being used") // ErrHostAlreadyExists occurs when a given host which should get added already exists in the current stack ErrHostAlreadyExists = errors.New("the given host already exists") // ErrHostDoesNotExist occurs when a given host does not exist in the current stack ErrHostDoesNotExist = errors.New("the given host does not exist") // ErrAllHostsOffline occurs when all hosts of the current stack are offline ErrAllHostsOffline = errors.New("all hosts of the current stack are offline") )
Functions ¶
This section is empty.
Types ¶
type Stack ¶
type Stack struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` Name string `bson:"name" json:"name"` Hosts []string `bson:"hosts" json:"hosts"` }
Stack represents a stack of API instances
func (*Stack) CalculateBestHost ¶
CalculateBestHost returns the host which has the best latency
func (*Stack) RemoveHost ¶
RemoveHost removes the given host from the current stack
Click to show internal directories.
Click to hide internal directories.