isucache

package
v2.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllPurge

func AllPurge()

func New

func New[K comparable, V any](name string, replaceFn func(ctx context.Context, key K) (V, error), freshFor, ttl time.Duration, options ...sc.CacheOption) (*sc.Cache[K, V], error)

Types

type AtomicMap

type AtomicMap[K comparable, V *T, T any] struct {
	// contains filtered or unexported fields
}

func NewAtomicMap

func NewAtomicMap[K comparable, V *T, T any](name string) *AtomicMap[K, V, T]

func (*AtomicMap[K, V, T]) Forget

func (m *AtomicMap[K, V, T]) Forget(key K)

func (*AtomicMap[K, V, T]) Len

func (m *AtomicMap[K, V, T]) Len() int

func (*AtomicMap[K, V, T]) Load

func (m *AtomicMap[K, V, T]) Load(key K) (V, bool)

func (*AtomicMap[K, V, T]) LoadFromGob

func (m *AtomicMap[K, V, T]) LoadFromGob(r io.Reader) error

func (*AtomicMap[K, V, T]) LoadOrStore

func (m *AtomicMap[K, V, T]) LoadOrStore(key K, value V) (V, bool)

func (*AtomicMap[K, V, T]) Purge

func (m *AtomicMap[K, V, T]) Purge()

func (*AtomicMap[K, V, T]) Range

func (m *AtomicMap[K, V, T]) Range(f func(K, V) bool)

func (*AtomicMap[K, V, T]) RangeUpdate

func (m *AtomicMap[K, V, T]) RangeUpdate(f func(K, V) (V, bool))

func (*AtomicMap[K, V, T]) Store

func (m *AtomicMap[K, V, T]) Store(key K, value V)

func (*AtomicMap[K, V, T]) Update

func (m *AtomicMap[K, V, T]) Update(key K, f func(V) (V, bool))

func (*AtomicMap[K, V, T]) WriteToGob

func (m *AtomicMap[K, V, T]) WriteToGob(w io.Writer) error

type BPTree

type BPTree[K any, V any] struct {
	// contains filtered or unexported fields
}

func NewBPTree

func NewBPTree[V any, K any](name string, order int, comparator func(K, K) int8) (*BPTree[K, V], error)

func NewBPTreeWithOrdered

func NewBPTreeWithOrdered[K constraints.Ordered, V any](name string, order int) (*BPTree[K, V], error)

func NewBPTreeWithTime

func NewBPTreeWithTime[V any](name string, order int) (*BPTree[time.Time, V], error)

func (*BPTree[K, V]) Len

func (t *BPTree[K, V]) Len() int64

func (*BPTree[K, V]) Load

func (t *BPTree[K, V]) Load(key K) (V, bool)

func (*BPTree[K, V]) Purge

func (t *BPTree[K, V]) Purge()

func (*BPTree[K, V]) ReverseSlice

func (t *BPTree[K, V]) ReverseSlice(start, end K) []V

func (*BPTree[K, V]) Slice

func (t *BPTree[K, V]) Slice(start, end K) []V

func (*BPTree[K, V]) Store

func (t *BPTree[K, V]) Store(key K, value V)

type Map

type Map[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewMap

func NewMap[K comparable, V any](name string) *Map[K, V]

func (*Map[K, V]) Forget

func (m *Map[K, V]) Forget(key K)

func (*Map[K, V]) Len

func (m *Map[K, V]) Len() int

func (*Map[K, V]) Load

func (m *Map[K, V]) Load(key K) (V, bool)

func (*Map[K, V]) LoadFromGob

func (m *Map[K, V]) LoadFromGob(r io.Reader) error

func (*Map[K, V]) LoadOrStore

func (m *Map[K, V]) LoadOrStore(key K, value V) (V, bool)

func (*Map[K, V]) Purge

func (m *Map[K, V]) Purge()

func (*Map[K, V]) Range

func (m *Map[K, V]) Range(f func(K, V) bool)

func (*Map[K, V]) RangeUpdate

func (m *Map[K, V]) RangeUpdate(f func(K, V) (V, bool))

func (*Map[K, V]) Store

func (m *Map[K, V]) Store(key K, value V)

func (*Map[K, V]) Update

func (m *Map[K, V]) Update(key K, f func(V) (V, bool))

func (*Map[K, V]) WriteToGob

func (m *Map[K, V]) WriteToGob(w io.Writer) error

type NoDeleteSlice

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

func NewNoDeleteSlice

func NewNoDeleteSlice[T any](name string, capacity, shard int) *NoDeleteSlice[T]

func (*NoDeleteSlice[T]) Append

func (s *NoDeleteSlice[T]) Append(values ...T)

func (*NoDeleteSlice[T]) Cap

func (s *NoDeleteSlice[T]) Cap() int

func (*NoDeleteSlice[T]) Get

func (s *NoDeleteSlice[T]) Get(i int) (T, bool)

func (*NoDeleteSlice[T]) Len

func (s *NoDeleteSlice[T]) Len() int

func (*NoDeleteSlice[T]) Purge

func (s *NoDeleteSlice[T]) Purge()

func (*NoDeleteSlice[T]) Range

func (s *NoDeleteSlice[T]) Range(f func(int, T) bool)

func (*NoDeleteSlice[T]) Set

func (s *NoDeleteSlice[T]) Set(index int, value T)

func (*NoDeleteSlice[T]) Slice

func (s *NoDeleteSlice[T]) Slice(start, end int) *NoDeleteSlice[T]

type Slice

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

func NewSlice

func NewSlice[T any](name string, size int) *Slice[T]

func (*Slice[T]) Append

func (s *Slice[T]) Append(values ...T)

func (*Slice[T]) Edit

func (s *Slice[T]) Edit(f func([]T) []T)

func (*Slice[T]) Get

func (s *Slice[T]) Get(i int) (T, bool)

func (*Slice[T]) Len

func (s *Slice[T]) Len() int

func (*Slice[T]) LoadFromGob

func (s *Slice[T]) LoadFromGob(r io.Reader) error

func (*Slice[T]) Purge

func (s *Slice[T]) Purge()

func (*Slice[T]) Range

func (s *Slice[T]) Range(f func(int, T) bool)

func (*Slice[T]) Set

func (s *Slice[T]) Set(index int, value T)

func (*Slice[T]) Slice

func (s *Slice[T]) Slice(start, end int, f func([]T))

func (*Slice[T]) WriteToGob

func (s *Slice[T]) WriteToGob(w io.Writer) error

Jump to

Keyboard shortcuts

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