mesosutils

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2017 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Duration

func Duration(seconds float64) time.Duration

Duration translates float second values used by Marathon to go Duration format

func FindLabel

func FindLabel(labels []mesos.Label, key string) *mesos.Label

FindLabel returns a label matching given key

func GetLabelKeysByValue

func GetLabelKeysByValue(labels []mesos.Label, value string) []string

GetLabelKeysByValue searches provided labels for a given value and returns a list of matching keys

Types

type TaskInfo

type TaskInfo struct {
	TaskInfo mesos.TaskInfo
}

TaskInfo is a wrapper over Mesos TaskInfo providing convenient ways to access some of its values

func (TaskInfo) FindEnvValue

func (h TaskInfo) FindEnvValue(key string) string

FindEnvValue returns the value of an environment variable

func (TaskInfo) FindLabel

func (h TaskInfo) FindLabel(key string) *mesos.Label

FindLabel returns a label matching given key

func (TaskInfo) GetLabelKeysByValue

func (h TaskInfo) GetLabelKeysByValue(value string) []string

GetLabelKeysByValue returns all keys of labels that contain a given value

func (TaskInfo) GetLabelValue

func (h TaskInfo) GetLabelValue(key string) string

GetLabelValue returns value for of a label

func (TaskInfo) GetPorts

func (h TaskInfo) GetPorts() []mesos.Port

GetPorts returns a list of task ports

func (TaskInfo) GetServiceID

func (h TaskInfo) GetServiceID() string

GetServiceID extracts service ID from labels in mesos TaskInfo. If it fails to do so, it returns executor ID.

func (TaskInfo) GetWeight

func (h TaskInfo) GetWeight() (int, error)

GetWeight return a initial weight of the task. If weight is not set or has malformed format then returned weight is 0 and error is not nil.

Jump to

Keyboard shortcuts

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