sets

package
v1.29.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IgnoreCaseSet

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

IgnoreCaseSet is a set of strings that is case-insensitive.

func NewString

func NewString(items ...string) *IgnoreCaseSet

NewString creates a new IgnoreCaseSet with the given items.

func SafeInsert

func SafeInsert(s *IgnoreCaseSet, items ...string) *IgnoreCaseSet

SafeInsert creates a new IgnoreCaseSet with the given items if the set is not initialized. This is the recommended way to insert elements into the set.

func (*IgnoreCaseSet) Delete

func (s *IgnoreCaseSet) Delete(item string) bool

Delete removes the given item from the set. It will be a no-op if the set is not initialized or the item is not in the set.

func (*IgnoreCaseSet) Has

func (s *IgnoreCaseSet) Has(item string) bool

Has returns true if the given item is in the set, and the set is initialized.

func (*IgnoreCaseSet) Initialized

func (s *IgnoreCaseSet) Initialized() bool

Initialized returns true if the set is initialized.

func (*IgnoreCaseSet) Insert

func (s *IgnoreCaseSet) Insert(items ...string)

Insert adds the given items to the set. It only works if the set is initialized.

func (*IgnoreCaseSet) Len

func (s *IgnoreCaseSet) Len() int

Len returns the number of items in the set.

func (*IgnoreCaseSet) UnsortedList

func (s *IgnoreCaseSet) UnsortedList() []string

UnsortedList returns the items in the set in an arbitrary order.

Jump to

Keyboard shortcuts

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