| 1 |
package calls |
| 2 |
|
| 3 |
import ( |
| 4 |
"github.com/mesos/mesos-go/api/v1/lib" |
| 5 |
"github.com/mesos/mesos-go/api/v1/lib/executor" |
| 6 |
) |
| 7 |
|
| 8 |
|
| 9 |
func Framework(id string) executor.CallOpt { |
| 10 |
return func(c *executor.Call) { |
| 11 |
c.FrameworkID = mesos.FrameworkID{Value: id} |
| 12 |
} |
| 13 |
} |
| 14 |
|
| 15 |
|
| 16 |
func Executor(id string) executor.CallOpt { |
| 17 |
return func(c *executor.Call) { |
| 18 |
c.ExecutorID = mesos.ExecutorID{Value: id} |
| 19 |
} |
| 20 |
} |
| 21 |
|
| 22 |
|
| 23 |
func Subscribe(unackdTasks []mesos.TaskInfo, unackdUpdates []executor.Call_Update) *executor.Call { |
| 24 |
return &executor.Call{ |
| 25 |
Type: executor.Call_SUBSCRIBE, |
| 26 |
Subscribe: &executor.Call_Subscribe{ |
| 27 |
UnacknowledgedTasks: unackdTasks, |
| 28 |
UnacknowledgedUpdates: unackdUpdates, |
| 29 |
}, |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
|
| 34 |
func Update(status mesos.TaskStatus) *executor.Call { |
| 35 |
return &executor.Call{ |
| 36 |
Type: executor.Call_UPDATE, |
| 37 |
Update: &executor.Call_Update{ |
| 38 |
Status: status, |
| 39 |
}, |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
|
| 44 |
func Message(data []byte) *executor.Call { |
| 45 |
return &executor.Call{ |
| 46 |
Type: executor.Call_MESSAGE, |
| 47 |
Message: &executor.Call_Message{ |
| 48 |
Data: data, |
| 49 |
}, |
| 50 |
} |
| 51 |
} |