client

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package client implement remote client to get and print records

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIParams

type APIParams struct {
	UpdateInterval   time.Duration
	Client           *http.Client
	API              string
	RepeaterStrategy strategy.Interface
}

APIParams define how and where access remote endpoint

type CLI

type CLI struct {
	DisplayParams
	APIParams
}

CLI is a client accessing remote dkll rest and printing output.

func NewCLI

func NewCLI(apiParams APIParams, displayParams DisplayParams) *CLI

NewCLI makes cli client

func (*CLI) Activate

func (c *CLI) Activate(ctx context.Context, request core.Request) (req core.Request, err error)

Activate shows tail-like, colorized output. For FollowMode will run endless loop doesn't return error on context cancellation, but exit func.

type DisplayParams

type DisplayParams struct {
	ShowPid    bool           // include pid
	ShowTS     bool           // include time stamp as "2006-01-02 15:04:05.999999" in given TZ
	FollowMode bool           // follow mode, like -f in grep
	TailMode   bool           // tail mode, like -t in grep
	ShowSyslog bool           // show non-docker messages from syslog, off by default
	Grep       []string       // filter the final output line
	UnGrep     []string       // inverse filter for the final output line
	TimeZone   *time.Location // custom TZ, default is local
	Out        io.Writer      // custom out stream, default is stdout
}

DisplayParams customizes how records will be showed

Jump to

Keyboard shortcuts

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