vlclient

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 16 Imported by: 0 modules, 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

This section is empty.

Types

type Config

type Config struct {
	URL     string
	Prefix  string
	Query   string
	Headers map[string]string

	Username string
	Password string

	Since time.Duration

	FailMaxDuration time.Duration

	Limit int
}

type Log

type Log struct {
	Message string    `json:"_msg"`
	Time    time.Time `json:"_time"`
}

Log represents a VictoriaLogs log line See: https://docs.victoriametrics.com/victorialogs/querying/#querying-logs

type VLClient

type VLClient struct {
	Logger *log.Entry
	// contains filtered or unexported fields
}

func NewVLClient

func NewVLClient(config Config) *VLClient

func (*VLClient) Get

func (lc *VLClient) Get(ctx context.Context, url string) (*http.Response, error)

func (*VLClient) QueryRange

func (lc *VLClient) QueryRange(ctx context.Context, infinite bool) chan *Log

QueryRange queries the logs See: https://docs.victoriametrics.com/victorialogs/querying/#querying-logs

func (*VLClient) Ready

func (lc *VLClient) Ready(ctx context.Context) error

func (*VLClient) SetTomb

func (lc *VLClient) SetTomb(t *tomb.Tomb)

func (*VLClient) Tail

func (lc *VLClient) Tail(ctx context.Context, c chan *Log) error

Tail sends live logs to c until the server closes the stream or ctx is canceled. It doesn't retry: the stream ending is returned as an error for the caller to handle. See: https://docs.victoriametrics.com/victorialogs/querying/#live-tailing

Jump to

Keyboard shortcuts

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