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
|
|
|
|
}
|
|
|
|
|
2015-10-27 21:31:14 +00:00
|
|
|
// 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,
|
|
|
|
}
|
|
|
|
}
|