w3utils

package
v0.1.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: ISC Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpRequest

func DumpRequest(r *http.Request) string

Credit: github.com/gin-gonic/gin/recovery.go

func DumpStack

func DumpStack() string

Credit: github.com/gin-gonic/gin/recovery.go

func GetFunctionName

func GetFunctionName(function any) string

func IsStateModifyingMethod

func IsStateModifyingMethod(method string) bool

func SafeUint8

func SafeUint8(n int) uint8

func SupportsColoredOutput

func SupportsColoredOutput(file *os.File) bool

Types

type Pool

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

A fixed-capacity object pool with a dense stack free-list. Designed to have minimum memory allocation per request

func NewPool

func NewPool[T any](n uint16, factory func() T) *Pool[T]

Refer to Pool for documentation

func (*Pool[T]) Acquire

func (pool *Pool[T]) Acquire() uint16

Acquire an index to an available object. Waits when no object is available

func (*Pool[T]) AcquireObject

func (pool *Pool[T]) AcquireObject() (uint16, *T)

Sugarcode for calling Pool.Acquire and Pool.Release

func (*Pool[T]) Get

func (pool *Pool[T]) Get(index uint16) *T

Simply get the reference to an object. Not to be mistaken with Pool.Acquire

func (*Pool[T]) Release

func (pool *Pool[T]) Release(index uint16)

Release an object back into the pool

Jump to

Keyboard shortcuts

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