stringset

package
v1.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package stringset implements a basic set of strings

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

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

Data represent a set of strings

func From

func From(strings []string) *Data

From create a empty set of strings given a slice of strings

func New

func New() *Data

New create a new empty set of strings

func (*Data) Delete

func (set *Data) Delete(key string)

Delete deletes a string from the set. If the string doesn't exist this is a no-op

func (*Data) Eq added in v1.16.5

func (set *Data) Eq(other *Data) bool

Eq compares two string sets for equality

func (*Data) Has

func (set *Data) Has(key string) bool

Has checks if a string is in the set or not

func (*Data) Len

func (set *Data) Len() int

Len returns the map of the set

func (*Data) Put

func (set *Data) Put(key string)

Put a string in the set

func (*Data) ToList

func (set *Data) ToList() (result []string)

ToList returns the strings contained in this set as a string slice

func (*Data) ToSortedList added in v1.19.5

func (set *Data) ToSortedList() []string

ToSortedList returns the string container in this set as a sorted string slice

Jump to

Keyboard shortcuts

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