util

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHttpClient

func DefaultHttpClient() *http.Client

func DefaultTransport added in v0.4.5

func DefaultTransport() *http.Transport

DefaultTransport returns the shared HTTP transport used by the default client, so callers can build their own *http.Client (e.g. with a cookie jar) while reusing the same connection pool and timeouts.

func ExtractLinksFromString

func ExtractLinksFromString(input string) []string

func IsValidUrl

func IsValidUrl(link string) bool

func JSONUnescape added in v0.5.0

func JSONUnescape(s string) string

JSONUnescape decodes a JSON string body (handling \/, \uXXXX, etc.) extracted from a larger document via regex. It returns the input unchanged if it is not a valid JSON string body.

Types

type Slice

type Slice[T any] struct {
	// contains filtered or unexported fields
}

func NewSlice

func NewSlice[T any]() *Slice[T]

func NewSliceWithLength

func NewSliceWithLength[T any](length int) *Slice[T]

func (*Slice[T]) Add

func (s *Slice[T]) Add(item T)

func (*Slice[T]) AddMany

func (s *Slice[T]) AddMany(items []T)

func (*Slice[T]) AddToIndex

func (s *Slice[T]) AddToIndex(index int, item T)

func (*Slice[T]) GetAll

func (s *Slice[T]) GetAll() []T

func (*Slice[T]) Len

func (s *Slice[T]) Len() int

Jump to

Keyboard shortcuts

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