lib

package
v3.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileInfo

func NewFileInfo(name string, size int64, mode fs.FileMode, modTime time.Time, isDir bool) fs.FileInfo

func RandomString

func RandomString(lenNum int) string

Types

type ExpireCache

type ExpireCache struct {
	Timeout int64
	// contains filtered or unexported fields
}

func (*ExpireCache) Delete

func (c *ExpireCache) Delete(key string)

func (*ExpireCache) Load

func (c *ExpireCache) Load(key string) (interface{}, bool)

func (*ExpireCache) Store

func (c *ExpireCache) Store(key string, value interface{})
type LinkList[T any] struct {
	// contains filtered or unexported fields
}

func (*LinkList[T]) Add

func (l *LinkList[T]) Add(v T, num int)

func (*LinkList[T]) Dequeue

func (l *LinkList[T]) Dequeue()

func (*LinkList[T]) Enqueue

func (l *LinkList[T]) Enqueue(v T)

func (*LinkList[T]) Get

func (l *LinkList[T]) Get(index int) T

func (*LinkList[T]) GetAll

func (l *LinkList[T]) GetAll() []T

func (*LinkList[T]) Pop

func (l *LinkList[T]) Pop()

func (*LinkList[T]) Push

func (l *LinkList[T]) Push(v T)

func (*LinkList[T]) Remove

func (l *LinkList[T]) Remove(index int)

func (*LinkList[T]) Size

func (l *LinkList[T]) Size() int

func (*LinkList[T]) Walk

func (l *LinkList[T]) Walk(fn func(v T) bool)

type Map

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

func (*Map[T]) Delete

func (c *Map[T]) Delete(name string)

func (*Map[T]) Len added in v3.1.0

func (c *Map[T]) Len() int

func (*Map[T]) Load

func (c *Map[T]) Load(name string) *T

func (*Map[T]) Range

func (c *Map[T]) Range(iterator func(name string, item *T) bool)

func (*Map[T]) Store

func (c *Map[T]) Store(name string, value *T)

type RingBuffer

type RingBuffer[T any] struct {
	Size   int32
	Reader int32
	Writer int32
	Buffer []T
}

func NewRingBuffer

func NewRingBuffer[T any](size int) *RingBuffer[T]

func (*RingBuffer[T]) Latest

func (r *RingBuffer[T]) Latest() T

func (*RingBuffer[T]) Oldest

func (r *RingBuffer[T]) Oldest() T

func (*RingBuffer[T]) Overwrite

func (r *RingBuffer[T]) Overwrite(v T)

func (*RingBuffer[T]) Read

func (r *RingBuffer[T]) Read() T

func (*RingBuffer[T]) Write

func (r *RingBuffer[T]) Write(value T)

type Values

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

func (*Values) Clear

func (p *Values) Clear()

func (*Values) Get

func (p *Values) Get(id string) any

func (*Values) GetAll

func (p *Values) GetAll() any

func (*Values) Merge

func (p *Values) Merge(props map[string]any)

func (*Values) Put

func (p *Values) Put(id string, val any)

Jump to

Keyboard shortcuts

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