Documentation ¶
Index ¶
- Constants
- type LogOut
- type LogType
- type MesosClient
- func (c *MesosClient) GetAppNameForPath(path string) string
- func (c *MesosClient) GetAppNameForTaskID(taskID string) (string, error)
- func (c *MesosClient) GetAppNames() (map[string]int, error)
- func (c *MesosClient) GetLog(appID string, logtype LogType, dir string) ([]*LogOut, error)
- func (c *MesosClient) TailLog(appID string, logtype LogType, duration int) error
- func (c *MesosClient) TailLogToChannel(appID string, logtype LogType, duration int, target chan<- string, ...) error
- type MesosClientOptions
- type SortTasksByLatestTimestamp
Constants ¶
const ( // PageLength is the amount of data we want to consume during log tailing PageLength int = 5000 TailURIFmt string = "http://%s:5051/files/read.json?path=%s&offset=%v&length=%v" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogOut ¶
type LogOut struct { // AppID - the task name / application identifier AppID string // TaskID - the task identifier TaskID string // Log - filename of the outputted log when in download more or RAW log if request is to print to stdout Log string }
LogOut - struct which holds the result from getting Mesos logs
type MesosClient ¶
type MesosClient struct { Host string Port int MasterURL string State *masterState Options *MesosClientOptions }
MesosClient holds state about the current Master node. Allows method receivers to obtain these values
func NewMesosClient ¶
func NewMesosClient(host string, port int) (*MesosClient, error)
NewMesosClient - Creates a new MesosClient {host} - the host/ip of the mesos master node {port} - the port # of the mesos master node
func NewMesosClientWithOptions ¶
func NewMesosClientWithOptions(host string, port int, options *MesosClientOptions) (*MesosClient, error)
NewMesosClient - Creates a new MesosClient {host} - the host/ip of the mesos master node {port} - the port # of the mesos master node {options} - client options - optional
func (*MesosClient) GetAppNameForPath ¶
func (c *MesosClient) GetAppNameForPath(path string) string
func (*MesosClient) GetAppNameForTaskID ¶
func (c *MesosClient) GetAppNameForTaskID(taskID string) (string, error)
GetAppNameForTaskID - Attempts to find the Mesos Application name for the given TaskID {taskID} - the task identifier
func (*MesosClient) GetAppNames ¶
func (c *MesosClient) GetAppNames() (map[string]int, error)
GetAppNames - List all unique app names aka task names running in the Mesos cluster
func (*MesosClient) GetLog ¶
GetLog - Gets/Downloads logs for a [appID] {appID} - the task name / app identifier {logtype} - the desired log type STDOUT | STDERR {dir} - optional output dir which is used to download vs stdout
func (*MesosClient) TailLog ¶
func (c *MesosClient) TailLog(appID string, logtype LogType, duration int) error
TailLog - Tails the logs for a [appID] {appID} - the task name / app identifier {logtype} - the desired log type STDOUT | STDERR {duration} - poll frequency in seconds
func (*MesosClient) TailLogToChannel ¶
type MesosClientOptions ¶
type SortTasksByLatestTimestamp ¶
type SortTasksByLatestTimestamp []*mstateTask
func (SortTasksByLatestTimestamp) Len ¶
func (s SortTasksByLatestTimestamp) Len() int
func (SortTasksByLatestTimestamp) Less ¶
func (s SortTasksByLatestTimestamp) Less(i, j int) bool
func (SortTasksByLatestTimestamp) Swap ¶
func (s SortTasksByLatestTimestamp) Swap(i, j int)