lrufdcache

package
v0.10.10 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2014 License: Unlicense, GPL-3.0 Imports: 3 Imported by: 0

README

lrufdcache

A LRU file descriptor cache

Documentation

Overview

Package logger implements a LRU file descriptor cache for concurrent ReadAt calls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedFile

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

A wrapper around *os.File which counts references

func (*CachedFile) Close

func (f *CachedFile) Close() error

Tells the cache that we are done using the file, but it's up to the cache to decide when this file will really be closed. The error, if any, will be lost.

func (*CachedFile) ReadAt

func (f *CachedFile) ReadAt(buf []byte, at int64) (int, error)

Read the file at the given offset.

type FileCache

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

func NewCache

func NewCache(entries int) *FileCache

Create a new cache with the number of entries to hold.

func (*FileCache) Open

func (c *FileCache) Open(path string) (*CachedFile, error)

Open and cache a file descriptor or use an existing cached descriptor for the given path.

Jump to

Keyboard shortcuts

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