open-nomad/api/constraint.go

18 lines
354 B
Go
Raw Normal View History

2015-09-09 20:02:39 +00:00
package api
// Constraint is used to serialize a job placement constraint.
type Constraint struct {
LTarget string
RTarget string
Operand string
}
// NewConstraint generates a new job placement constraint.
func NewConstraint(left, operand, right string) *Constraint {
2015-09-09 20:02:39 +00:00
return &Constraint{
LTarget: left,
RTarget: right,
Operand: operand,
}
}