utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomUint

func GenerateRandomUint() uint32

func GenerateRandom_ByteArray

func GenerateRandom_ByteArray(count int) []byte

func GetCurrentDir

func GetCurrentDir() (string, error)

func WaitTimeout

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

waitTimeout waits for the waitgroup for the specified max timeout. Returns true if waiting timed out.

Types

type Buffer

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

func NewBuffer

func NewBuffer() *Buffer

func (*Buffer) Length

func (p *Buffer) Length() int

func (*Buffer) Read

func (p *Buffer) Read() ([]byte, int)

func (*Buffer) Write

func (p *Buffer) Write(content []byte) int

type Stack

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

func NewStack

func NewStack() *Stack

Create a new stack

func (*Stack) Count

func (p *Stack) Count() int

Return the number pof items in the stack

func (*Stack) NodesValue

func (p *Stack) NodesValue() []interface{}

func (*Stack) Peek

func (p *Stack) Peek() interface{}

View the top item on the stack

func (*Stack) Pop

func (p *Stack) Pop() interface{}

Pop the top item of the stack and return it

func (*Stack) Push

func (p *Stack) Push(value interface{})

Push a value onto the top of the stack

Jump to

Keyboard shortcuts

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