fsctx

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

fsctx adds context.Context to io/fs APIs.

TODO: Specify policy for future additions to this package. See ioctx.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stat

func Stat(ctx context.Context, fsys FS, name string) (os.FileInfo, error)

Stat is io/fs.Stat with context added.

Types

type DirEntry

type DirEntry interface {
	Name() string
	IsDir() bool
	Type() os.FileMode
	Info(context.Context) (os.FileInfo, error)
}

DirEntry is io/fs.DirEntry with context added.

type FS

type FS interface {
	Open(_ context.Context, name string) (File, error)
}

FS is io/fs.FS with context added.

type File

type File interface {
	Stat(context.Context) (os.FileInfo, error)
	Read(context.Context, []byte) (int, error)
	Close(context.Context) error
}

File is io/fs.File with context added.

type ReadDirFile

type ReadDirFile interface {
	File
	ReadDir(_ context.Context, n int) ([]DirEntry, error)
}

ReadDirFile is io/fs.ReadDirFile with context added.

type StatFS

type StatFS interface {
	FS
	Stat(_ context.Context, name string) (os.FileInfo, error)
}

StatFS is io/fs.StatFS with context added.

Jump to

Keyboard shortcuts

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