storage

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDStorage

type IDStorage struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewIDStorage

func NewIDStorage() *IDStorage

func (*IDStorage) Add

func (r *IDStorage) Add(id int64)

func (*IDStorage) Count

func (r *IDStorage) Count() int

func (*IDStorage) Delete

func (r *IDStorage) Delete(id int64)

func (*IDStorage) ThreadUnsafeData

func (r *IDStorage) ThreadUnsafeData() map[int64]struct{}

type LockableIDStorage

type LockableIDStorage interface {
	RLock()
	RUnlock()
	ThreadUnsafeData() map[int64]struct{}
}

type RecordsByID

type RecordsByID struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewRecordsByID

func NewRecordsByID() *RecordsByID

func (*RecordsByID) Count

func (r *RecordsByID) Count() int

func (*RecordsByID) Delete

func (r *RecordsByID) Delete(id int64)

func (*RecordsByID) Get

func (r *RecordsByID) Get(id int64) record.Record

func (*RecordsByID) GetAllData

func (r *RecordsByID) GetAllData() []record.Record

func (*RecordsByID) GetData

func (r *RecordsByID) GetData(stores []LockableIDStorage) []record.Record

func (*RecordsByID) GetIDStorage

func (r *RecordsByID) GetIDStorage() LockableIDStorage

func (*RecordsByID) Set

func (r *RecordsByID) Set(id int64, item record.Record)

Jump to

Keyboard shortcuts

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