cached

package
v1.13.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

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 added in v1.12.8

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

func DownloadFile added in v1.12.8

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

func IsOffline added in v1.12.9

func IsOffline(fs http.FileSystem) bool

func IsRemote added in v1.12.8

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 added in v1.12.9

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

type StatCloser added in v1.12.8

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