set

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package set implements classic data structure for operating with unique values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type String

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

String is implementation of set for strings.

func NewString

func NewString() *String

NewString returns allocated string set.

func StringFromSlice

func StringFromSlice(items []string) *String

StringFromSlice returns allocated string set with items from given slice.

func (*String) Contains

func (s *String) Contains(item string) bool

Contains returns true if given item is in set.

func (*String) Equals

func (s *String) Equals(other String) bool

Equals returns true if both sets have the same values.

func (*String) Items

func (s *String) Items() []string

Items returns slice with all elements of set.

func (*String) MarshalJSON

func (s *String) MarshalJSON() ([]byte, error)

func (*String) Push

func (s *String) Push(item string)

Push given item into set.

func (*String) Remove

func (s *String) Remove(item string)

Remove given item from set.

func (*String) UnmarshalJSON

func (s *String) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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