Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPlacementFailed = errors.New("placement failed")
Functions ¶
This section is empty.
Types ¶
type AnswerFunc ¶
type AnswerFunc func(*PlacementResponse) error
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
func (*Broker) GetAvailableWorkers ¶
func (b *Broker) GetAvailableWorkers(req PlacementRequest) ([]PlacementResponse, error)
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
func NewListener ¶
func NewListener(nats *nats.Conn) *Listener
func (*Listener) HandleMachinePlacementRequest ¶
func (l *Listener) HandleMachinePlacementRequest(ctx context.Context, region string, handler func(msg *PlacementRequest) *PlacementResponse) error
type PlacementRequest ¶
type PlacementResponse ¶
type PlacementResponse struct { NodeId string `json:"node_id"` Allocatable api.Resources `json:"allocatable"` AllocatedBefore api.Resources `json:"allocated_before"` AllocatedAfter api.Resources `json:"allocated_after"` }
func (PlacementResponse) GetScore ¶
func (r PlacementResponse) GetScore() float64
Click to show internal directories.
Click to hide internal directories.