output

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewHTTPRequest = events.NewHTTPRequest

Functions

func DisplayProgress

func DisplayProgress(ctx context.Context, prog *atomic.Int64, period time.Duration, host string, total int64) func()

func DisplaySpinner

func DisplaySpinner(ctx context.Context, period time.Duration, prefix, succ string, charSet []string) func()

func GetBufferedWriteCloser

func GetBufferedWriteCloser(ctx context.Context) io.WriteCloser

func GetFormatAndOpts

func GetFormatAndOpts(ctx context.Context) (string, map[string]struct{})

func IncludeBody

func IncludeBody(ctx context.Context)

func InvocationInfo

func InvocationInfo(ctx context.Context, cmd *cobra.Command, args []string)

func IsPrintable

func IsPrintable(err error) bool

func NewBufferedReader

func NewBufferedReader(ctx context.Context, r io.Reader) (io.Reader, *bytes.Buffer)

func NewBufferedWriter

func NewBufferedWriter(ctx context.Context, w io.Writer) (io.Writer, func() []byte)

func NoColor

func NoColor(ctx context.Context)

func Quiet

func Quiet(ctx context.Context)

func ReceivingToStdout

func ReceivingToStdout(ctx context.Context)

ReceivingToStdout ensures that only the appropriate content is sent to stdout. The summary is flagged to be skipped and if outputting json, make sure we have initiated the buffer that holds the received content.

func RestoreCursor

func RestoreCursor(ctx context.Context)

func SetEventsChan

func SetEventsChan(ctx context.Context, ec chan events.Event)

func SetFormat

func SetFormat(ctx context.Context, f string)

func SetFormatOpts

func SetFormatOpts(ctx context.Context, opts ...string)

func UsageErrorF

func UsageErrorF(format string, args ...interface{}) error

func Wait

func Wait(ctx context.Context)

func WithOutput

func WithOutput(ctx context.Context) (context.Context, error)

func WrapPrintable

func WrapPrintable(err error) error

func WriteListeningOn

func WriteListeningOn(ctx context.Context, addr string)

func WriteListeningOnQR

func WriteListeningOnQR(ctx context.Context, addr string)

Types

type ClientSession

type ClientSession struct {
	Request  *events.HTTPRequest  `json:",omitempty"`
	File     *events.File         `json:",omitempty"`
	Response *events.HTTPResponse `json:",omitempty"`
	Error    string               `json:",omitempty"`
}

type PrintableError

type PrintableError struct {
	Err error
}

func (*PrintableError) Error

func (h *PrintableError) Error() string

func (*PrintableError) Unwrap

func (h *PrintableError) Unwrap() error

type Report

type Report struct {
	Success  *ClientSession   `json:",omitempty"`
	Attempts []*ClientSession `json:",omitempty"`
}

type ResponseWriter

type ResponseWriter struct {
	W         http.ResponseWriter
	BufferedW io.Writer
	// contains filtered or unexported fields
}

func (*ResponseWriter) Header

func (w *ResponseWriter) Header() http.Header

func (*ResponseWriter) Write

func (w *ResponseWriter) Write(p []byte) (int, error)

func (*ResponseWriter) WriteHeader

func (w *ResponseWriter) WriteHeader(statusCode int)

type UsageError

type UsageError struct {
	Err error
}

func (UsageError) Error

func (n UsageError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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