cached

package
v1.13.12 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeRemote = fs.ModeSymlink | fs.ModeIrregular
)

Variables

View Source
var (
	ErrOffline = errors.New("remote filesystem is offline")
)

Functions

func Dir

func Dir(base StatCloser, fis []fs.FileInfo) http.File

func DownloadFile

func DownloadFile(localFile string, file http.File) (err error)

func IsOffline

func IsOffline(fs http.FileSystem) bool

func IsRemote

func IsRemote(mode fs.FileMode) bool

func New

func New(local string, remote Remote, offline ...bool) http.FileSystem

Types

type Remote

type Remote interface {
	Init(local string, offline bool)
	Lstat(localFile string) (fs.FileInfo, error)
	ReaddirAll(localDir string, dir *os.File, offline bool) (fis []fs.FileInfo, err error)
	SyncLstat(local string, name string) (fs.FileInfo, error)
	SyncOpen(local string, name string) (http.File, error)
}

func RemoteOf

func RemoteOf(fs http.FileSystem) (r Remote, ok bool)

type StatCloser

type StatCloser interface {
	Stat() (fs.FileInfo, error)
	Close() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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