utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 12 Imported by: 0 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 GenerateCertificate

func GenerateCertificate(host string) (*tls.Certificate, error)

GenerateCertificate generates a certificate for the specified domain

Types

type Queue

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

Queue represents a thread-safe queue

func NewQueue

func NewQueue[T any]() *Queue[T]

NewQueue creates a new thread-safe queue

func (*Queue[T]) Clear

func (q *Queue[T]) Clear()

Clear the queue

func (*Queue[T]) Dequeue

func (q *Queue[T]) Dequeue() (T, error)

Dequeue removes and returns the item at the front of the queue Returns an error if the queue is empty (non-blocking)

func (*Queue[T]) DequeueBlocking

func (q *Queue[T]) DequeueBlocking() T

DequeueBlocking removes and returns the item at the front of the queue Blocks until an item is available

func (*Queue[T]) Enqueue

func (q *Queue[T]) Enqueue(item T)

Enqueue adds an item to the end of the queue

func (*Queue[T]) IsEmpty

func (q *Queue[T]) IsEmpty() bool

IsEmpty checks if the queue is empty

func (*Queue[T]) Peek

func (q *Queue[T]) Peek() (T, error)

Peek returns the item at the front without removing it

func (*Queue[T]) Size

func (q *Queue[T]) Size() int

Size returns the number of items in the queue

Jump to

Keyboard shortcuts

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