client

package
v0.0.0-...-c283e9f Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: BSD-3-Clause Imports: 10 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("logaggregator: resource not found")

ErrNotFound is returned when a resource is not found (HTTP status 404).

Functions

This section is empty.

Types

type Client

type Client struct {
	*httpclient.Client
}

func New

func New(uri string) (*Client, error)

NewClient creates a new Client pointing at uri.

func NewWithHTTP

func NewWithHTTP(uri string, httpClient *http.Client) (*Client, error)

NewClient creates a new Client pointing at uri with the specified http client.

func (*Client) GetCursors

func (c *Client) GetCursors() (map[string]utils.HostCursor, error)

func (*Client) GetLog

func (c *Client) GetLog(channelID string, opts *logagg.LogOpts) (io.ReadCloser, error)

GetLog returns a ReadCloser log stream of the log channel with ID channelID. Each line returned will be a JSON serialized Message.

If lines is above zero, the number of lines returned will be capped at that value. Otherwise, all available logs are returned. If follow is true, new log lines are streamed after the buffered log.

func (*Client) GetSnapshot

func (c *Client) GetSnapshot() (io.ReadCloser, error)

type Message

type Message struct {
	// Hostname is the host that the job was running on when this log message was
	// emitted.
	HostID string `json:"host_id,omitempty"`
	// JobID is the ID of the job that emitted this log message.
	JobID string `json:"job_id,omitempty"`
	// Msg is the actual content of this log message.
	Msg string `json:"msg,omitempty"`
	// ProcessType is the type of process that emitted this log message.
	ProcessType string `json:"process_type,omitempty"`
	// Source is the source of this log message, such as "app" or "router".
	Source string `json:"source,omitempty"`
	// Stream is the I/O stream that emitted this message, such as "stdout" or
	// "stderr".
	Stream logagg.StreamType `json:"stream,omitempty"`
	// Timestamp is the time that this log line was emitted.
	Timestamp time.Time `json:"timestamp,omitempty"`
}

Message represents a single log message.

Jump to

Keyboard shortcuts

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