util

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package util / render.go implements rendering of URLs as images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompactStack

func CompactStack() string

CompactStack returns a compact stack trace looking like: "package.function:line > package.function:line > ...".

func Dump

func Dump[T *http.Request | *http.Response](r T) ([]byte, error)

Dump returns a full dump of http request/response.

func LogStack

func LogStack(logger *log.Logger)

LogStack prints whole stack starting from where it was called to a given log

func RenderURL

func RenderURL(url string) ([]byte, error)

RenderURL renders a given URL as an image, returns bytes of the image file.

func Retry

func Retry(f func() error, attempts int, interval time.Duration) (err error)

Retry executes a function up to a specified number of attempts with a delay between attempts. Returns on the first success, or returns the last error encountered.

func SplitMsg

func SplitMsg(msg string, lengthLimit int) []string

SplitMsg splits a message into parts that are under lengthLimit characters. Splits by newlines or spaces if possible. Returns slice with at least one element.

Types

This section is empty.

Jump to

Keyboard shortcuts

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