ios

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2017 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fake

type Fake struct {
	RenameStub func(string, string) error

	RemoveStub func(string) error

	ChmodStub func(string, os.FileMode) error

	ChownStub func(string, int, int) error

	OpenFileStub func(string, int, os.FileMode) (*os.File, error)

	StatStub func(string) (os.FileInfo, error)

	FindProcessStub func(int) (Process, error)

	GetwdStub func() (string, error)
	// contains filtered or unexported fields
}

Fake ...

func NewFake

func NewFake() *Fake

NewFake is the preferred way to initialise a Fake

func (*Fake) Chmod

func (fake *Fake) Chmod(arg1 string, arg2 os.FileMode) error

Chmod ...

func (*Fake) ChmodArgsForCall

func (fake *Fake) ChmodArgsForCall(i int) (string, os.FileMode)

ChmodArgsForCall ...

func (*Fake) ChmodCallCount

func (fake *Fake) ChmodCallCount() int

ChmodCallCount ...

func (*Fake) ChmodReturns

func (fake *Fake) ChmodReturns(result1 error)

ChmodReturns ...

func (*Fake) Chown

func (fake *Fake) Chown(arg1 string, arg2 int, arg3 int) error

Chown ...

func (*Fake) ChownArgsForCall

func (fake *Fake) ChownArgsForCall(i int) (string, int, int)

ChownArgsForCall ...

func (*Fake) ChownCallCount

func (fake *Fake) ChownCallCount() int

ChownCallCount ...

func (*Fake) ChownReturns

func (fake *Fake) ChownReturns(result1 error)

ChownReturns ...

func (*Fake) FindProcess

func (fake *Fake) FindProcess(arg1 int) (Process, error)

FindProcess ...

func (*Fake) FindProcessArgsForCall

func (fake *Fake) FindProcessArgsForCall(i int) int

FindProcessArgsForCall ...

func (*Fake) FindProcessCallCount

func (fake *Fake) FindProcessCallCount() int

FindProcessCallCount ...

func (*Fake) FindProcessReturns

func (fake *Fake) FindProcessReturns(result1 Process, result2 error)

FindProcessReturns ...

func (*Fake) Getwd

func (fake *Fake) Getwd() (string, error)

Getwd ...

func (*Fake) GetwdCallCount

func (fake *Fake) GetwdCallCount() int

GetwdCallCount ...

func (*Fake) GetwdReturns

func (fake *Fake) GetwdReturns(result1 string, result2 error)

GetwdReturns ...

func (*Fake) Invocations

func (fake *Fake) Invocations() map[string][][]interface{}

Invocations ...

func (*Fake) OpenFile

func (fake *Fake) OpenFile(arg1 string, arg2 int, arg3 os.FileMode) (*os.File, error)

OpenFile ...

func (*Fake) OpenFileArgsForCall

func (fake *Fake) OpenFileArgsForCall(i int) (string, int, os.FileMode)

OpenFileArgsForCall ...

func (*Fake) OpenFileCallCount

func (fake *Fake) OpenFileCallCount() int

OpenFileCallCount ...

func (*Fake) OpenFileReturns

func (fake *Fake) OpenFileReturns(result1 *os.File, result2 error)

OpenFileReturns ...

func (*Fake) Remove

func (fake *Fake) Remove(arg1 string) error

Remove ...

func (*Fake) RemoveArgsForCall

func (fake *Fake) RemoveArgsForCall(i int) string

RemoveArgsForCall ...

func (*Fake) RemoveCallCount

func (fake *Fake) RemoveCallCount() int

RemoveCallCount ...

func (*Fake) RemoveReturns

func (fake *Fake) RemoveReturns(result1 error)

RemoveReturns ...

func (*Fake) Rename

func (fake *Fake) Rename(arg1 string, arg2 string) error

Rename ...

func (*Fake) RenameArgsForCall

func (fake *Fake) RenameArgsForCall(i int) (string, string)

RenameArgsForCall ...

func (*Fake) RenameCallCount

func (fake *Fake) RenameCallCount() int

RenameCallCount ...

func (*Fake) RenameReturns

func (fake *Fake) RenameReturns(result1 error)

RenameReturns ...

func (*Fake) Stat

