Documentation ¶
Overview ¶
Example ¶
var ( check = func(err error) { if err != nil { panic(err) } } swallow = func(_ mesos.Response, err error) { check(err) } ctx = context.Background() sender = SenderFunc(func(_ context.Context, _ Request) (_ mesos.Response, _ error) { return }) blackhole = func(calls ...*agent.Call) { for i := range calls { swallow(sender.Send(ctx, NonStreaming(calls[i]))) } } d = time.Duration(0) ) blackhole( GetHealth(), GetFlags(), GetVersion(), GetMetrics(nil), GetMetrics(&d), GetLoggingLevel(), ListFiles(""), ReadFile("", 0), ReadFileWithLength("", 0, 0), GetState(), GetContainers(), GetFrameworks(), GetExecutors(), GetTasks(), WaitNestedContainer(mesos.ContainerID{}), LaunchNestedContainerSession(mesos.ContainerID{}, nil, nil), ) blackhole = func(calls ...*agent.Call) { for i := range calls { check(SendNoData(ctx, sender, NonStreaming(calls[i]))) } } blackhole( SetLoggingLevel(0, d), LaunchNestedContainer(mesos.ContainerID{}, nil, nil), KillNestedContainer(mesos.ContainerID{}), AttachContainerOutput(mesos.ContainerID{}), ) swallow(sender.Send(ctx, Empty().Push( AttachContainerInput(mesos.ContainerID{}), AttachContainerInputTTY(nil), AttachContainerInputData(nil), )))
Output:
Index ¶
- func AttachContainerInput(cid mesos.ContainerID) *agent.Call
- func AttachContainerInputData(data []byte) *agent.Call
- func AttachContainerInputTTY(t *mesos.TTYInfo) *agent.Call
- func AttachContainerOutput(cid mesos.ContainerID) *agent.Call
- func GetContainers() *agent.Call
- func GetExecutors() *agent.Call
- func GetFlags() *agent.Call
- func GetFrameworks() *agent.Call
- func GetHealth() *agent.Call
- func GetLoggingLevel() *agent.Call
- func GetMetrics(d *time.Duration) (call *agent.Call)
- func GetState() *agent.Call
- func GetTasks() *agent.Call
- func GetVersion() *agent.Call
- func KillNestedContainer(cid mesos.ContainerID) *agent.Call
- func LaunchNestedContainer(cid mesos.ContainerID, cmd *mesos.CommandInfo, ci *mesos.ContainerInfo) *agent.Call
- func LaunchNestedContainerSession(cid mesos.ContainerID, cmd *mesos.CommandInfo, ci *mesos.ContainerInfo) *agent.Call
- func ListFiles(path string) *agent.Call
- func ReadFile(path string, offset uint64) *agent.Call
- func ReadFileWithLength(path string, offset, length uint64) (call *agent.Call)
- func SendNoData(ctx context.Context, sender Sender, r Request) (err error)
- func SetLoggingLevel(level uint32, d time.Duration) *agent.Call
- func WaitNestedContainer(cid mesos.ContainerID) *agent.Call
- type Request
- type RequestFunc
- type RequestStreaming
- type RequestStreamingFunc
- type Sender
- type SenderFunc
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachContainerInput ¶
AttachContainerInput returns a Call that is used to initiate attachment to a container's stdin. Callers should first send this Call followed by one or more AttachContainerInputXxx calls.
func AttachContainerInputTTY ¶
func AttachContainerOutput ¶
func GetContainers ¶
func GetExecutors ¶
func GetFrameworks ¶
func GetLoggingLevel ¶
func GetVersion ¶
func KillNestedContainer ¶
func LaunchNestedContainer ¶
func ReadFileWithLength ¶
func SendNoData ¶
SendNoData is a convenience func that executes the given Call using the provided Sender and always drops the response data.
func WaitNestedContainer ¶
Types ¶
type Request ¶
Request generates a Call that's sent to a Mesos agent. Subsequent invocations are expected to yield equivalent calls. Intended for use w/ non-streaming requests to an agent.
type RequestFunc ¶
RequestFunc is the functional adaptation of Request.
func NonStreaming ¶
func NonStreaming(c *agent.Call) RequestFunc
NonStreaming returns a RequestFunc that always generates the same Call.
func (RequestFunc) Call ¶
func (f RequestFunc) Call() *agent.Call
func (RequestFunc) Marshaler ¶
func (f RequestFunc) Marshaler() encoding.Marshaler
type RequestStreaming ¶
type RequestStreaming interface { Request IsStreaming() }
RequestStreaming generates a Call that's send to a Mesos agent. Subsequent invocations MAY generate different Call objects. No more Call objects are expected once a nil is returned to signal the end of of the request stream.
type RequestStreamingFunc ¶
RequestStreamingFunc is the functional adaptation of RequestStreaming.
func FromChan ¶
func FromChan(ch <-chan *agent.Call) RequestStreamingFunc
FromChan returns a streaming request that fetches calls from the given channel until it closes. If a nil chan is specified then the returned func will always generate nil.
func Push ¶
func Push(r RequestStreaming, c ...*agent.Call) RequestStreamingFunc
Push prepends one or more calls onto a request stream. If no calls are given then the original stream is returned.
func (RequestStreamingFunc) Call ¶
func (f RequestStreamingFunc) Call() *agent.Call
func (RequestStreamingFunc) IsStreaming ¶
func (f RequestStreamingFunc) IsStreaming()
func (RequestStreamingFunc) Marshaler ¶
func (f RequestStreamingFunc) Marshaler() encoding.Marshaler
func (RequestStreamingFunc) Push ¶
func (f RequestStreamingFunc) Push(c ...*agent.Call) RequestStreamingFunc
type SenderFunc ¶
SenderFunc is the functional adaptation of the Sender interface
func IgnoreResponse ¶
func IgnoreResponse(s Sender) SenderFunc
IgnoreResponse generates a sender that closes any non-nil response received by Mesos.