Documentation ¶
Index ¶
- Constants
- Variables
- func NewVirtual()
- func ToOs()
- type VirtualData
- func (v *VirtualData) Egid() (int, error)
- func (v *VirtualData) Euid() (int, error)
- func (v *VirtualData) Gid() (int, error)
- func (v *VirtualData) Groups() ([]int, error)
- func (v *VirtualData) Hostname() (string, error)
- func (v *VirtualData) InitDirectories() error
- func (v *VirtualData) Pagesize() (int, error)
- func (v *VirtualData) Pid() (int, error)
- func (v *VirtualData) Ppid() (int, error)
- func (v *VirtualData) SetEgid(egid int) error
- func (v *VirtualData) SetEuid(euid int) error
- func (v *VirtualData) SetGid(gid int) error
- func (v *VirtualData) SetGroups(groups []int) error
- func (v *VirtualData) SetHostname(hostname string) error
- func (v *VirtualData) SetPagesize(pagesize int) error
- func (v *VirtualData) SetPid(pid int) error
- func (v *VirtualData) SetPpid(ppid int) error
- func (v *VirtualData) SetUid(uid int) error
- func (v *VirtualData) SyncEnv() error
- func (v *VirtualData) Uid() (int, error)
- type WrapperStore
Constants ¶
const ( VirtualTempDir string = "/tmp" VirtualUserCacheDir string = "/user/cache" VirtualUserConfigDir string = "/user/config" VirtualUserHomeDir string = "/user/home" )
Variables ¶
var (
ErrNotVirtual = errors.New("Wrapper is not virtual")
)
Functions ¶
Types ¶
type VirtualData ¶
type VirtualData struct { // pseudo environment Env map[string]string // contains filtered or unexported fields }
data store for virtual mode
func (*VirtualData) Egid ¶
func (v *VirtualData) Egid() (int, error)
get virtual Egid returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) Euid ¶
func (v *VirtualData) Euid() (int, error)
get virtual Euid returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) Gid ¶
func (v *VirtualData) Gid() (int, error)
get virtual Gid returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) Groups ¶
func (v *VirtualData) Groups() ([]int, error)
get virtual Groups returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) Hostname ¶
func (v *VirtualData) Hostname() (string, error)
get virtual hostname returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) InitDirectories ¶
func (v *VirtualData) InitDirectories() error
create TempDir, UserCacheDir, UserConfigDir & UserHomeDir returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) Pagesize ¶
func (v *VirtualData) Pagesize() (int, error)
get virtual Pagesize returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) Pid ¶
func (v *VirtualData) Pid() (int, error)
get virtual Pid returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) Ppid ¶
func (v *VirtualData) Ppid() (int, error)
get virtual Ppid returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) SetEgid ¶
func (v *VirtualData) SetEgid(egid int) error
set virtual Egid returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) SetEuid ¶
func (v *VirtualData) SetEuid(euid int) error
set virtual Euid returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) SetGid ¶
func (v *VirtualData) SetGid(gid int) error
set virtual Gid returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) SetGroups ¶
func (v *VirtualData) SetGroups(groups []int) error
set virtual Groups returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) SetHostname ¶
func (v *VirtualData) SetHostname(hostname string) error
set virtual hostname returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) SetPagesize ¶
func (v *VirtualData) SetPagesize(pagesize int) error
set virtual Pagesize returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) SetPid ¶
func (v *VirtualData) SetPid(pid int) error
set virtual Pid returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) SetPpid ¶
func (v *VirtualData) SetPpid(ppid int) error
set virtual Ppid returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) SetUid ¶
func (v *VirtualData) SetUid(uid int) error
set virtual Uid returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) SyncEnv ¶
func (v *VirtualData) SyncEnv() error
sync current os environment variables to virtual environment variables returns ErrNotVirtual if Wrapper isen't in virtual mode
func (*VirtualData) Uid ¶
func (v *VirtualData) Uid() (int, error)
get virtual Uid returns ErrNotVirtual if Wrapper isen't in virtual mode
type WrapperStore ¶
type WrapperStore struct { // afero filesystem Fs afero.Fs // afero ioutil Util *afero.Afero // current working directory WorkingDirectory string // virtual data store Virtual *VirtualData }
data store for wrapper object
var Wrapper *WrapperStore
wrapper object
func (*WrapperStore) GetPath ¶
func (ws *WrapperStore) GetPath(fpath string) string
get file path prefixed with current working directory if it doesen't start with a slash