syncset

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Overview

Package syncset provides a structure describing a set of elements safe for concurrent usage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncSet

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

SyncSet contains a set of elements and provides utility methods safe for concurrent access.

func New

func New() *SyncSet

New returns a nre SyncSet instance.

func (*SyncSet) Add

func (sc *SyncSet) Add(fc string)

Add adds the given element to the set (nop is already present).

func (*SyncSet) ForEach

func (sc *SyncSet) ForEach(fn func(string))

ForEach executes the given function for all elements in the set.

func (*SyncSet) Remove

func (sc *SyncSet) Remove(fc string)

Remove removes the given element to the set (nop is already absent).

Jump to

Keyboard shortcuts

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