disk

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(s *Store) *writer

Get returns a writer for the current disk store

Types

type Store

type Store struct {

	// RootDir defines the root file path of the cache
	RootDir string

	// MaxAge is the implementation of cache.MaxAge for use during trimming old files
	MaxAge cache.MaxAge
	// contains filtered or unexported fields
}

Store implements cache.Store

func New

func New(s *Store) *Store

New initializes a new instance of the disk store to be added to the current cache. If MaxAge or RootDir are not provided the will be set to their default values.

func (*Store) Purge

func (s *Store) Purge() error

Purge will clear the entire cache and remove the RootDir. This function should only be used when stopping the service. If you need to flush the store without stopping it you can call this method directly.

func (*Store) Trim

func (s *Store) Trim()

Trim is used for trimming files older then the MaxAge. It is called by the caches trim worker. This can be called directly if needed.

func (*Store) Type

func (s *Store) Type() string

Type returns the stores type as a string

Jump to

Keyboard shortcuts

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