package calls
import "github.com/mesos/mesos-go/api/v1/lib/scheduler/calls"
Index ¶
- func Accept(ops ...AcceptOpt) *scheduler.Call
- func AcceptInverseOffers(offerIDs ...mesos.OfferID) *scheduler.Call
- func Acknowledge(agentID, taskID string, uuid []byte) *scheduler.Call
- func CallNoData(caller Caller, call *scheduler.Call) error
- func Decline(offerIDs ...mesos.OfferID) *scheduler.Call
- func DeclineInverseOffers(offerIDs ...mesos.OfferID) *scheduler.Call
- func Filters(fo ...mesos.FilterOpt) scheduler.CallOpt
- func Framework(id string) scheduler.CallOpt
- func Kill(taskID, agentID string) *scheduler.Call
- func Message(agentID, executorID string, data []byte) *scheduler.Call
- func OpCreate(rs ...mesos.Resource) mesos.Offer_Operation
- func OpDestroy(rs ...mesos.Resource) mesos.Offer_Operation
- func OpLaunch(ti ...mesos.TaskInfo) mesos.Offer_Operation
- func OpLaunchGroup(ei mesos.ExecutorInfo, ti ...mesos.TaskInfo) mesos.Offer_Operation
- func OpReserve(rs ...mesos.Resource) mesos.Offer_Operation
- func OpUnreserve(rs ...mesos.Resource) mesos.Offer_Operation
- func Reconcile(opts ...scheduler.ReconcileOpt) *scheduler.Call
- func ReconcileTasks(tasks map[string]string) scheduler.ReconcileOpt
- func RefuseSecondsWithJitter(r *rand.Rand, d time.Duration) scheduler.CallOpt
- func Request(requests ...mesos.Request) *scheduler.Call
- func Revive() *scheduler.Call
- func Shutdown(executorID, agentID string) *scheduler.Call
- func Subscribe(info *mesos.FrameworkInfo) *scheduler.Call
- func SubscribeTo(frameworkID string) scheduler.CallOpt
- func Suppress() *scheduler.Call
- type AcceptOpt
- type Caller
- type CallerFunc
- type Decorator
- func CallerMetrics(harness xmetrics.Harness) Decorator
- func FrameworkCaller(frameworkID string) Decorator
- func SubscribedCaller(frameworkID func() string) Decorator
- func (d Decorator) Apply(c Caller) (result Caller)
- func (d Decorator) If(b bool) Decorator
- type Decorators
- type OfferOperations
Functions ¶
func Accept ¶
Accept returns an accept call with the given parameters. Callers are expected to fill in the FrameworkID and Filters.
func AcceptInverseOffers ¶
AcceptInverseOffers returns an accept-inverse-offers call for the given offer IDs. Callers are expected to fill in the FrameworkID and Filters.
func Acknowledge ¶
Acknowledge returns an acknowledge call with the given parameters. Callers are expected to fill in the FrameworkID.
func CallNoData ¶
CallNoData is a convenience func that executes the given Call using the provided Caller and always drops the response data.
func Decline ¶
Decline returns a decline call with the given parameters. Callers are expected to fill in the FrameworkID and Filters.
func DeclineInverseOffers ¶
DeclineInverseOffers returns a decline-inverse-offers call for the given offer IDs. Callers are expected to fill in the FrameworkID and Filters.
func Filters ¶
Filters sets a scheduler.Call's internal Filters, required for Accept and Decline calls.
func Framework ¶
Framework sets a scheduler.Call's FrameworkID
func Kill ¶
Kill returns a kill call with the given parameters. Callers are expected to fill in the FrameworkID.
func Message ¶
Message returns a message call with the given parameters. Callers are expected to fill in the FrameworkID.
func OpCreate ¶
func OpCreate(rs ...mesos.Resource) mesos.Offer_Operation
func OpDestroy ¶
func OpDestroy(rs ...mesos.Resource) mesos.Offer_Operation
func OpLaunch ¶
func OpLaunch(ti ...mesos.TaskInfo) mesos.Offer_Operation
OpLaunch returns a launch operation builder for the given tasks
func OpLaunchGroup ¶
func OpLaunchGroup(ei mesos.ExecutorInfo, ti ...mesos.TaskInfo) mesos.Offer_Operation
func OpReserve ¶
func OpReserve(rs ...mesos.Resource) mesos.Offer_Operation
func OpUnreserve ¶
func OpUnreserve(rs ...mesos.Resource) mesos.Offer_Operation
func Reconcile ¶
func Reconcile(opts ...scheduler.ReconcileOpt) *scheduler.Call
Reconcile returns a reconcile call with the given parameters. See ReconcileTask. Callers are expected to fill in the FrameworkID.
func ReconcileTasks ¶
func ReconcileTasks(tasks map[string]string) scheduler.ReconcileOpt
ReconcileTasks constructs a []Call_Reconcile_Task from the given mappings:
map[string]string{taskID:agentID}
Map keys (taskID's) are required to be non-empty, but values (agentID's) *may* be empty.
func RefuseSecondsWithJitter ¶
RefuseSecondsWithJitter returns a calls.Filters option that sets RefuseSeconds to a random number of seconds between 0 and the given duration.
func Request ¶
Request returns a resource request call with the given parameters. Callers are expected to fill in the FrameworkID.
func Revive ¶
Revive returns a revive call. Callers are expected to fill in the FrameworkID.
func Shutdown ¶
Shutdown returns a shutdown call with the given parameters. Callers are expected to fill in the FrameworkID.
func Subscribe ¶
Subscribe returns a subscribe call with the given parameters. The call's FrameworkID is automatically filled in from the info specification.
func SubscribeTo ¶
SubscribeTo returns an option that configures a SUBSCRIBE call w/ a framework ID. If frameworkID is "" then the SUBSCRIBE call is cleared of all framework ID references. Panics if the call does not contain a non-nil Subscribe reference.
func Suppress ¶
Suppress returns a suppress call. Callers are expected to fill in the FrameworkID.
Types ¶
type AcceptOpt ¶
type AcceptOpt func(*acceptBuilder)
type Caller ¶
type Caller interface { // Call issues a call to Mesos and properly manages call-specific HTTP response headers & data. Call(*scheduler.Call) (mesos.Response, error) }
Caller is the public interface this framework scheduler's should consume
type CallerFunc ¶
CallerFunc is the functional adaptation of the Caller interface
func (CallerFunc) Call ¶
func (f CallerFunc) Call(c *scheduler.Call) (mesos.Response, error)
Call implements the Caller interface for CallerFunc
type Decorator ¶
Decorator funcs usually return a Caller whose behavior has been somehow modified
func CallerMetrics ¶
func FrameworkCaller ¶
FrameworkCaller generates and returns a Decorator that applies the given frameworkID to all calls. Deprecated in favor of SubscribedCaller; should remove after v0.0.3.
func SubscribedCaller ¶
SubscribedCaller returns a Decorator that injects a framework ID to all calls, with the following exceptions:
- SUBSCRIBE calls are never modified (schedulers should explicitly construct such calls)
- calls are not modified when the generated framework ID is ""
func (Decorator) Apply ¶
Apply is a convenient, nil-safe applicator that returns the result of d(c) iff d != nil; otherwise c
func (Decorator) If ¶
If returns the receiving Decorator if the given bool is true; otherwise returns a no-op Decorator instance.
type Decorators ¶
type Decorators []Decorator
Decorators is a convenience type that applies multiple Decorator functions to a Caller
func (Decorators) Apply ¶
func (ds Decorators) Apply(c Caller) Caller
Apply is a convenience function that applies the combined product of the decorators to the given Caller.
func (Decorators) Combine ¶
func (ds Decorators) Combine() (result Decorator)
Apply applies the Decorators in the order they're listed such that the last Decorator invoked generates the final (wrapping) Caller that is ultimately returned.
type OfferOperations ¶
type OfferOperations []mesos.Offer_Operation
func (OfferOperations) WithOffers ¶
func (ob OfferOperations) WithOffers(ids ...mesos.OfferID) AcceptOpt
WithOffers allows a client to pair some set of OfferOperations with multiple resource offers. Example: calls.Accept(calls.OfferOperations{calls.OpLaunch(tasks...)}.WithOffers(offers...))
Source Files ¶
- Version
- v0.0.3
- Published
- Jun 19, 2017
- Platform
- js/wasm
- Imports
- 7 packages
- Last checked
- 1 minute ago –
Tools for package owners.