util

package
v0.0.0-...-d687121 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](s []T, e T) bool

func GetOutboundIP

func GetOutboundIP() net.IP

func GetStdLogger

func GetStdLogger(parent *zap.Logger, sub string) *log.Logger

func LimitBody

func LimitBody(size int64) func(h http.Handler) http.Handler

func Must

func Must[V any](value V, err error) V

func RandomTimeRange

func RandomTimeRange(interval time.Duration) time.Duration

RandomTimeRange returns time.Duration between [interval/2, interval] randomly

Types

type BufferPool

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

func NewBufferPool

func NewBufferPool(size int) *BufferPool

func (*BufferPool) Get

func (b *BufferPool) Get() []byte

func (*BufferPool) Put

func (b *BufferPool) Put(buf []byte)

Directories

Path Synopsis
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

Jump to

Keyboard shortcuts

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