output

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileWriter

type FileWriter struct {
	// contains filtered or unexported fields
}

func NewFileWriter

func NewFileWriter(url *url.URL, options *Options) *FileWriter

func (*FileWriter) Download

func (f *FileWriter) Download(resp *http.Response) error

func (*FileWriter) Filename

func (f *FileWriter) Filename() string

type HeaderPalette

type HeaderPalette struct {
	Method              aurora.Color
	URL                 aurora.Color
	Proto               aurora.Color
	SuccessfulStatus    aurora.Color
	NonSuccessfulStatus aurora.Color
	FieldName           aurora.Color
	FieldValue          aurora.Color
	FieldSeparator      aurora.Color
}

type JSONPalette

type JSONPalette struct {
	Key       aurora.Color
	String    aurora.Color
	Number    aurora.Color
	Boolean   aurora.Color
	Null      aurora.Color
	Delimiter aurora.Color
}

type Options

type Options struct {
	PrintRequestHeader  bool
	PrintRequestBody    bool
	PrintResponseHeader bool
	PrintResponseBody   bool

	EnableFormat bool
	EnableColor  bool

	Download   bool
	OutputFile string
	Overwrite  bool
}

type PlainPrinter

type PlainPrinter struct {
	BodyContent string
	// contains filtered or unexported fields
}

func (*PlainPrinter) GetPlainPrinter

func (p *PlainPrinter) GetPlainPrinter() Printer

func (*PlainPrinter) PrintBody

func (p *PlainPrinter) PrintBody(body io.Reader, contentType string) error

func (*PlainPrinter) PrintDownload

func (p *PlainPrinter) PrintDownload(length int64, filename string) error

func (*PlainPrinter) PrintHeader

func (p *PlainPrinter) PrintHeader(header http.Header) error

func (*PlainPrinter) PrintRequestLine

func (p *PlainPrinter) PrintRequestLine(req *http.Request) error

func (*PlainPrinter) PrintStatusLine

func (p *PlainPrinter) PrintStatusLine(proto string, status string, statusCode int) error

type PrettyPrinter

type PrettyPrinter struct {
	BodyContent string
	// contains filtered or unexported fields
}

func (*PrettyPrinter) GetPlainPrinter

func (p *PrettyPrinter) GetPlainPrinter() Printer

func (*PrettyPrinter) PrintBody

func (p *PrettyPrinter) PrintBody(body io.Reader, contentType string) error

func (*PrettyPrinter) PrintDownload

func (p *PrettyPrinter) PrintDownload(length int64, filename string) error

func (*PrettyPrinter) PrintHeader

func (p *PrettyPrinter) PrintHeader(header http.Header) error

func (*PrettyPrinter) PrintRequestLine

func (p *PrettyPrinter) PrintRequestLine(req *http.Request) error

func (*PrettyPrinter) PrintStatusLine

func (p *PrettyPrinter) PrintStatusLine(proto string, status string, statusCode int) error

type PrettyPrinterConfig

type PrettyPrinterConfig struct {
	Writer      io.Writer
	EnableColor bool
}

type Printer

type Printer interface {
	PrintStatusLine(proto string, status string, statusCode int) error
	PrintRequestLine(request *http.Request) error
	PrintHeader(header http.Header) error
	PrintBody(body io.Reader, contentType string) error
	PrintDownload(length int64, filename string) error
	GetPlainPrinter() Printer
}

func NewPlainPrinter

func NewPlainPrinter(writer io.Writer) Printer

func NewPrettyPrinter

func NewPrettyPrinter(config PrettyPrinterConfig) Printer

func NewPrinter

func NewPrinter(w io.Writer, options *Options) Printer

Jump to

Keyboard shortcuts

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