calls

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 4 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallNoData added in v0.0.4

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 Heartbeat added in v0.0.10

func Heartbeat() *executor.Call

Heartbeat returns an executor heartbeat call, useful to detect disconnections.

func Message

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

Message returns an executor call with the given parameters.

func SendNoData added in v0.0.5

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 added in v0.0.4

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 added in v0.0.4

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

CallerFunc is the functional adaptation of the Caller interface

func (CallerFunc) Call added in v0.0.4

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

Call implements the Caller interface for CallerFunc

type Request added in v0.0.5

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 added in v0.0.5

type RequestFunc func() *executor.Call

RequestFunc is the functional adaptation of Request.

func NonStreaming added in v0.0.5

func NonStreaming(c *executor.Call) RequestFunc

NonStreaming returns a RequestFunc that always generates the same Call.

func (RequestFunc) Call added in v0.0.5

func (f RequestFunc) Call() *executor.Call

func (RequestFunc) Marshaler added in v0.0.5

func (f RequestFunc) Marshaler() encoding.Marshaler

type RequestStreaming added in v0.0.5

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 added in v0.0.5

type RequestStreamingFunc func() *executor.Call

RequestStreamingFunc is the functional adaptation of RequestStreaming.

func Empty added in v0.0.5

func Empty() RequestStreamingFunc

Empty generates a stream that always returns nil.

func FromChan added in v0.0.5

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 added in v0.0.5

Push prepends one or more calls onto a request stream. If no calls are given then the original stream is returned.

func (RequestStreamingFunc) Call added in v0.0.5

func (RequestStreamingFunc) IsStreaming added in v0.0.5

func (f RequestStreamingFunc) IsStreaming()

func (RequestStreamingFunc) Marshaler added in v0.0.5

func (f RequestStreamingFunc) Marshaler() encoding.Marshaler

func (RequestStreamingFunc) Push added in v0.0.5

type Sender added in v0.0.5

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 added in v0.0.5

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

SenderFunc is the functional adaptation of the Sender interface

func IgnoreResponse added in v0.0.5

func IgnoreResponse(s Sender) SenderFunc

IgnoreResponse generates a sender that closes any non-nil response received by Mesos.

func SenderWith added in v0.0.5

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

SendWith injects the given options for all calls.

func (SenderFunc) Send added in v0.0.5

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