structx

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitmap added in v1.4.0

type Bitmap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Bitmap

func NewBitmap added in v1.4.0

func NewBitmap() *Bitmap

func (*Bitmap) Add added in v1.4.0

func (b *Bitmap) Add(items ...uint32) (n int)

Add

func (*Bitmap) And added in v1.4.0

func (b *Bitmap) And(b2 *Bitmap) *Bitmap

And

func (*Bitmap) Clone added in v1.4.0

func (b *Bitmap) Clone() *Bitmap

Clone

func (*Bitmap) Flip added in v1.4.0

func (b *Bitmap) Flip(i uint64)

Flip

func (*Bitmap) Len added in v1.4.0

func (b *Bitmap) Len() uint64

Len

func (*Bitmap) MarshalBinary added in v1.4.0

func (b *Bitmap) MarshalBinary() ([]byte, error)

MarshalBinary

func (*Bitmap) Or added in v1.4.0

func (b *Bitmap) Or(b2 *Bitmap) *Bitmap

Or

func (*Bitmap) Remove added in v1.4.0

func (b *Bitmap) Remove(items ...uint32) (n int)

Remove

func (*Bitmap) Test added in v1.4.0

func (b *Bitmap) Test(i uint32) bool

Test

func (*Bitmap) ToArray added in v1.4.0

func (b *Bitmap) ToArray() []uint32

ToArray

func (*Bitmap) UnmarshalBinary added in v1.4.0

func (b *Bitmap) UnmarshalBinary(data []byte) error

UnmarshalBinary

func (*Bitmap) Xor added in v1.4.0

func (b *Bitmap) Xor(b2 *Bitmap) *Bitmap

Xor

type List

type List[V any] struct {
	// contains filtered or unexported fields
}

List implements a doubly-linked list.

func NewList

func NewList[V any]() *List[V]

NewList

func (*List[V]) Index

func (l *List[V]) Index(i int) (v V, ok bool)

Index

func (*List[V]) Keys added in v1.7.3

func (l *List[V]) Keys() []V

Keys

func (*List[V]) LPop

func (l *List[V]) LPop() (v V, ok bool)

LPop

func (*List[V]) LPush

func (l *List[V]) LPush(items ...V)

LPush

func (*List[V]) MarshalJSON

func (l *List[V]) MarshalJSON() ([]byte, error)

MarshalJSON

func (*List[V]) RPop

func (l *List[V]) RPop() (v V, ok bool)

RPop

func (*List[V]) RPush

func (l *List[V]) RPush(items ...V)

RPush

func (*List[V]) Size added in v1.7.1

func (l *List[V]) Size() int

Size

func (*List[V]) UnmarshalJSON

func (l *List[V]) UnmarshalJSON(src []byte) error

UnmarshalJSON

type Map

type Map[K comparable, V any] struct {
	*swiss.Map[K, V]
}

Map

func NewMap

func NewMap[K comparable, V any]() Map[K, V]

NewMap

func (*Map[K, V]) MarshalJSON

func (m *Map[K, V]) MarshalJSON() ([]byte, error)

MarshalJSON

func (*Map[K, V]) UnmarshalJSON

func (m *Map[K, V]) UnmarshalJSON(src []byte) error

UnmarshalJSON

type Ordered added in v1.7.3

type Ordered constraints.Ordered

type Set added in v1.4.0

type Set[T comparable] struct {
	mapset.Set[T]
}

Set

func NewSet added in v1.4.0

func NewSet[T comparable]() *Set[T]

NewSet

func (*Set[T]) Clone added in v1.5.0

func (s *Set[T]) Clone() *Set[T]

Clone

func (*Set[T]) Difference added in v1.5.0

func (s *Set[T]) Difference(other *Set[T])

Difference

func (*Set[T]) Intersect added in v1.5.0

func (s *Set[T]) Intersect(other *Set[T])

Intersect

func (*Set[T]) Union added in v1.5.0

func (s *Set[T]) Union(other *Set[T])

Union

type SyncMap

type SyncMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

SyncMap

func NewSyncMap

func NewSyncMap() *SyncMap

NewSyncMap

func (*SyncMap) Delete added in v1.4.0

func (m *SyncMap) Delete(key string) bool

Delete

func (*SyncMap) Get added in v1.4.0

func (m *SyncMap) Get(key string) (v []byte, ok bool)

Get

func (*SyncMap) Keys added in v1.4.0

func (m *SyncMap) Keys() (keys []string)

Keys

func (*SyncMap) Len added in v1.4.0

func (m *SyncMap) Len() (n int)

Len

func (*SyncMap) MarshalJSON

func (m *SyncMap) MarshalJSON() ([]byte, error)

MarshalJSON

func (*SyncMap) Set added in v1.4.0

func (m *SyncMap) Set(key string, value []byte)

Set

func (*SyncMap) UnmarshalJSON

func (m *SyncMap) UnmarshalJSON(src []byte) error

UnmarshalJSON

type ZSet

type ZSet[K, S Ordered] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ZSet

func NewZSet

func NewZSet[K, S Ordered]() *ZSet[K, S]

NewZSet

func (*ZSet[K, S]) Delete

func (z *ZSet[K, S]) Delete(key K) (s S, ok bool)

Delete

func (*ZSet[K, S]) Get added in v1.4.0

func (z *ZSet[K, S]) Get(key K) (S, bool)

Get

func (*ZSet[K, S]) Incr

func (z *ZSet[K, S]) Incr(key K, incr S) S

Incr

func (*ZSet[K, S]) Iter added in v1.4.0

func (z *ZSet[K, S]) Iter(f func(k K, s S) bool)

Iter iterate all elements by scores.

func (*ZSet[K, S]) Len

func (z *ZSet[K, S]) Len() int

Len

func (*ZSet[K, S]) MarshalJSON added in v1.2.0

func (z *ZSet[K, S]) MarshalJSON() ([]byte, error)

MarshalJSON

func (*ZSet[K, S]) Set

func (z *ZSet[K, S]) Set(key K, score S)

Set upsert value by key.

func (*ZSet[K, S]) UnmarshalJSON added in v1.2.0

func (z *ZSet[K, S]) UnmarshalJSON(src []byte) error

UnmarshalJSON

Jump to

Keyboard shortcuts

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