util

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 4 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 StringToAnySlice

func StringToAnySlice(strings []string) []any

func YoloBytes added in v1.2.0

func YoloBytes(s string) []byte

func YoloString added in v1.2.0

func YoloString(p []byte) string

Types

type List

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

func (*List[T]) Len

func (l *List[T]) Len() int

func (*List[T]) PopBack

func (l *List[T]) PopBack(count int) []T

func (*List[T]) PopFront

func (l *List[T]) PopFront(count int) []T

func (*List[T]) PushBack

func (l *List[T]) PushBack(values ...T)

func (*List[T]) PushFront

func (l *List[T]) PushFront(values ...T)

func (*List[T]) Range

func (l *List[T]) Range(start, stop int) []T

type TTLItem

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

func (TTLItem[T]) Expiration

func (i TTLItem[T]) Expiration() time.Time

func (TTLItem[T]) Value

func (i TTLItem[T]) Value() T

type TTLQueue

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

func (*TTLQueue[T]) Clear

func (ttlq *TTLQueue[T]) Clear()

func (*TTLQueue[T]) Delete

func (ttlq *TTLQueue[T]) Delete(item *TTLItem[T])

func (*TTLQueue[T]) Len

func (ttlq *TTLQueue[T]) Len() int

func (*TTLQueue[T]) Peek

func (ttlq *TTLQueue[T]) Peek() *TTLItem[T]

func (*TTLQueue[T]) Pop

func (ttlq *TTLQueue[T]) Pop() *TTLItem[T]

func (*TTLQueue[T]) Push

func (ttlq *TTLQueue[T]) Push(value T, expiration time.Time) *TTLItem[T]

func (*TTLQueue[T]) Update

func (ttlq *TTLQueue[T]) Update(item *TTLItem[T], value T, expiration time.Time)

Jump to

Keyboard shortcuts

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