uuidcollection

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package uuidcollection provides collections keyed by UUID.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

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

Map is a map from uuidpb.UUID to values of type T.

func (*Map[T]) All

func (m *Map[T]) All() iter.Seq2[*uuidpb.UUID, T]

All yields all key/value pairs in the map.

func (*Map[T]) Clear

func (m *Map[T]) Clear()

Clear removes all elements from the map.

func (*Map[T]) Clone

func (m *Map[T]) Clone() *Map[T]

Clone returns a shallow copy of the map.

func (*Map[T]) Delete

func (m *Map[T]) Delete(k *uuidpb.UUID)

Delete removes the value associated with the given key.

func (*Map[T]) Get

func (m *Map[T]) Get(k *uuidpb.UUID) (T, bool)

Get returns the value associated with the given key.

func (*Map[T]) Has

func (m *Map[T]) Has(k *uuidpb.UUID) bool

Has reports whether the map contains a value for the given key.

func (*Map[T]) IsEmpty

func (m *Map[T]) IsEmpty() bool

IsEmpty returns true if the map contains no elements.

func (*Map[T]) Keys

func (m *Map[T]) Keys() iter.Seq[*uuidpb.UUID]

Keys yields all keys in the map.

func (*Map[T]) Len

func (m *Map[T]) Len() int

Len returns the number of elements in the map.

func (*Map[T]) Set

func (m *Map[T]) Set(k *uuidpb.UUID, v T)

Set sets the value associated with the given key.

func (*Map[T]) Values

func (m *Map[T]) Values() iter.Seq[T]

Values yields all values in the map.

type Set

type Set struct {
	// contains filtered or unexported fields
}

Set is a collection of uuidpb.UUID values.

func NewSet

func NewSet(values ...*uuidpb.UUID) *Set

NewSet creates a new set containing the given uuidpb.UUID values.

func (*Set) Add

func (s *Set) Add(v *uuidpb.UUID)

Add adds the given uuidpb.UUID to the set.

func (*Set) All

func (s *Set) All() iter.Seq[*uuidpb.UUID]

All yields all members of the set.

func (*Set) Clear

func (s *Set) Clear()

Clear removes all members from the set.

func (*Set) Clone

func (s *Set) Clone() *Set

Clone returns a shallow copy of the set.

func (*Set) DapperString

func (s *Set) DapperString() string

DapperString implements github.com/dogmatiq/dapper.Stringer.

func (*Set) Delete

func (s *Set) Delete(v *uuidpb.UUID)

Delete removes the given uuidpb.UUID from the set.

func (*Set) Delta

func (s *Set) Delta(x *Set) (add, remove *Set)

Delta returns the elements that need to be added to and removed from s to make it equal to x.

This is equivalent to calling s.Diff(x) for the remove set and x.Diff(s) for the add set.

func (*Set) Diff

func (s *Set) Diff(x *Set) *Set

Diff returns a new set containing the members of s that are not present in x.

func (*Set) GoString

func (s *Set) GoString() string

GoString returns a Go-syntax representation of the set.

func (*Set) Has

func (s *Set) Has(v *uuidpb.UUID) bool

Has reports whether the set contains the given uuidpb.UUID.

func (*Set) IsEmpty

func (s *Set) IsEmpty() bool

IsEmpty returns true if the set contains no members.

func (*Set) IsEqual

func (s *Set) IsEqual(x *Set) bool

IsEqual reports whether the set contains the same members as the given set.

func (*Set) Len

func (s *Set) Len() int

Len returns the number of members in the set.

func (*Set) String

func (s *Set) String() string

Jump to

Keyboard shortcuts

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