records

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunBenchmarkTraverse

func RunBenchmarkTraverse(b *testing.B, create func() Records[int])

func RunConcurrentInsertBenchmark

func RunConcurrentInsertBenchmark(b *testing.B, workers int, newRecords func() Records[int])

func RunConcurrentMixedOperationsBenchmark

func RunConcurrentMixedOperationsBenchmark(b *testing.B, workers int, newRecords func() Records[int])

func RunConcurrentSetBenchmark

func RunConcurrentSetBenchmark(b *testing.B, workers int, newRecords func() Records[int])

func RunRecordsSuite

func RunRecordsSuite(t *testing.T, newRecords func() Records[int])

RunRecordsSuite ejecuta una batería de tests reutilizable sobre cualquier implementación de Records[int].

Usamos int para que la suite sea fácil de reutilizar y podamos comprobar igualdad directamente sin meter comparadores adicionales. Si alguna implementación es genérica, simplemente instánciala como Records[int].

Types

type Records

type Records[T any] interface {
	Insert(val T) (id int64)
	Delete(id int64)
	Get(id int64) (val T)
	Set(id int64, val T)
	Traverse(f func(id int64, val T) bool)
}

type RecordsCorrect

type RecordsCorrect[T any] struct {
	// contains filtered or unexported fields
}

func NewRecordsCorrect

func NewRecordsCorrect[T any]() *RecordsCorrect[T]

func (*RecordsCorrect[T]) Delete

func (r *RecordsCorrect[T]) Delete(id int64)

func (*RecordsCorrect[T]) Get

func (r *RecordsCorrect[T]) Get(id int64) (val T)

func (*RecordsCorrect[T]) Insert

func (r *RecordsCorrect[T]) Insert(val T) (id int64)

func (*RecordsCorrect[T]) Set

func (r *RecordsCorrect[T]) Set(id int64, val T)

func (*RecordsCorrect[T]) Traverse

func (r *RecordsCorrect[T]) Traverse(f func(id int64, val T) bool)

type RecordsFast

type RecordsFast[T any] struct {
	// contains filtered or unexported fields
}

func NewRecordsFast

func NewRecordsFast[T any]() *RecordsFast[T]

func (*RecordsFast[T]) Delete

func (r *RecordsFast[T]) Delete(id int64)

func (*RecordsFast[T]) Get

func (r *RecordsFast[T]) Get(id int64) (val T)

func (*RecordsFast[T]) Insert

func (r *RecordsFast[T]) Insert(val T) (id int64)

func (*RecordsFast[T]) Set

func (r *RecordsFast[T]) Set(id int64, val T)

func (*RecordsFast[T]) Traverse

func (r *RecordsFast[T]) Traverse(f func(id int64, val T) bool)

type RecordsHyper

type RecordsHyper[T any] struct {
	// contains filtered or unexported fields
}

func NewRecordsHyper

func NewRecordsHyper[T any]() *RecordsHyper[T]

func (*RecordsHyper[T]) Delete

func (r *RecordsHyper[T]) Delete(id int64)

func (*RecordsHyper[T]) Get

func (r *RecordsHyper[T]) Get(id int64) T

func (*RecordsHyper[T]) Insert

func (r *RecordsHyper[T]) Insert(val T) int64

func (*RecordsHyper[T]) Set

func (r *RecordsHyper[T]) Set(id int64, val T)

func (*RecordsHyper[T]) Traverse

func (r *RecordsHyper[T]) Traverse(f func(id int64, val T) bool)

type RecordsTurbo

type RecordsTurbo[T any] struct {
	// contains filtered or unexported fields
}

func NewRecordsTurbo

func NewRecordsTurbo[T any]() *RecordsTurbo[T]

func (*RecordsTurbo[T]) Delete

func (r *RecordsTurbo[T]) Delete(id int64)

func (*RecordsTurbo[T]) Get

func (r *RecordsTurbo[T]) Get(id int64) (val T)

func (*RecordsTurbo[T]) Insert

func (r *RecordsTurbo[T]) Insert(val T) (id int64)

func (*RecordsTurbo[T]) Set

func (r *RecordsTurbo[T]) Set(id int64, val T)

func (*RecordsTurbo[T]) Traverse

func (r *RecordsTurbo[T]) Traverse(f func(id int64, val T) bool)

type RecordsUltra

type RecordsUltra[T any] struct {
	// contains filtered or unexported fields
}

func NewRecordsUltra

func NewRecordsUltra[T any]() *RecordsUltra[T]

func (*RecordsUltra[T]) Delete

func (r *RecordsUltra[T]) Delete(id int64)

func (*RecordsUltra[T]) Get

func (r *RecordsUltra[T]) Get(id int64) T

func (*RecordsUltra[T]) Insert

func (r *RecordsUltra[T]) Insert(val T) int64

func (*RecordsUltra[T]) MaxID

func (r *RecordsUltra[T]) MaxID() int64

func (*RecordsUltra[T]) Set

func (r *RecordsUltra[T]) Set(id int64, val T)

func (*RecordsUltra[T]) Traverse

func (r *RecordsUltra[T]) Traverse(f func(id int64, val T) bool)

Jump to

Keyboard shortcuts

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