func (fake *Fake) Stat(arg1 string) (os.FileInfo, error)

Stat ...

func (*Fake) StatArgsForCall

func (fake *Fake) StatArgsForCall(i int) string

StatArgsForCall ...

func (*Fake) StatCallCount

func (fake *Fake) StatCallCount() int

StatCallCount ...

func (*Fake) StatReturns

func (fake *Fake) StatReturns(result1 os.FileInfo, result2 error)

StatReturns ...

type OS

type OS interface {
	Rename(string, string) error
	Remove(string) error
	Chmod(string, os.FileMode) error
	Chown(string, int, int) error
	OpenFile(string, int, os.FileMode) (*os.File, error)
	Stat(string) (os.FileInfo, error)
	FindProcess(int) (Process, error)
	Getwd() (string, error)
}

OS is an interface around os

type Process

type Process interface {
	Kill() error
	Release() error
	Signal(os.Signal) error
	Wait() (ProcessState, error)
	GetPid() int
	SetPid(int)
}

Process is an interface around os.Process

func NewProcess

func NewProcess(process ...*os.Process) Process

NewProcess creates a struct that behaves like os.Process

type ProcessFake

type ProcessFake struct {
	KillStub func() error

	ReleaseStub func() error

	SignalStub func(os.Signal) error

	WaitStub func() (ProcessState, error)

	GetPidStub func() int

	SetPidStub func(int)
	// contains filtered or unexported fields
}

ProcessFake ...

func NewProcessFake

func NewProcessFake() *ProcessFake

NewProcessFake is the preferred way to initialise a ProcessFake

func (*ProcessFake) GetPid

func (fake *ProcessFake) GetPid() int

GetPid ...

func (*ProcessFake) GetPidCallCount

func (fake *ProcessFake) GetPidCallCount() int

GetPidCallCount ...

func (*ProcessFake) GetPidReturns

func (fake *ProcessFake) GetPidReturns(result1 int)

GetPidReturns ...

func (*ProcessFake) Invocations

func (fake *ProcessFake) Invocations() map[string][][]interface{}

Invocations ...

func (*ProcessFake) Kill

func (fake *ProcessFake) Kill() error

Kill ...

func (*ProcessFake) KillCallCount

func (fake *ProcessFake) KillCallCount() int

KillCallCount ...

func (*ProcessFake) KillReturns

func (fake *ProcessFake) KillReturns(result1 error)

KillReturns ...

func (*ProcessFake) Release

func (fake *ProcessFake) Release() error

Release ...

func (*ProcessFake) ReleaseCallCount

func (fake *ProcessFake) ReleaseCallCount() int

ReleaseCallCount ...

func (*ProcessFake) ReleaseReturns

func (fake *ProcessFake) ReleaseReturns(result1 error)

ReleaseReturns ...

func (*ProcessFake) SetPid

func (fake *ProcessFake) SetPid(arg1 int)

SetPid ...

func (*ProcessFake) SetPidArgsForCall

func (fake *ProcessFake) SetPidArgsForCall(i int) int

SetPidArgsForCall ...

func (*ProcessFake) SetPidCallCount

func (fake *ProcessFake) SetPidCallCount() int

SetPidCallCount ...

func (*ProcessFake) Signal

func (fake *ProcessFake) Signal(arg1 os.Signal) error

Signal ...

func (*ProcessFake) SignalArgsForCall

func (fake *ProcessFake) SignalArgsForCall(i int) os.Signal

SignalArgsForCall ...

func (*ProcessFake) SignalCallCount

func (fake *ProcessFake) SignalCallCount() int

SignalCallCount ...

func (*ProcessFake) SignalReturns

func (fake *ProcessFake) SignalReturns(result1 error)

SignalReturns ...

func (*ProcessFake) Wait

func (fake *ProcessFake) Wait() (ProcessState, error)

Wait ...

func (*ProcessFake) WaitCallCount

func (fake *ProcessFake) WaitCallCount() int

WaitCallCount ...

func (*ProcessFake) WaitReturns

func (fake *ProcessFake) WaitReturns(result1 ProcessState, result2 error)

WaitReturns ...

type ProcessReal

type ProcessReal struct {
	// contains filtered or unexported fields
}

ProcessReal is a wrapper around os.Process that implements ios.Process

