common

package module
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2025 License: Unlicense Imports: 0 Imported by: 2

README

WIP

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparable

type Comparable[T any] interface {
	Before(comparable T) bool
	Equal(comparable T) bool
	After(comparable T) bool
	Compare(comparable T) int
}

type Configurable

type Configurable[T any] interface {
	SetConfig(config T) error
}

type Cursor

type Cursor[T UnixTimestamped] interface {
	Cursor() T
	Seek(pointUnixTime int64) error
	Start() error
	Previous() bool
	Next() (bool, error)
	End() error
	Point() int64
}

type Freelist

type Freelist[T any] interface {
	Get() (*T, bool)
	Release(id uint) bool
	Len() int
	Cap() int
}

type Identifiable

type Identifiable[T comparable] interface {
	ID() T
}

type Log

type Log[T UnixTimestamped] interface {
	Append(element T) error
	Tail() (T, bool)

	NewCursorBefore(endUnixTime int64) (Cursor[T], error)
	NewCursorAt(floorUnixTime int64) (Cursor[T], error)
	NewCursorAfter(startUnixTime int64) (Cursor[T], error)
}

type Map

type Map[K, V any] interface {
	Set(key K, value V) error
	Get(key K) (V, error)
	Has(key K) bool
	Delete(key K) error
	ForEach(yield func(K, V) bool)
}

type Queue

type Queue[T Comparable[T]] interface {
	Push(element T) bool
	Pop() (T, bool)
	Peek() (T, bool)
	Remove(element T) bool
	Len() int
	Cap() int
}

type Registry

type Registry[K comparable, V any] interface {
	Get(key K) (V, error)
	Release(key K) bool
	Claim(key K) bool
	ClaimOrRegister(key K, new func() V) (V, bool)
}

type Set

type Set[T Comparable[T]] interface {
	Put(element T) error
	Get(element T) (T, error)
	Delete(element T) error
	ForEach(yield func(T) bool)
}

type Standard

type Standard[T any, I comparable] interface {
	Comparable[T]
	Identifiable[I]
}

type UnixTimestamped

type UnixTimestamped interface {
	UnixNano() int64
}

Jump to

Keyboard shortcuts

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