Help us shape the future of Go! Take the 2026 Go Developer Survey

sets

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Safe

type Safe[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func (*Safe[K, V]) Each

func (s *Safe[K, V]) Each(cb func(a V) bool)

func (*Safe[K, V]) Exists

func (s *Safe[K, V]) Exists(x K) bool

func (*Safe[K, V]) First

func (s *Safe[K, V]) First() *V

func (*Safe[K, V]) Get

func (s *Safe[K, V]) Get(x K) *V

func (*Safe[K, V]) Last

func (s *Safe[K, V]) Last() *V

func (*Safe[K, V]) MarshalJSON

func (s *Safe[K, V]) MarshalJSON() ([]byte, error)

func (*Safe[K, V]) PushEnd

func (s *Safe[K, V]) PushEnd(x V)

func (*Safe[K, V]) PushStart

func (s *Safe[K, V]) PushStart(x V)

func (*Safe[K, V]) Remove

func (s *Safe[K, V]) Remove(x K)

func (*Safe[K, V]) RemoveFirst

func (s *Safe[K, V]) RemoveFirst() (x *V)

func (*Safe[K, V]) RemoveLast

func (s *Safe[K, V]) RemoveLast() (x *V)

func (*Safe[K, V]) Reset

func (s *Safe[K, V]) Reset()

func (*Safe[K, V]) Size

func (s *Safe[K, V]) Size() int

func (*Safe[K, V]) UnmarshalJSON

func (s *Safe[K, V]) UnmarshalJSON(data []byte) error

type Set

type Set[K comparable, V any] interface {
	PushStart(x V)
	PushEnd(x V)
	Size() int
	RemoveFirst() (x *V)
	RemoveLast() (x *V)
	Remove(x K)
	Exists(x K) bool
	Get(x K) *V
	First() *V
	Last() *V
	Each(cb func(a V) bool)
	Reset()
	UnmarshalJSON(data []byte) error
	MarshalJSON() ([]byte, error)
}

func NewCustomSet

func NewCustomSet[K comparable, V any](handler getKeyFunc[K, V]) Set[K, V]

func NewLimitedCustomSet

func NewLimitedCustomSet[K comparable, V any](handler getKeyFunc[K, V], limit int) Set[K, V]

type Unsafe

type Unsafe[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func (*Unsafe[K, V]) Each

func (u *Unsafe[K, V]) Each(cb func(a V) bool)

func (*Unsafe[K, V]) Exists

func (u *Unsafe[K, V]) Exists(x K) bool

func (*Unsafe[K, V]) First

func (u *Unsafe[K, V]) First() *V

func (*Unsafe[K, V]) Get

func (u *Unsafe[K, V]) Get(x K) *V

func (*Unsafe[K, V]) Last

func (u *Unsafe[K, V]) Last() *V

func (*Unsafe[K, V]) MarshalJSON

func (u *Unsafe[K, V]) MarshalJSON() ([]byte, error)

func (*Unsafe[K, V]) PushEnd

func (u *Unsafe[K, V]) PushEnd(x V)

func (*Unsafe[K, V]) PushStart

func (u *Unsafe[K, V]) PushStart(x V)

func (*Unsafe[K, V]) Remove

func (u *Unsafe[K, V]) Remove(x K)

func (*Unsafe[K, V]) RemoveFirst

func (u *Unsafe[K, V]) RemoveFirst() (x *V)

func (*Unsafe[K, V]) RemoveLast

func (u *Unsafe[K, V]) RemoveLast() (x *V)

func (*Unsafe[K, V]) Reset

func (u *Unsafe[K, V]) Reset()

func (*Unsafe[K, V]) Size

func (u *Unsafe[K, V]) Size() int

func (*Unsafe[K, V]) UnmarshalJSON

func (u *Unsafe[K, V]) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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