utils

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: MIT Imports: 12 Imported by: 0

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