sets

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Empty

type Empty struct{}

type String

type String map[string]Empty

sets.String is a set of strings, implemented via map[string]struct{} for minimal memory consumption.

func NewString

func NewString(items ...string) String

NewString creates a String from a list of values.

func (String) Delete

func (s String) Delete(items ...string) String

Delete removes all items from the set.

func (String) Has

func (s String) Has(item string) bool

Has returns true if and only if item is contained in the set.

func (String) HasAll

func (s String) HasAll(items ...string) bool

HasAll returns true if and only if all items are contained in the set.

func (String) Insert

func (s String) Insert(items ...string) String

Insert adds items to the set.

func (String) InsertSet

func (s String) InsertSet(sets ...String) String

InsertSet inserts all items from sets into s.

func (String) Len

func (s String) Len() int

Len returns the size of the set.

func (String) UnsortedList

func (s String) UnsortedList() []string

UnsortedList returns the slice with contents in random order.

Jump to

Keyboard shortcuts

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