cache

package
v0.0.0-...-de6961a Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[DataType any] struct {
	// contains filtered or unexported fields
}

func New

func New[DataType any](config *Config[DataType]) *Cache[DataType]

func (*Cache[DataType]) Invalidate

func (c *Cache[DataType]) Invalidate(offset int64)

func (*Cache[DataType]) Load

func (c *Cache[DataType]) Load(offset int64) interfaces.Page[DataType]

func (*Cache[DataType]) Save

func (c *Cache[DataType]) Save(pg interfaces.Page[DataType], updateOnly ...bool)

func (*Cache[DataType]) Update

func (c *Cache[DataType]) Update(pg interfaces.Page[DataType])

type Config

type Config[DataType any] struct {
	Limit         uint32
	PageGenerator func() interfaces.Page[DataType]
}

Jump to

Keyboard shortcuts

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