Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultKeyFunc = KeyFunc(KeyFuncByOfferID)
DefaultKeyFunc indexes offers by their OfferID.
Functions ¶
func KeyFuncByOfferID ¶
func KeyFuncByOfferID(o *mesos.Offer) interface{}
Types ¶
type Filter ¶
type Filter interface {
Accept(*mesos.Offer) bool
}
Filter accepts or rejects a mesos Offer
func ByAttributes ¶
ByAttributes returns a Filter that accepts offers with an attribute set accepted by the provided Attribute filter func.
func ByExecutors ¶
func ByHostname ¶
ByHostname returns a Filter that accepts offers with a matching Hostname
func ByUnavailability ¶
func ContainsResources ¶
func ContainsResources(wanted mesos.Resources) Filter
ContainsResources returns a filter that returns true if the Resources of an Offer contain the wanted Resources.
type FilterFunc ¶
type FilterFunc func(*mesos.Offer) bool
FilterFunc returns true if the given Offer passes the filter
func (FilterFunc) Accept ¶
func (f FilterFunc) Accept(o *mesos.Offer) bool
Accept implements Filter for FilterFunc
type Index ¶
type Index map[interface{}]*mesos.Offer
Index is a convenience type wrapper for a dictionary of Offer messages
func NewIndex ¶
NewIndex returns a new Index constructed from the list of mesos offers. If the KeyFunc is nil then offers are indexed by DefaultKeyFunc. The values of the returned Index are pointers to (not copies of) the offers of the slice receiver.
func (Index) FilterNot ¶
FilterNot returns the subset of the Index that does not match the given filter.
func (Index) Find ¶
Find returns the first Offer that passes the given filter function, or else nil if there are no passing offers.
type KeyFunc ¶
type KeyFunc func(*mesos.Offer) interface{}
KeyFunc generates a key used for indexing offers
type Slice ¶
type Slice []mesos.Offer
Slice is a convenience type wrapper for a slice of mesos Offer messages
func (Slice) FilterNot ¶
FilterNot returns the subset of the Slice that does not match the given filter.