memoryset

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package memoryset provides an in-memory implementation of set.BinaryStore.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryStore

type BinaryStore struct {
	// BeforeAdd, if non-nil, is called before a value is added to the set.
	BeforeAdd func(set string, v []byte) error

	// AfterAdd, if non-nil, is called after a value is added to the set.
	AfterAdd func(set string, v []byte) error

	// BeforeRemove, if non-nil, is called before a value is removed from the
	// set.
	BeforeRemove func(set string, v []byte) error

	// AfterRemove, if non-nil, is called after a value is removed from the set.
	AfterRemove func(set string, v []byte) error
	// contains filtered or unexported fields
}

BinaryStore is an implementation of set.BinaryStore that stores sets in memory.

func (*BinaryStore) Open

func (s *BinaryStore) Open(ctx context.Context, name string) (set.BinarySet, error)

Open returns the keyspace with the given name.

type Store

type Store[T comparable] struct {
	// BeforeAdd, if non-nil, is called before a value is added to the set.
	BeforeAdd func(set string, v T) error

	// AfterAdd, if non-nil, is called after a value is added to the set.
	AfterAdd func(set string, v T) error

	// BeforeRemove, if non-nil, is called before a value is removed from the
	// set.
	BeforeRemove func(set string, v T) error

	// AfterRemove, if non-nil, is called after a value is removed from the set.
	AfterRemove func(set string, v T) error
	// contains filtered or unexported fields
}

Store is an in-memory implementation of set.Store.

func (*Store[T]) Open

func (s *Store[T]) Open(ctx context.Context, name string) (set.Set[T], error)

Open returns the set with the given name.

Jump to

Keyboard shortcuts

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