world

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OSEnv

type OSEnv struct{}

func (OSEnv) Environ added in v0.0.19

func (OSEnv) Environ() []string

func (OSEnv) Exit

func (OSEnv) Exit(code int)

func (OSEnv) LookupEnv

func (OSEnv) LookupEnv(key string) (string, bool)

type OSFS

type OSFS struct{}

func (OSFS) Getwd

func (OSFS) Getwd() (string, error)

func (OSFS) Glob

func (OSFS) Glob(name string) ([]string, error)

func (OSFS) PathSeparator

func (OSFS) PathSeparator() rune

func (OSFS) ReadFile

func (OSFS) ReadFile(name string) ([]byte, error)

func (OSFS) Remove

func (OSFS) Remove(name string) error

func (OSFS) Stat

func (OSFS) Stat(name string) (fs.FileInfo, error)

func (OSFS) WriteFile

func (OSFS) WriteFile(name string, data []byte, perm fs.FileMode) error

type World

type World struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer

	FS   WorldFS
	Env  WorldEnv
	Args []string
}
var Current World = New()

func New

func New() World

type WorldEnv

type WorldEnv interface {
	Exit(code int)
	LookupEnv(key string) (string, bool)
	Environ() []string
}

type WorldFS

type WorldFS interface {
	Getwd() (string, error)
	PathSeparator() rune
	WriteFile(name string, data []byte, perm fs.FileMode) error
	ReadFile(name string) ([]byte, error)
	Remove(name string) error
	Stat(name string) (fs.FileInfo, error)
	Glob(pattern string) (matches []string, err error)
}

Jump to

Keyboard shortcuts

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