logs

package
v0.0.343-pre-1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Poll added in v0.0.272

func Poll(ctx context.Context, out chan<- LogEntry, client *api.Client, opts *LogOptions) error

Types

type LogEntry

type LogEntry struct {
	Level     string `json:"level"`
	Instance  string `json:"instance"`
	Message   string `json:"message"`
	Region    string `json:"region"`
	Timestamp string `json:"timestamp"`
	Meta      Meta   `json:"meta"`
}

type LogOptions

type LogOptions struct {
	W io.Writer

	MaxBackoff time.Duration
	AppName    string
	VMID       string
	RegionCode string
}

type LogStream

type LogStream interface {
	Err() error
	Stream(ctx context.Context, opts *LogOptions) <-chan LogEntry
}

func NewNatsStream

func NewNatsStream(ctx context.Context, apiClient *api.Client, opts *LogOptions) (LogStream, error)

func NewPollingStream

func NewPollingStream(client *api.Client, opts *LogOptions) (LogStream, error)

type Meta

type Meta struct {
	Instance string
	Region   string
	Event    struct {
		Provider string
	}
	HTTP struct {
		Request struct {
			ID      string
			Method  string
			Version string
		}
		Response struct {
			StatusCode int `json:"status_code"`
		}
	}
	Error struct {
		Code    int
		Message string
	}
	URL struct {
		Full string
	}
}

Jump to

Keyboard shortcuts

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