utils

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dummy

func Dummy[T any]() T

func MapOnStruct

func MapOnStruct[T any](rawJson map[string]any) (T, error)

func Ptr

func Ptr[T any](x T) *T

func PythonMod

func PythonMod(a, b int) int

func WaitGroupChan added in v1.1.0

func WaitGroupChan(wg *sync.WaitGroup) chan struct{}

func WaitTimeout added in v1.1.0

func WaitTimeout(wg *sync.WaitGroup, timeout time.Duration) bool

return true on timeout

Types

type CircularBuffer

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

func MakeCircularBuffer

func MakeCircularBuffer[T any](capacity int) CircularBuffer[T]

func (*CircularBuffer[T]) Back

func (cb *CircularBuffer[T]) Back() T

func (*CircularBuffer[T]) Empty

func (cb *CircularBuffer[T]) Empty() bool

func (*CircularBuffer[T]) Front

func (cb *CircularBuffer[T]) Front() T

func (*CircularBuffer[T]) Full

func (cb *CircularBuffer[T]) Full() bool

func (*CircularBuffer[T]) Push

func (cb *CircularBuffer[T]) Push(value T)

func (*CircularBuffer[T]) Size

func (cb *CircularBuffer[T]) Size() int

Jump to

Keyboard shortcuts

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