indexset

package
v1.12.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexSet

type IndexSet struct {

	// Lock to protect this sets
	sync.RWMutex
	// contains filtered or unexported fields
}

IndexSet is a very simple multi-thread safety index set to store ids

func NewIndexSet

func NewIndexSet(item ...string) *IndexSet

func (*IndexSet) Add

func (idx *IndexSet) Add(id string) error

Add adds id record to set, return error if already exist.

func (*IndexSet) Delete

func (idx *IndexSet) Delete(id string) error

Delete delete id record from set, error if doesn't exist.

func (*IndexSet) Has

func (idx *IndexSet) Has(id string) bool

Has return if id exist in set.

Jump to

Keyboard shortcuts

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