Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // KeepAlive sets the interval between keep-alive messages sent by the client to loggregator. KeepAlive = 25 * time.Second ErrNotFound = errors.New("/recent path not found or has issues") ErrBadResponse = errors.New("bad server response") ErrBadRequest = errors.New("bad client request") )
Functions ¶
func SortRecent ¶
SortRecent sorts a slice of LogMessages by timestamp. The sort is stable, so messages with the same timestamp are sorted in the order that they are received.
The input slice is sorted; the return value is simply a pointer to the same slice.
Types ¶
type DebugPrinter ¶
type DebugPrinter interface {
Print(title, dump string)
}
type DropsondeConsumer ¶
type DropsondeConsumer interface { // TailingLogs listens indefinitely for log messages. It returns two channels; the first is populated // with log messages, while the second contains errors (e.g. from parsing messages). It returns // immediately. Call Close() to terminate the connection when you are finished listening. // // Messages are presented in the order received from the loggregator server. Chronological or // other ordering is not guaranteed. It is the responsibility of the consumer of these channels // to provide any desired sorting mechanism. TailingLogs(appGuid string, authToken string) (<-chan *events.Envelope, error) /* Stream listens indefinitely for log and event messages. It returns two channels; the first is populated with log and event messages, while the second contains errors (e.g. from parsing messages). It returns immediately. Call Close() to terminate the connection when you are finished listening. Messages are presented in the order received from the loggregator server. Chronological or other ordering is not guaranteed. It is the responsibility of the consumer of these channels to provide any desired sorting mechanism. */ Stream(appGuid string, authToken string) (<-chan *events.Envelope, error) // Recent connects to loggregator via its 'recent' endpoint and returns a slice of recent messages. // It does not guarantee any order of the messages; they are in the order returned by loggregator. // // The SortRecent method is provided to sort the data returned by this method. RecentLogs(appGuid string, authToken string) ([]*events.Envelope, error) // Close terminates the websocket connection to loggregator. Close() error // SetOnConnectCallback sets a callback function to be called with the websocket connection is established. SetOnConnectCallback(func()) // SetDebugPrinter enables logging of the websocket handshake SetDebugPrinter(DebugPrinter) }
DropsondeConsumer represents the actions that can be performed against a loggregator server.
Click to show internal directories.
Click to hide internal directories.