filecache

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 5 Imported by: 40

Documentation

Overview

Package filecache provides a LRU cache of open os.File objects, closing old files as new ones are opened.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(maxOpened int) *Cache

func (*Cache) Open

func (c *Cache) Open(filename string) *CachedFile

type CachedFile

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

func (*CachedFile) Close

func (cf *CachedFile) Close() error

func (*CachedFile) Read

func (cf *CachedFile) Read(p []byte) (int, error)

func (*CachedFile) ReadAt

func (cf *CachedFile) ReadAt(p []byte, off int64) (int, error)

func (*CachedFile) Stat

func (cf *CachedFile) Stat() (os.FileInfo, error)

func (*CachedFile) Sync

func (cf *CachedFile) Sync() error

func (*CachedFile) Write

func (cf *CachedFile) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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