Documentation ¶
Index ¶
- Variables
- func HeaderFromContext(ctx context.Context) (http.Header, bool)
- func NewContextWithHeaders(ctx context.Context, header http.Header) context.Context
- type CanonicalTaskID
- type ContainerStatus
- type ErrNodeInfo
- type Framework
- type NestedValue
- type NodeInfo
- type Option
- type Slave
- type State
- type Status
- type Task
Constants ¶
This section is empty.
Variables ¶
var ErrContainerIDNotFound = errors.New("invalid task. Container ID not found")
ErrContainerIDNotFound is returned by ContainerIDs() function if the container id is not set.
var ErrEmptyParam = errors.New("Error using empty parameter")
ErrEmptyParam is the error returned if option is used with empty parameter.
var ErrTaskNotFound = errors.New("task not found")
ErrTaskNotFound is return if the canonical ID for a given task not found.
Functions ¶
func HeaderFromContext ¶
HeaderFromContext returns http.Header from a context if it's found.
Types ¶
type CanonicalTaskID ¶
type CanonicalTaskID struct { ID string AgentID string FrameworkID string ExecutorID string ContainerIDs []string }
CanonicalTaskID is a unique task id.
type ContainerStatus ¶
type ContainerStatus struct {
ContainerID NestedValue `json:"container_id"`
}
ContainerStatus is a field in state.json
type ErrNodeInfo ¶
type ErrNodeInfo struct {
// contains filtered or unexported fields
}
ErrNodeInfo is an error structure raised by exported functions with meaningful error message.
func (ErrNodeInfo) Error ¶
func (e ErrNodeInfo) Error() string
type Framework ¶
type Framework struct { ID string `json:"id"` Name string `json:"name"` PID string `json:"pid"` Role string `json:"role"` Tasks []Task `json:"tasks"` CompletedTasks []Task `json:"completed_tasks"` }
Framework is a field in state.json
type NestedValue ¶
type NestedValue struct { Value string `json:"value"` Parent *NestedValue `json:"parent"` }
NestedValue represents a nested container ID. The value is the actual container ID and Parent is a reference to another NestedValue structure.
type NodeInfo ¶
type NodeInfo interface { DetectIP() (net.IP, error) IsLeader() (bool, error) MesosID(context.Context) (string, error) ClusterID() (string, error) TaskCanonicalID(ctx context.Context, task string, completed bool) (*CanonicalTaskID, error) }
NodeInfo defines an interface to interact with DC/OS cluster via go methods.
type Option ¶
type Option func(*dcosInfo) error
Option is a functional option that configures a Reader.
func OptionClusterIDFile ¶
OptionClusterIDFile sets a path to cluster-id file.
func OptionDetectIP ¶
OptionDetectIP sets the location of detectIP script.
func OptionDetectIPTimeout ¶
OptionDetectIPTimeout update timeout for detect_ip command.
func OptionLeaderDNSRecord ¶
OptionLeaderDNSRecord sets a mesos leader dns entry.
func OptionMesosStateURL ¶
OptionMesosStateURL sets a domain name to make a get request to /mesos/state in order to retrieve mesos state.json.
type Slave ¶
type Slave struct { ID string `json:"id"` Hostname string `json:"hostname"` Port int `json:"port"` Pid string `json:"pid"` }
Slave is a field in state.json
type State ¶
type State struct { ID string `json:"id"` Slaves []Slave `json:"slaves"` Frameworks []Framework `json:"frameworks"` CompletedFrameworks []Framework `json:"completed_frameworks"` }
State stands for mesos state.json available via /mesos/master/state.json
type Status ¶
type Status struct {
ContainerStatus ContainerStatus `json:"container_status"`
}
Status is a field in state.json
type Task ¶
type Task struct { ID string `json:"id"` Name string `json:"name"` FrameworkID string `json:"framework_id"` ExecutorID string `json:"executor_id"` SlaveID string `json:"slave_id"` State string `json:"state"` Role string `json:"role"` Statuses []Status `json:"statuses"` }
Task is a field in state.json
func (Task) ContainerIDs ¶
ContainerIDs returns a slice of container ids , starting with the current, and then appending the parent container ids.