package setmatrix
import "github.com/dotcloud/docker/libnetwork/internal/setmatrix"
Index ¶
- type SetMatrix
- func (s *SetMatrix[T]) Cardinality(key string) (cardinality int, ok bool)
- func (s *SetMatrix[T]) Contains(key string, value T) (containsElement, setExists bool)
- func (s *SetMatrix[T]) Get(key string) ([]T, bool)
- func (s *SetMatrix[T]) Insert(key string, value T) (inserted bool, cardinality int)
- func (s *SetMatrix[T]) Keys() []string
- func (s *SetMatrix[T]) Remove(key string, value T) (removed bool, cardinality int)
- func (s *SetMatrix[T]) String(key string) (v string, ok bool)
Types ¶
type SetMatrix ¶
type SetMatrix[T comparable] struct { // contains filtered or unexported fields }
SetMatrix is a map of Sets. The zero value is an empty set matrix ready to use.
SetMatrix values are safe for concurrent use.
func (*SetMatrix[T]) Cardinality ¶
Cardinality returns the number of elements in the set for a key.
func (*SetMatrix[T]) Contains ¶
Contains is used to verify if an element is in a set for a specific key.
func (*SetMatrix[T]) Get ¶
Get returns the members of the set for a specific key as a slice.
func (*SetMatrix[T]) Insert ¶
Insert inserts the value in the set of a key and returns whether the value is inserted (was not already in the set) and the number of elements in the set.
func (*SetMatrix[T]) Keys ¶
Keys returns all the keys in the map.
func (*SetMatrix[T]) Remove ¶
Remove removes the value in the set for a specific key.
func (*SetMatrix[T]) String ¶
String returns the string version of the set. The empty string is returned if there is no set for key.
Source Files ¶
- Version
- v28.1.1+incompatible (latest)
- Published
- Apr 18, 2025
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 3 hours ago –
Tools for package owners.