| 1 |
package calls_test |
| 2 |
|
| 3 |
import ( |
| 4 |
"context" |
| 5 |
"time" |
| 6 |
|
| 7 |
"github.com/mesos/mesos-go/api/v1/lib" |
| 8 |
"github.com/mesos/mesos-go/api/v1/lib/maintenance" |
| 9 |
"github.com/mesos/mesos-go/api/v1/lib/master" |
| 10 |
. "github.com/mesos/mesos-go/api/v1/lib/master/calls" |
| 11 |
"github.com/mesos/mesos-go/api/v1/lib/quota" |
| 12 |
) |
| 13 |
|
| 14 |
func Example() { |
| 15 |
var ( |
| 16 |
check = func(err error) { |
| 17 |
if err != nil { |
| 18 |
panic(err) |
| 19 |
} |
| 20 |
} |
| 21 |
swallow = func(_ mesos.Response, err error) { check(err) } |
| 22 |
|
| 23 |
ctx = context.Background() |
| 24 |
sender = SenderFunc(func(_ context.Context, _ Request) (_ mesos.Response, _ error) { return }) |
| 25 |
blackhole = func(c *master.Call) { swallow(sender.Send(ctx, NonStreaming(c))) } |
| 26 |
|
| 27 |
d = time.Duration(0) |
| 28 |
) |
| 29 |
blackhole(GetHealth()) |
| 30 |
blackhole(GetFlags()) |
| 31 |
blackhole(GetVersion()) |
| 32 |
blackhole(GetMetrics(nil)) |
| 33 |
blackhole(GetMetrics(&d)) |
| 34 |
blackhole(GetLoggingLevel()) |
| 35 |
blackhole(ListFiles("")) |
| 36 |
blackhole(ReadFile("", 0)) |
| 37 |
blackhole(ReadFileWithLength("", 0, 0)) |
| 38 |
blackhole(GetState()) |
| 39 |
blackhole(GetAgents()) |
| 40 |
blackhole(GetFrameworks()) |
| 41 |
blackhole(GetExecutors()) |
| 42 |
blackhole(GetTasks()) |
| 43 |
blackhole(GetRoles()) |
| 44 |
blackhole(GetWeights()) |
| 45 |
blackhole(GetMaster()) |
| 46 |
blackhole(GetMaintenanceStatus()) |
| 47 |
blackhole(GetMaintenanceSchedule()) |
| 48 |
blackhole(GetQuota()) |
| 49 |
blackhole(Subscribe()) |
| 50 |
|
| 51 |
blackhole = func(c *master.Call) { |
| 52 |
check(SendNoData(ctx, sender, NonStreaming(c))) |
| 53 |
} |
| 54 |
blackhole(SetLoggingLevel(0, 0)) |
| 55 |
blackhole(UpdateWeights()) |
| 56 |
blackhole(ReserveResources(mesos.AgentID{})) |
| 57 |
blackhole(UnreserveResources(mesos.AgentID{})) |
| 58 |
blackhole(CreateVolumes(mesos.AgentID{})) |
| 59 |
blackhole(DestroyVolumes(mesos.AgentID{})) |
| 60 |
blackhole(UpdateMaintenanceSchedule(maintenance.Schedule{})) |
| 61 |
blackhole(StartMaintenance()) |
| 62 |
blackhole(StopMaintenance()) |
| 63 |
blackhole(SetQuota(quota.QuotaRequest{})) |
| 64 |
blackhole(RemoveQuota("")) |
| 65 |
|
| 66 |
|
| 67 |
} |