mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
* Define an interface for IOFS handling. Add no-op and temporary directory implementations. * Move IOFS stuff out into separate file, add basic tmpfs implementation for linux only * Switch between directory and tmpfs based on platform and config * Respect FN_IOFS_OPTS * Make directory iofs default on all platforms * At least try to clean up a bit on failure * Add backout if IOFS creation fails * Add comment about iofs.Close
23 lines
343 B
Go
23 lines
343 B
Go
// +build !linux
|
|
|
|
package agent
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
)
|
|
|
|
type tmpfsIOFS struct {
|
|
directoryIOFS
|
|
}
|
|
|
|
func (t *tmpfsIOFS) Close() error {
|
|
return t.directoryIOFS.Close()
|
|
}
|
|
|
|
func newTmpfsIOFS(ctx context.Context, cfg *Config) (*tmpfsIOFS, error) {
|
|
return nil, errors.New("tmpfs IOFS not supported on macOS")
|
|
}
|
|
|
|
var _ iofs = &tmpfsIOFS{}
|