calls

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallNoData

func CallNoData(ctx context.Context, caller Caller, call *executor.Call) error

CallNoData is a convenience func that executes the given Call using the provided Caller and always drops the response data.

func Executor

func Executor(id string) executor.CallOpt

Executor sets a executor.Call's ExecutorID

func Framework

func Framework(id string) executor.CallOpt

Framework sets a executor.Call's FrameworkID

func Message

func Message(data []byte) *executor.Call

Message returns an executor call with the given parameters.

func SendNoData

func SendNoData(ctx context.Context, sender Sender, r Request) (err error)

SendNoData is a convenience func that executes the given Call using the provided Sender and always drops the response data.

func Subscribe

func Subscribe(unackdTasks []mesos.TaskInfo, unackdUpdates []executor.Call_Update) *executor.Call

Subscribe returns an executor call with the given parameters.

func Update

func Update(status mesos.TaskStatus) *executor.Call

Update returns an executor call with the given parameters.

Types

type Caller

type Caller interface {
	// Call issues a call to Mesos and properly manages call-specific HTTP response headers & data.
	Call(context.Context, *executor.Call) (mesos.Response, error)
}

Caller is the public interface this framework scheduler's should consume

type CallerFunc

type CallerFunc func(context.Context, *executor.Call) (mesos.Response, error)

CallerFunc is the functional adaptation of the Caller interface

func (CallerFunc) Call

func (f CallerFunc) Call(ctx context.Context, c *executor.Call) (mesos.Response, error)

Call implements the Caller interface for CallerFunc

type Request

type Request interface {
	Call() *executor.Call
}

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

type RequestFunc func() *executor.Call

RequestFunc is the functional adaptation of Request.

func NonStreaming

func NonStreaming(c *executor.Call) RequestFunc

NonStreaming returns a RequestFunc that always generates the same Call.

func (RequestFunc) Call

func (f RequestFunc) Call() *executor.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

type RequestStreamingFunc func() *executor.Call

RequestStreamingFunc is the functional adaptation of RequestStreaming.

func Empty

func Empty() RequestStreamingFunc

Empty generates a stream that always returns nil.

func FromChan

func FromChan(ch <-chan *executor.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

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 (RequestStreamingFunc) IsStreaming

func (f RequestStreamingFunc) IsStreaming()

func (RequestStreamingFunc) Marshaler

func (f RequestStreamingFunc) Marshaler() encoding.Marshaler

func (RequestStreamingFunc) Push

type Sender

type Sender interface {
	Send(context.Context, Request) (mesos.Response, error)
}

Send issues a Request to a Mesos agent and properly manages Call-specific mechanics.

type SenderFunc

type SenderFunc func(context.Context, Request) (mesos.Response, error)

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.

func SenderWith

func SenderWith(s Sender, opts ...executor.CallOpt) SenderFunc

SendWith injects the given options for all calls.

func (SenderFunc) Send

func (f SenderFunc) Send(ctx context.Context, r Request) (mesos.Response, error)

Send implements the Sender interface for SenderFunc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL