Help us shape the future of Go! Take the 2026 Go Developer Survey

cache

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetGlobalCache

func ResetGlobalCache()

Types

type CacheEntry

type CacheEntry struct {
	Content    string
	ModTime    time.Time
	Size       int64
	IsTextFile *bool
	LoadTime   time.Time
}

type FileCache

type FileCache struct {
	// contains filtered or unexported fields
}

func DefaultFileCache

func DefaultFileCache() *FileCache

func GetGlobalFileCache

func GetGlobalFileCache() *FileCache

func NewFileCache

func NewFileCache(maxSizeBytes int64, maxItems int) *FileCache

func (*FileCache) CacheMetadataOnly

func (fc *FileCache) CacheMetadataOnly(filePath string) error

func (*FileCache) Clear

func (fc *FileCache) Clear()

func (*FileCache) Contains

func (fc *FileCache) Contains(filePath string) bool

func (*FileCache) Get

func (fc *FileCache) Get(filePath string) (string, error)

func (*FileCache) GetLazy

func (fc *FileCache) GetLazy(filePath string) (string, error)

func (*FileCache) GetTextFileStatus

func (fc *FileCache) GetTextFileStatus(filePath string, checkFunc func(string) (bool, error)) (bool, error)

func (*FileCache) Preload

func (fc *FileCache) Preload(filePath string) error

func (*FileCache) Stats

func (fc *FileCache) Stats() (items int, sizeBytes int64, hitRate float64)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func Global

func Global() *Manager

func (*Manager) GetFileCache

func (m *Manager) GetFileCache() *FileCache

Jump to

Keyboard shortcuts

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