store

package
v0.0.0-...-2b884bc Latest Latest
Warning

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

Go to latest
Published: Dec 2, 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 Option

type Option[T any] func(*Store[T])

func WithMinContiguous

func WithMinContiguous[T any](minContiguous int) Option[T]

type Store

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

func NewStore

func NewStore[T any](opts ...Option[T]) *Store[T]

func (*Store[T]) Get

func (c *Store[T]) Get(p []T, offset int64) bool

Get populates `p` with the data at `offset`. If the cache does not contain the complete data for this range, Get returns false.

func (*Store[T]) Has

func (c *Store[T]) Has(length, offset int64) bool

Has returns true if the cache contains data at `offset` with length `length`.

func (*Store[T]) Length

func (c *Store[T]) Length() int64

func (*Store[T]) Occupancy

func (c *Store[T]) Occupancy() int64

func (*Store[T]) Set

func (c *Store[T]) Set(p []T, offset int64)

Set sets the cache data at `offset` to `p`. If the cache already contains data at `offset`, it is overwritten.

Jump to

Keyboard shortcuts

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