ios

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2017 License: MIT Imports: 2 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() (*os.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() (*os.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() (*os.ProcessState, error)

Wait ...

func (*ProcessFake) WaitCallCount

func (fake *ProcessFake) WaitCallCount() int

WaitCallCount ...

func (*ProcessFake) WaitReturns

func (fake *ProcessFake) WaitReturns(result1 *os.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() (*os.ProcessState, error)

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

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