utils

package
v0.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PathSeparator = string(os.PathSeparator)
)

Variables

This section is empty.

Functions

func ContextLog

func ContextLog(ctx context.Context, log *zap.SugaredLogger) *zap.SugaredLogger

func GenerateNewID

func GenerateNewID() int64

func HandleTerminalSignal

func HandleTerminalSignal() chan struct{}

func Mkdir

func Mkdir(path string) error

func NewApiContext

func NewApiContext(r *http.Request) context.Context

func NewDateReader

func NewDateReader(reader io.Reader) io.ReadCloser

func RandString

func RandString(length int) (string, error)

func RandStringRunes

func RandStringRunes(n int) string

func Recover

func Recover() error

func Shutdown

func Shutdown()

Types

type LFUPool

type LFUPool struct {
	HandlerRemove func(k string, v interface{})
	// contains filtered or unexported fields
}

func NewLFUPool

func NewLFUPool(size int) *LFUPool

func (*LFUPool) Get

func (c *LFUPool) Get(key string) interface{}

func (*LFUPool) Put

func (c *LFUPool) Put(key string, val interface{})

func (*LFUPool) Remove

func (c *LFUPool) Remove(key string)

func (*LFUPool) Visit

func (c *LFUPool) Visit(fn func(k string, v interface{}))

type MaximumParallel

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

func NewMaximumParallel

func NewMaximumParallel(num int) *MaximumParallel

func (*MaximumParallel) BlockedGo

func (p *MaximumParallel) BlockedGo(f func())

func (*MaximumParallel) Go

func (p *MaximumParallel) Go(f func())

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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