utils

package
v0.0.0-...-f2447f8 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const UA = "Mozilla/5.0 (Windows NT 10.0; rv:123.0) Gecko/20100101 Firefox/123.0"

Variables

This section is empty.

Functions

func CleanBody

func CleanBody(body string) string

func MustHeaders

func MustHeaders(next http.Handler) http.Handler

func RenderTemplate

func RenderTemplate(w http.ResponseWriter, t templ.Component, l *Logger)

func SendRequest

func SendRequest(u string) (*http.Response, error)

func TrimText

func TrimText(text string, keep int) string

func TrimURL

func TrimURL(u string) string

Types

type Logger

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

func NewLogger

func NewLogger(w io.WriteCloser) *Logger

func (*Logger) Error

func (l *Logger) Error(f string, args ...any)

func (*Logger) Fatal

func (l *Logger) Fatal(f string, args ...any)

func (*Logger) Info

func (l *Logger) Info(f string, args ...any)

Jump to

Keyboard shortcuts

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