lockset

package
v2.0.0-...-e5a2643 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockSet

type LockSet struct {
	sync.RWMutex
	Values map[string]void `json:"values" msgpack:"values"`
}

LockSet allows for a python-like set which allows for concurrent use.

func (*LockSet) Add

func (ls *LockSet) Add(val string) (values []string, change bool)

Add adds a value to the LockSet.

func (*LockSet) Contains

func (ls *LockSet) Contains(val string) (contains bool)

Contains returns a boolean if the set contains a specific value.

func (*LockSet) Get

func (ls *LockSet) Get() (values []string)

Get returns the value of the LockSet.

func (*LockSet) Len

func (ls *LockSet) Len() (count int)

Len returns the size of the LockSet.

func (*LockSet) Remove

func (ls *LockSet) Remove(val string) (values []string, change bool)

Remove removes a value from the LockSet.

Jump to

Keyboard shortcuts

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