fileutil

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: MPL-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachingFileReader

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

CachingFileReader reads a file and keeps an in-memory copy of it, until the copy is considered stale. Next ReadFile() after expiry will re-read the file from disk.

func NewCachingFileReader

func NewCachingFileReader(path string, ttl time.Duration) *CachingFileReader

func (*CachingFileReader) ReadFile

func (r *CachingFileReader) ReadFile() ([]byte, error)

Jump to

Keyboard shortcuts

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