stringset

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 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 StringSet

type StringSet []string

StringSet adds convenient methods to manipulate the items in the set.

It is imperative that tag `dynamodbav :",stringset"` is used to allow the field to be marshaled as a string set. If you forget to do so, the array will be marshalled as a list instead. See https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/dynamodb/dynamodbattribute#Marshal.

func New

func New(values []string) StringSet

New creates a new StringSet with duplicate values removed.

func (*StringSet) Add

func (m *StringSet) Add(value string) bool

Add return true only if the value hasn't existed in the set before the invocation.

func (*StringSet) Clear

func (m *StringSet) Clear()

Clear resets the array to an empty one.

func (*StringSet) Delete

func (m *StringSet) Delete(value string) (ok bool)

Delete returns true only if the value existed in the set before the invocation.

func (*StringSet) Equal

func (m *StringSet) Equal(other StringSet) bool

Equal returns true only if every element in this set is in the other set and vice versa.

func (*StringSet) Has

func (m *StringSet) Has(value string) (ok bool)

func (*StringSet) IsSubset

func (m *StringSet) IsSubset(other StringSet) bool

IsSubset returns true if every element in this set is in the specified set (other).

func (*StringSet) IsSuperset

func (m *StringSet) IsSuperset(other StringSet) bool

IsSuperset returns true if every element in the specified set (other) is in this set.

Jump to

Keyboard shortcuts

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