Documentation
¶
Index ¶
Constants ¶
View Source
const (
// default number of bytes shown per line in hex dumps.
HexDumpBytesPerLine = 16
)
Variables ¶
This section is empty.
Functions ¶
func Base64Lines ¶
Base64Lines wraps base64 output at a given width. Long base64 strings are unreadable and break terminal rendering, so we chunk them into lines like PEM files do.
func HexPreview ¶
Types ¶
type Body ¶ added in v1.10.2
func (Body) Name ¶ added in v1.10.2
Name tries to figure out a good filename for saving a response. Order: 1) Content-Disposition header 2) URL path 3) MIME type extension 4) Fallback to "response.bin"
func (Body) ViewerName ¶ added in v1.10.2
ViewerName returns a file name that is safe to open with the default app. The extension decides which app runs, so it always comes from fileTypes and never from the server. We look at the Content-Type first, then the file name the server sent, then the body bytes.
Click to show internal directories.
Click to hide internal directories.