cache

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package cache contains a read-only cache file system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadOnlyFS

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

ReadOnlyFS is a read-only cache for an FS. Source FS data must not change. Data is assumed unchanged to increase performance.

func NewReadOnlyFS

func NewReadOnlyFS(source hackpadfs.FS, cache writableFS, options ReadOnlyOptions) (*ReadOnlyFS, error)

NewReadOnlyFS creates a new ReadOnlyFS with the given 'source' of data, a writable 'cache' FS, and any additional options.

func (*ReadOnlyFS) Open

func (fs *ReadOnlyFS) Open(name string) (hackpadfs.File, error)

Open implements hackpadfs.FS

func (*ReadOnlyFS) Stat

func (fs *ReadOnlyFS) Stat(name string) (hackpadfs.FileInfo, error)

Stat implements hackpadfs.StatFS

type ReadOnlyOptions

type ReadOnlyOptions struct {
	RetainData func(name string, info hackpadfs.FileInfo) bool
}

ReadOnlyOptions contain options for creating a ReadOnlyFS

Jump to

Keyboard shortcuts

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