renderer

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger added in v0.6.0

type Logger struct {
	// FilePathis the path to the log file which we write to.
	// Default is blank unless passed as a flag to the CLI.
	FilePath string

	// Details will log the headers with the request. Default is false unless the
	// flag is passed.
	Details bool

	// Address and Port are used for the start text
	Addr string
	Port int

	// Protocol is the protocol the web UI server will use.
	Protocol string
	// contains filtered or unexported fields
}

Logger outputs to a log file.

func (*Logger) Start added in v0.6.0

func (l *Logger) Start(wg *sync.WaitGroup, rp chan protocol.RequestPayload, q chan int, e chan int)

Start writes the initial server start to the log file.

type Printer

type Printer struct {
	// Spinner is a constant, we set it during the start method and can later stop it when we exit.
	Spinner *pterm.SpinnerPrinter

	// Details will output the headers with the request. Default is false unless the
	// flag is passed.
	Details bool
}

Printer is our CLI output that currently uses pterm. See https://github.com/pterm/pterm for more info on pterm.

func (*Printer) Start

func (p *Printer) Start(wg *sync.WaitGroup, rp chan protocol.RequestPayload, q chan int, e chan int)

Start renders the spinner and starts receive incoming requests from the channel.

type Renderer

type Renderer interface {
	// Start is called when we start our server.
	Start(*sync.WaitGroup, chan protocol.RequestPayload, chan int, chan int)
}

Renderer contains the interface which our servers use to render the output.

type Web added in v0.8.0

type Web struct {
	// Address is the address the web UI server will bind to.
	Address string

	// BuildInfo contains build information.
	BuildInfo map[string]string

	// Port is the port the web UI server will run on.
	Port int

	// Protocol is the protocol the web UI server will use.
	Protocol string

	// These are used for showing information about the request endpoint in the
	// web UI.
	ResponseCode int
	RequestAddr  string
	RequestPort  int

	StaticFiles http.FileSystem
	// contains filtered or unexported fields
}

Web is the renderer for the web UI.

func (*Web) Start added in v0.8.0

func (web *Web) Start(wg *sync.WaitGroup, rp chan protocol.RequestPayload, q chan int, e chan int)

Jump to

Keyboard shortcuts

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