render

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	C = "Client"
	V = "Varnish"
	H = "Cache"
	B = "Backend"
)

Actors

View Source
const (
	ColorReq    = "#998800"
	ColorBereq  = "#008899"
	ColorError  = "#991111"
	ColorCall   = "#555599"
	ColorReturn = "#995599"
	ColorHit    = "#115F00"
	ColorGray   = "#707070"
	ColorTrack  = "#492020"
)

Colors

Variables

This section is empty.

Functions

func HTMLHeadersTable

func HTMLHeadersTable(ts vsl.TransactionSet, tx *vsl.Transaction) []string

HTMLHeadersTable returns an HTML table with HTTP header states

func ParseBackend

func ParseBackend(s string) (host, port string, err error)

ParseBackend parses "<HOST/IP>:<PORT>" where HOST may be a hostname,

IPv4, or IPv6 (possibly unbracketed). Returns host and port separately.

func Sequence

func Sequence(ts vsl.TransactionSet, root *vsl.Transaction, cfg SequenceConfig) string

Sequence returns a sequence diagram rendered as an SVG image.

func Timeline

func Timeline(ts vsl.TransactionSet, root *vsl.Transaction, precision, numTicks int) string

Timeline generates an SVG timeline

func TxTreeHTML

func TxTreeHTML(ts vsl.TransactionSet, root *vsl.Transaction) string

Types

type Backend

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

func NewBackend

func NewBackend(host string, port string) *Backend

type HTTPRequest

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

func NewHTTPRequest

func NewHTTPRequest(tx *vsl.Transaction, received bool, excludedHeaders []string) (*HTTPRequest, error)

NewHTTPRequest constructs an HTTPRequest from a Varnish transaction. Returns nil if the transaction type is session.

If received is true, initial (received) headers are used; otherwise, headers after VCL processing. excludedHeaders can contain an slice of strings, each one must be a header name

func (*HTTPRequest) CurlCommand

func (r *HTTPRequest) CurlCommand(scheme string, backend *Backend) string

CurlCommand generates a new curl command as a string

scheme can be "auto", "http://" or "https://"

func (HTTPRequest) Headers

func (r HTTPRequest) Headers() []Header

func (*HTTPRequest) HurlFile added in v0.4.7

func (r *HTTPRequest) HurlFile(scheme string, backend *Backend) string

HurlFile generates a new hurl file as a string

scheme can be "auto", "http://" or "https://"

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

func (Header) Name

func (h Header) Name() string

func (Header) Value

func (h Header) Value() string

type SequenceConfig

type SequenceConfig struct {
	Distance        int  // distance between actors
	StepHeight      int  // height between each step
	IncludeCalls    bool // whether to include all VCL calls
	IncludeReturns  bool // whether to include all VCL returns
	IncludeVCLLogs  bool // whether to include all VCL Logs
	TrackURLAndHost bool // whether to track all modifications to the URL and Host
}

type TimelineEvent

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

Jump to

Keyboard shortcuts

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