wisski-cloud-distillery/pkg/environment/environment.go
Tom Wiesing 45540ab253
pkg/environment: Remove some file-based functions
This commit removes certain file-based functions from 'pkg/environment',
continuing the migration to entirely remove the package.
2023-03-02 11:15:15 +01:00

25 lines
468 B
Go

package environment
import (
"io"
"io/fs"
)
// Environment represents an environment that a program can run it.
// It mostly mimics the interfaces of the [os] package.
type Environment interface {
isEnv()
Create(path string, mode fs.FileMode) (WritableFile, error)
Mkdir(path string, mode fs.FileMode) error
MkdirAll(path string, mode fs.FileMode) error
}
type WritableFile interface {
fs.File
io.Writer
}
func init() {
var _ Environment = new(Native)
}