Debian Codegraph @

api/v1/lib/executor/calls/calls_caller_generated.go

raw symbols SCIP
1 package calls
2
3 // go generate -import github.com/mesos/mesos-go/api/v1/lib/executor -type C:*executor.Call -output calls_caller_generated.go
4 // GENERATED CODE FOLLOWS; DO NOT EDIT.
5
6 import (
7 "context"
8
9 "github.com/mesos/mesos-go/api/v1/lib"
10
11 "github.com/mesos/mesos-go/api/v1/lib/executor"
12 )
13
14 type (
15 // Caller is the public interface this framework scheduler's should consume
16 Caller interface {
17 // Call issues a call to Mesos and properly manages call-specific HTTP response headers & data.
18 Call(context.Context, *executor.Call) (mesos.Response, error)
19 }
20
21 // CallerFunc is the functional adaptation of the Caller interface
22 CallerFunc func(context.Context, *executor.Call) (mesos.Response, error)
23 )
24
25 // Call implements the Caller interface for CallerFunc
26 func (f CallerFunc) Call(ctx context.Context, c *executor.Call) (mesos.Response, error) {
27 return f(ctx, c)
28 }
29
30 // CallNoData is a convenience func that executes the given Call using the provided Caller
31 // and always drops the response data.
32 func CallNoData(ctx context.Context, caller Caller, call *executor.Call) error {
33 resp, err := caller.Call(ctx, call)
34 if resp != nil {
35 resp.Close()
36 }
37 return err
38 }