Documentation ¶
Index ¶
- Constants
- func CPUs(resources ...mesos.Resource) (float64, bool)
- func Contains(subject []mesos.Resource, that mesos.Resource) bool
- func ContainsAll(subject, that []mesos.Resource) bool
- func Disk(resources ...mesos.Resource) (uint64, bool)
- func Equivalent(subject, that []mesos.Resource) bool
- func Find(wants mesos.Resources, from ...mesos.Resource) (total mesos.Resources)
- func Flatten(resources []mesos.Resource, opts ...FlattenOpt) []mesos.Resource
- func GPUs(resources ...mesos.Resource) (uint64, bool)
- func Memory(resources ...mesos.Resource) (uint64, bool)
- func Ports(resources ...mesos.Resource) (mesos.Ranges, bool)
- func Reduce(rf Reducer, rs ...mesos.Resource) (r *mesos.Resource)
- func SumAndCompare(expected []mesos.Resource, resources ...mesos.Resource) bool
- func TypesOf(resources ...mesos.Resource) map[Name]mesos.Value_Type
- func Validate(resources ...mesos.Resource) error
- type Builder
- func (rb *Builder) Disk(persistenceID, containerPath string) *Builder
- func (rb *Builder) DiskSource(root string, t mesos.Resource_DiskInfo_Source_Type) *Builder
- func (rb *Builder) Name(name fmt.Stringer) *Builder
- func (rb *Builder) Ranges(rs mesos.Ranges) *Builder
- func (rb *Builder) Revocable() *Builder
- func (rb *Builder) Role(role string) *Builder
- func (rb *Builder) Scalar(x float64) *Builder
- func (rb *Builder) Set(x ...string) *Builder
- type FlattenOpt
- type Name
- type Names
- type RangeBuilder
- type Reducer
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func ContainsAll ¶
func ContainsAll(subject, that []mesos.Resource) bool
ContainsAll returns true if this set of resources contains that set of (presumably pre-validated) resources.
func Equivalent ¶
func Equivalent(subject, that []mesos.Resource) bool
func Flatten ¶
func Flatten(resources []mesos.Resource, opts ...FlattenOpt) []mesos.Resource
Flatten is deprecated and should only be used when dealing w/ resources in pre-reservation-refinement format.
func Reduce ¶
func Reduce(rf Reducer, rs ...mesos.Resource) (r *mesos.Resource)
Reduce applies the given Reducer to produce a final Resource, iterating left-to-right over the given resources; panics if the Reducer is nil.
func SumAndCompare ¶
func SumAndCompare(expected []mesos.Resource, resources ...mesos.Resource) bool
Types ¶
type Builder ¶
type Builder struct{ mesos.Resource }
Builder simplifies construction of Resource objects
func (*Builder) DiskSource ¶
type FlattenOpt ¶
type FlattenOpt func(interface{})
FlattenOpt is a functional option for resource flattening, via Flatten. Implementations are expected to type-narrow the given interface, matching against WithRole, WithReservation or both methods (see Role.Assign)
type RangeBuilder ¶
type RangeBuilder struct{ mesos.Ranges }
RangeBuilder simplifies construction of Range objects
func BuildRanges ¶
func BuildRanges() *RangeBuilder
func (*RangeBuilder) Span ¶
func (rb *RangeBuilder) Span(bp, ep uint64) *RangeBuilder
Span is a functional option for Ranges, defines the begin and end points of a continuous span within a range
type Reducer ¶
type Reducer func(acc, x *mesos.Resource) *mesos.Resource
Reducer applies some operation to possibly combine an accumulator (acc) and a resource (x), returning either the combined result or nil.
func Sum ¶
func Sum(fs ...resourcefilters.Filter) Reducer