lia

package
v1.46.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TUI

func TUI(ctx context.Context, rec Recorder) error

Types

type Option

type Option func(*rec)

func Addr

func Addr(s string) Option

func BundlePath

func BundlePath(p string) Option

func Duration

func Duration(d time.Duration) Option

func Equals

func Equals(b bool) Option

func Fail

func Fail(b bool) Option

func Output

func Output(sink, fmt string) Option

func Rate

func Rate(s float64) Option

func TLS

func TLS(caCert, cert, key string, skip bool) Option

func WithReport

func WithReport(rs ...ReportOption) Option

type Recorder

type Recorder interface {
	Run(context.Context) (Report, error)
	Output(context.Context, Report) error

	ToStdout() bool
	Duration() time.Duration
	Format() format
}

func New

func New(opts ...Option) Recorder

type Report

type Report interface {
	Output(context.Context, io.Writer, format) error
	ToCSV(context.Context, io.Writer) error
	ToJSON(context.Context, io.Writer) error
	ToPretty(context.Context, io.Writer) error

	Count(context.Context) int

	fmt.Stringer
}

func ReportFromReader

func ReportFromReader(ctx context.Context, r io.Reader, opts ...ReportOption) (Report, error)

ReportFromReader reads JSON lines from a reader, and closes it when done if it is an io.ReadCloser (such as resp.Body).

type ReportOption

type ReportOption func(*report)

func Grouped

func Grouped(b bool) ReportOption

func Limit

func Limit(n int) ReportOption

Jump to

Keyboard shortcuts

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