func (*ProcessReal) GetPid

func (p *ProcessReal) GetPid() int

GetPid is a wrapper around getting os.Process.Pid

func (*ProcessReal) Kill

func (p *ProcessReal) Kill() error

Kill is a wrapper around os.Process.Kill()

func (*ProcessReal) Release

func (p *ProcessReal) Release() error

Release is a wrapper around os.Process.Release()

func (*ProcessReal) SetPid

func (p *ProcessReal) SetPid(pid int)

SetPid is a wrapper around setting os.Process.Pid

func (*ProcessReal) Signal

func (p *ProcessReal) Signal(sig os.Signal) error

Signal is a wrapper around os.Process.Signal()

func (*ProcessReal) Wait

func (p *ProcessReal) Wait() (ProcessState, error)

Wait is a wrapper around os.Process.Wait()

type ProcessState added in v1.1.0

type ProcessState interface {
	Exited() bool
	Pid() int
	String() string
	Success() bool
	Sys() interface{}
	SysUsage() interface{}
	SystemTime() time.Duration
	UserTime() time.Duration
}

ProcessState is an interface around os.ProcessState

func NewProcessState added in v1.1.0

func NewProcessState(processState ...*os.ProcessState) ProcessState

NewProcessState creates a struct that behaves like os.Process

type ProcessStateFake added in v1.1.0

type ProcessStateFake struct {
	ExitedStub func() bool

	PidStub func() int

	StringStub func() string

	SuccessStub func() bool

	SysStub func() interface{}

	SysUsageStub func() interface{}

	SystemTimeStub func() time.Duration

	UserTimeStub func() time.Duration
	// contains filtered or unexported fields
}

ProcessStateFake ...

func NewProcessStateFake added in v1.1.0

func NewProcessStateFake() *ProcessStateFake

NewProcessStateFake is the preferred way to initialise a ProcessStateFake

func (*ProcessStateFake) Exited added in v1.1.0

func (fake *ProcessStateFake) Exited() bool

Exited ...

func (*ProcessStateFake) ExitedCallCount added in v1.1.0

func (fake *ProcessStateFake) ExitedCallCount() int

ExitedCallCount ...

func (*ProcessStateFake) ExitedReturns added in v1.1.0

func (fake *ProcessStateFake) ExitedReturns(result1 bool)

ExitedReturns ...

func (*ProcessStateFake) Invocations added in v1.1.0

func (fake *ProcessStateFake) Invocations() map[string][][]interface{}

Invocations ...

func (*ProcessStateFake) Pid added in v1.1.0

func (fake *ProcessStateFake) Pid() int

Pid ...

func (*ProcessStateFake) PidCallCount added in v1.1.0

func (fake *ProcessStateFake) PidCallCount() int

PidCallCount ...

func (*ProcessStateFake) PidReturns added in v1.1.0

func (fake *ProcessStateFake) PidReturns(result1 int)

PidReturns ...

func (*ProcessStateFake) String added in v1.1.0

func (fake *ProcessStateFake) String() string

String ...

func (*ProcessStateFake) StringCallCount added in v1.1.0

func (fake *ProcessStateFake) StringCallCount() int

StringCallCount ...

func (*ProcessStateFake) StringReturns added in v1.1.0

func (fake *ProcessStateFake) StringReturns(result1 string)

StringReturns ...

func (*ProcessStateFake) Success added in v1.1.0

func (fake *ProcessStateFake) Success() bool

Success ...

func (*ProcessStateFake) SuccessCallCount added in v1.1.0

func (fake *ProcessStateFake) SuccessCallCount() int

SuccessCallCount ...

func (*ProcessStateFake) SuccessReturns added in v1.1.0

func (fake *ProcessStateFake) SuccessReturns(result1 bool)

SuccessReturns ...

func (*ProcessStateFake) Sys added in v1.1.0

func (fake *ProcessStateFake) Sys() interface{}

Sys ...

func (*ProcessStateFake) SysCallCount added in v1.1.0

func (fake *ProcessStateFake) SysCallCount() int

SysCallCount ...

func (*ProcessStateFake) SysReturns added in v1.1.0

func (fake *ProcessStateFake) SysReturns(result1 interface{})

SysReturns ...

