isucache

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 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 added in v1.2.1

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

func NewAtomicMap added in v1.2.1

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

func (*AtomicMap[K, V, T]) Forget added in v1.2.1

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

func (*AtomicMap[K, V, T]) Len added in v1.11.0

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

func (*AtomicMap[K, V, T]) Load added in v1.2.1

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

func (*AtomicMap[K, V, T]) LoadFromGob added in v1.7.0

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

func (*AtomicMap[K, V, T]) LoadOrStore added in v1.10.0

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

func (*AtomicMap[K, V, T]) Purge added in v1.2.1

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

func (*AtomicMap[K, V, T]) Range added in v1.6.0

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

func (*AtomicMap[K, V, T]) RangeUpdate added in v1.7.0

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

func (*AtomicMap[K, V, T]) Store added in v1.2.1

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

func (*AtomicMap[K, V, T]) Update added in v1.7.0

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

func (*AtomicMap[K, V, T]) WriteToGob added in v1.7.0

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

type BPTree added in v1.14.1

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

func NewBPTree added in v1.14.1

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

func NewBPTreeWithOrdered added in v1.14.1

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

func NewBPTreeWithTime added in v1.14.1

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

func (*BPTree[K, V]) Len added in v1.14.1

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

func (*BPTree[K, V]) Load added in v1.14.1

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

func (*BPTree[K, V]) Purge added in v1.14.1

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

func (*BPTree[K, V]) ReverseSlice added in v1.14.1

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

func (*BPTree[K, V]) Slice added in v1.14.1

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

func (*BPTree[K, V]) Store added in v1.14.1

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

type Map added in v1.2.0

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

func NewMap added in v1.2.0

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

func (*Map[K, V]) Forget added in v1.2.0

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

func (*Map[K, V]) Len added in v1.11.0

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

func (*Map[K, V]) Load added in v1.2.0

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

func (*Map[K, V]) LoadFromGob added in v1.7.0

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

func (*Map[K, V]) LoadOrStore added in v1.10.0

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

func (*Map[K, V]) Purge added in v1.2.0

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

func (*Map[K, V]) Range added in v1.6.0

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

func (*Map[K, V]) RangeUpdate added in v1.7.0

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

func (*Map[K, V]) Store added in v1.2.0

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

func (*Map[K, V]) Update added in v1.7.0

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

func (*Map[K, V]) WriteToGob added in v1.7.0

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

type NoDeleteSlice added in v1.14.0

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

func NewNoDeleteSlice added in v1.14.0

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

func (*NoDeleteSlice[T]) Append added in v1.14.0

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

func (*NoDeleteSlice[T]) Cap added in v1.14.0

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

func (*NoDeleteSlice[T]) Get added in v1.14.0

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

func (*NoDeleteSlice[T]) Len added in v1.14.0

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

func (*NoDeleteSlice[T]) Purge added in v1.14.0

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

func (*NoDeleteSlice[T]) Range added in v1.14.0

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

func (*NoDeleteSlice[T]) Set added in v1.14.0

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

func (*NoDeleteSlice[T]) Slice added in v1.14.0

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

type Slice added in v1.8.3

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

func NewSlice added in v1.8.3

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

func (*Slice[T]) Append added in v1.8.3

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

func (*Slice[T]) Edit added in v1.8.3

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

func (*Slice[T]) Get added in v1.8.3

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

func (*Slice[T]) Len added in v1.8.3

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

func (*Slice[T]) LoadFromGob added in v1.8.3

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

func (*Slice[T]) Purge added in v1.8.3

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

func (*Slice[T]) Range added in v1.8.3

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

func (*Slice[T]) Set added in v1.9.0

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

func (*Slice[T]) Slice added in v1.9.1

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

func (*Slice[T]) WriteToGob added in v1.8.3

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