livelog

package
v0.0.0-...-b08115d Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(strategy strategy.Http) *client

Types

type Client

type Client interface {
	// Queries and returns the available nodes from the remote service.
	GetServiceNodeIds(ctx context.Context) ([]string, error)

	// Sets the node id to use when querying the remote service for log data.
	SetNodeId(nodeId string)

	// Queries and returns the livelog configuration from the remote service, based on the set node id.
	GetConfig(ctx context.Context) (*model.Config, error)

	// Sets the log file name to use when querying the remote service for log data.
	SetLogFileName(logFileName string)

	// Sets the refresh rate interval between each log request.
	SetLogsRefreshRate(logsRefreshRate time.Duration)

	// Writes a single log data snapshot from the remote service into the passed io.Writer.
	// The configured node id and log file name are used.
	// Any error during read or write is returned.
	CatLog(ctx context.Context, output io.Writer) error

	// Writes continuous log data snapshots from the remote service into the passed io.Writer,
	// on an interval set by the LogsRefreshRate, defaulting to 1 second.
	// The configured node id and log file name are used.
	// Any errors during read or write is returned.
	// NOTE: this call blocks until cancellation of the passed context.Context.
	TailLog(ctx context.Context, output io.Writer) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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