util

package
v0.0.0-...-18618f5 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectContentType

func DetectContentType(data string) string

DetectContentType detects HTTP content type based on provided POST data

func IsTerminal

func IsTerminal(file *os.File) bool

IsTerminal checks whether file is a terminal

func ParseCookies

func ParseCookies(cookies string) (cookSlice []*http.Cookie, err error)

ParseCookies parses cookies in raw string format into net/http format

func RandomSlice

func RandomSlice(len int) []byte

RandomSlice generates random slice of bytes with specified length

func ReverseString

func ReverseString(in string) string

ReverseString returns reverse of a string (does not support runes)

func TerminalWidth

func TerminalWidth() (int, error)

TerminalWidth determines width of current terminal in characters

Types

This section is empty.

Jump to

Keyboard shortcuts

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