logs

package
v0.5.17 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Poll

func Poll(ctx context.Context, out chan<- LogEntry, client WebClient, 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
	NoTail     bool
}

type LogStream

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

func NewNatsStream

func NewNatsStream(ctx context.Context, apiClient WebClient, flapsClient flapsutil.FlapsClient, opts *LogOptions) (LogStream, error)

func NewPollingStream

func NewPollingStream(client WebClient) LogStream

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
	}
}

type WebClient added in v0.3.41

type WebClient interface {
	GetAppLogs(ctx context.Context, appName, token, region, instanceID string) (entries []fly.LogEntry, nextToken string, err error)
	wireguard.WebClient
}

Jump to

Keyboard shortcuts

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