Documentation ¶
Overview ¶
Package fakesystem provides an in-memory implementation of the interfaces in the system package.
Index ¶
- Constants
- type Program
- type ProgramContext
- type System
- func (sys *System) Chmod(ctx context.Context, path string, mode os.FileMode) error
- func (sys *System) Chown(ctx context.Context, path string, uid system.UID, gid system.GID) error
- func (sys *System) CreateFile(ctx context.Context, path string, mode os.FileMode) (system.FileWriter, error)
- func (sys *System) LookupGroup(name string) (system.GID, error)
- func (sys *System) LookupUser(name string) (system.UID, error)
- func (sys *System) Lstat(ctx context.Context, path string) (os.FileInfo, error)
- func (sys *System) Mkdir(ctx context.Context, path string, mode os.FileMode) error
- func (sys *System) Mkprogram(path string, prog Program) error
- func (sys *System) OpenFile(ctx context.Context, path string) (system.File, error)
- func (sys *System) OwnerInfo(info os.FileInfo) (system.UID, system.GID, error)
- func (sys *System) Readlink(ctx context.Context, path string) (string, error)
- func (sys *System) Remove(ctx context.Context, path string) error
- func (sys *System) Run(ctx context.Context, cmd *system.Cmd) (output []byte, err error)
- func (sys *System) Symlink(ctx context.Context, oldname, newname string) error
Constants ¶
View Source
const ( DefaultUID system.UID = 1000 DefaultGID system.GID = 2000 )
Default IDs for created filesystem entries.
View Source
const Root = system.LocalRoot
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Program ¶
type Program func(ctx context.Context, pc *ProgramContext) int
Program is a function to call when an executable file is run.
type ProgramContext ¶
type System ¶
type System struct {
// contains filtered or unexported fields
}
System is an in-memory implementation of FS and Runner. It uses path/filepath for path manipulation. It is safe to use from multiple goroutines. The zero value is an empty filesystem.
func (*System) CreateFile ¶
func (*System) LookupGroup ¶ added in v0.2.0
LookupGroup returns a group ID for either "root" or "group".
func (*System) LookupUser ¶ added in v0.2.0
LookupUser returns a user ID for either "root" or "user".
Click to show internal directories.
Click to hide internal directories.