gstorage

package module
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enumerator

type Enumerator[T any] func(idx int, elem T) (action EnumeratorAction, err error)

type EnumeratorAction

type EnumeratorAction int
const (
	EnumeratorActionContinue EnumeratorAction = iota
	EnumeratorActionDelete
	EnumeratorActionFinish
)

type S

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

func New

func New[T any](capacity int) *S[T]

func (*S[T]) Add

func (s *S[T]) Add(o T)

func (*S[T]) Append added in v0.1.4

func (s *S[T]) Append(o *S[T])

func (*S[T]) Enumerate

func (s *S[T]) Enumerate(f Enumerator[T], forUpdate bool) (n int, err error)

func (*S[T]) FromJSONlist added in v0.1.6

func (s *S[T]) FromJSONlist(j []byte) (err error)

func (*S[T]) Get

func (s *S[T]) Get(idx int) (elem T, exists bool)

func (*S[T]) GetAll

func (s *S[T]) GetAll() []T

func (*S[T]) JSON added in v0.1.2

func (s *S[T]) JSON() (j []byte, err error)

func (*S[T]) JSONlist added in v0.1.5

func (s *S[T]) JSONlist() (j []byte, err error)

func (*S[T]) Len

func (s *S[T]) Len() int

func (*S[T]) Lock added in v0.1.2

func (s *S[T]) Lock()

func (*S[T]) Pop

func (s *S[T]) Pop() (elem T, exists bool)

func (*S[T]) RLock added in v0.1.2

func (s *S[T]) RLock()

func (*S[T]) RUnlock added in v0.1.2

func (s *S[T]) RUnlock()

func (*S[T]) Replace

func (s *S[T]) Replace(idx int, elem T) (err error)

func (*S[T]) Reset added in v0.1.3

func (s *S[T]) Reset(capacity int)

func (*S[T]) Set added in v0.1.4

func (s *S[T]) Set(o []T)

func (*S[T]) Unlock added in v0.1.2

func (s *S[T]) Unlock()

Jump to

Keyboard shortcuts

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