lib

package
v4.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppDir added in v4.1.2

func AppDir() string

func AppName

func AppName() string

func HasIntersection added in v4.0.12

func HasIntersection[T comparable](aa []T, bb []T) bool

func Intersection added in v4.0.12

func Intersection[T comparable](aa []T, bb []T) []T

func LoadYaml

func LoadYaml(filename string, cfg any) error

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

func StoreYaml

func StoreYaml(filename string, cfg any) error

func Union added in v4.0.12

func Union[T comparable](aa []T, bb []T) []T

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]) DeleteRaw added in v4.1.0

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

func (*Map[T]) Len

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 Pool

type Pool[T any] struct {
	Init int
	Cap  int
	Idle int
	New  func() T
	// contains filtered or unexported fields
}

func (*Pool[T]) Obtain

func (p *Pool[T]) Obtain(fn func()) 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