package filesystem
import "github.com/influxdata/flux/dependencies/filesystem"
Index ¶
- func Inject(ctx context.Context, fs Service) context.Context
- func ReadFile(ctx context.Context, filename string) ([]byte, error)
- func Stat(ctx context.Context, filename string) (os.FileInfo, error)
- type Dependency
- type File
- type Service
Functions ¶
func Inject ¶
Inject will inject this filesystem Service into the context.
func ReadFile ¶
ReadFile will open the file from the service and read the entire contents.
func Stat ¶
Stat will retrieve the os.FileInfo for a file.
Types ¶
type Dependency ¶
type Dependency struct { FS Service }
Dependency will inject the filesystem Service into the dependency chain.
func (Dependency) Inject ¶
func (d Dependency) Inject(ctx context.Context) context.Context
Inject will inject the filesystem Service into the dependency chain.
type File ¶
type File interface { io.ReadCloser Stat() (os.FileInfo, error) }
File is an interface for interacting with a file.
func OpenFile ¶
OpenFile will open the file from the service.
type Service ¶
Service is the service for accessing the filesystem.
var SystemFS Service = systemFS{}
SystemFS implements the filesystem.Service by proxying all requests to the filesystem.
func Get ¶
Get will retrieve a filesystem Service from the context.Context.
Source Files ¶
ioutil.go service.go systemfs.go
- Version
- v0.196.1 (latest)
- Published
- Feb 19, 2025
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 day ago –
Tools for package owners.