func (*ProcessStateFake) SysUsage added in v1.1.0

func (fake *ProcessStateFake) SysUsage() interface{}

SysUsage ...

func (*ProcessStateFake) SysUsageCallCount added in v1.1.0

func (fake *ProcessStateFake) SysUsageCallCount() int

SysUsageCallCount ...

func (*ProcessStateFake) SysUsageReturns added in v1.1.0

func (fake *ProcessStateFake) SysUsageReturns(result1 interface{})

SysUsageReturns ...

func (*ProcessStateFake) SystemTime added in v1.1.0

func (fake *ProcessStateFake) SystemTime() time.Duration

SystemTime ...

func (*ProcessStateFake) SystemTimeCallCount added in v1.1.0

func (fake *ProcessStateFake) SystemTimeCallCount() int

SystemTimeCallCount ...

func (*ProcessStateFake) SystemTimeReturns added in v1.1.0

func (fake *ProcessStateFake) SystemTimeReturns(result1 time.Duration)

SystemTimeReturns ...

func (*ProcessStateFake) UserTime added in v1.1.0

func (fake *ProcessStateFake) UserTime() time.Duration

UserTime ...

func (*ProcessStateFake) UserTimeCallCount added in v1.1.0

func (fake *ProcessStateFake) UserTimeCallCount() int

UserTimeCallCount ...

func (*ProcessStateFake) UserTimeReturns added in v1.1.0

func (fake *ProcessStateFake) UserTimeReturns(result1 time.Duration)

UserTimeReturns ...

type ProcessStateReal added in v1.1.0

type ProcessStateReal struct {
	// contains filtered or unexported fields
}

ProcessStateReal is a wrapper around os.Process that implements ios.ProcessState

func (*ProcessStateReal) Exited added in v1.1.0

func (p *ProcessStateReal) Exited() bool

Exited is a wrapper around os.ProcessState.Exited()

func (*ProcessStateReal) Pid added in v1.1.0

func (p *ProcessStateReal) Pid() int

Pid is a wrapper around os.ProcessState.Pid()

func (*ProcessStateReal) String added in v1.1.0

func (p *ProcessStateReal) String() string

String is a wrapper around os.ProcessState.String()

func (*ProcessStateReal) Success added in v1.1.0

func (p *ProcessStateReal) Success() bool

Success is a wrapper around os.ProcessState.Success()

func (*ProcessStateReal) Sys added in v1.1.0

func (p *ProcessStateReal) Sys() interface{}

Sys is a wrapper around os.ProcessState.Sys()

func (*ProcessStateReal) SysUsage added in v1.1.0

func (p *ProcessStateReal) SysUsage() interface{}

SysUsage is a wrapper around os.ProcessState.SysUsage()

func (*ProcessStateReal) SystemTime added in v1.1.0

func (p *ProcessStateReal) SystemTime() time.Duration

SystemTime is a wrapper around os.ProcessState.SystemTime()

func (*ProcessStateReal) UserTime added in v1.1.0

func (p *ProcessStateReal) UserTime() time.Duration

UserTime is a wrapper around os.ProcessState.UserTime()

type Real

type Real struct{}

Real is a wrapper around os that implements ios.OS

func New

func New() *Real

New creates a struct that behaves like the os package

func (*Real) Chmod

func (*Real) Chmod(name string, mode os.FileMode) error

Chmod is a wrapper around os.Chmod()

func (*Real) Chown

func (*Real) Chown(name string, uid, gid int) error

Chown is a wrapper around os.Chown()

func (*Real) FindProcess

func (*Real) FindProcess(pid int) (Process, error)

FindProcess is a wrapper around os.FindProcess()

func (*Real) Getwd

func (*Real) Getwd() (string, error)

Getwd is a wrapper around os.Getwd()

func (*Real) OpenFile

func (*Real) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

OpenFile is a wrapper around os.OpenFile()

func (*Real) Remove

func (*Real) Remove(path string) error

Remove is a wrapper around os.Remove()

func (*Real) Rename

func (*Real) Rename(oldpath, newpath string) error

Rename is a wrapper around os.Rename()

func (*Real) Stat

func (*Real) Stat(name string) (os.FileInfo, error)

Stat is a wrapper around os.Stat()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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