sync

package
v0.7.13 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSlice

func NewSlice[T bcts.ReadWriter[any]]() *slice[T]

Types

type Map

type Map[BT any, T bcts.ReadWriter[BT]] struct {
	// contains filtered or unexported fields
}

func MapFromReader added in v0.7.7

func MapFromReader[BT any, T bcts.ReadWriter[BT]](r io.Reader) (*Map[BT, T], error)

func NewMap

func NewMap[BT any, T bcts.ReadWriter[BT]]() *Map[BT, T]

func (*Map[BT, T]) CompareAndSwap

func (s *Map[BT, T]) CompareAndSwap(
	key bcts.TinyString,
	n T,
	swap func(stored T) bool,
) (swapped bool)

func (*Map[BT, T]) Delete

func (s *Map[BT, T]) Delete(key bcts.TinyString)

func (*Map[BT, T]) Get

func (s *Map[BT, T]) Get(key bcts.TinyString) (data T, ok bool)

func (*Map[BT, T]) GetMap

func (s *Map[BT, T]) GetMap() (data map[bcts.TinyString]T)

func (*Map[BT, T]) GetOrInit

func (s *Map[BT, T]) GetOrInit(key bcts.TinyString, init func() T) (T, bool)

func (*Map[BT, T]) ReadBytes added in v0.7.7

func (s *Map[BT, T]) ReadBytes(r io.Reader) (err error)

func (*Map[BT, T]) Set

func (s *Map[BT, T]) Set(key bcts.TinyString, data T)

func (*Map[BT, T]) WriteBytes added in v0.7.7

func (s *Map[BT, T]) WriteBytes(w io.Writer) (err error)

type Obj

type Obj[T any] interface {
	Set(data T)
	Get() (data T)
	Swap(inn T) (out T)
}

func NewObj

func NewObj[T any]() Obj[T]

type Que

type Que[T any, RT bcts.ReadWriter[T]] struct {
	// contains filtered or unexported fields
}

func NewQue

func NewQue[BT any, T bcts.ReadWriter[BT]]() *Que[BT, T]

func QueFromReader added in v0.7.7

func QueFromReader[BT any, T bcts.ReadWriter[BT]](r io.Reader) (*Que[BT, T], error)

func (*Que[BT, T]) Delete

func (s *Que[BT, T]) Delete(is func(v T) bool)

func (*Que[BT, T]) HasData

func (s *Que[BT, T]) HasData() <-chan struct{}

func (*Que[BT, T]) Peek

func (s *Que[BT, T]) Peek() (data T, ok bool)

func (*Que[BT, T]) Pop

func (s *Que[BT, T]) Pop() (data T, ok bool)

func (*Que[BT, T]) Push

func (s *Que[BT, T]) Push(data T)

func (*Que[BT, T]) ReadBytes added in v0.7.7

func (s *Que[BT, T]) ReadBytes(r io.Reader) (err error)

func (*Que[BT, T]) WriteBytes added in v0.7.7

func (s *Que[BT, T]) WriteBytes(w io.Writer) (err error)

type SLK

type SLK interface {
	Add(key string, timeout time.Duration)
	Get(key string) (ok bool)
	Delete(key string)
}

func NewSLK

func NewSLK() SLK

type Stack

type Stack[T any, RT bcts.ReadWriter[T]] struct {
	// contains filtered or unexported fields
}

func NewStack

func NewStack[T any, RT bcts.ReadWriter[T]]() *Stack[T, RT]

func (*Stack[T, RT]) Peek

func (s *Stack[T, RT]) Peek() (data RT, ok bool)

func (*Stack[T, RT]) Pop

func (s *Stack[T, RT]) Pop() (data RT, ok bool)

func (*Stack[T, RT]) Push

func (s *Stack[T, RT]) Push(data RT)

func (*Stack[T, RT]) ReadBytes added in v0.7.7

func (s *Stack[T, RT]) ReadBytes(r io.Reader) (err error)

func (*Stack[T, RT]) WriteBytes added in v0.7.7

func (s *Stack[T, RT]) WriteBytes(w io.Writer) (err error)

Jump to

Keyboard shortcuts

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