Documentation
¶
Index ¶
- func GetLocalIP() (string, error)
- func NormalTicker(d int) *time.Ticker
- func NormalTimeout(d int) *time.Timer
- func NormalTimerRelaese(t *time.Timer)
- func RandomPort(min int, max int) int
- func RandomTimeout(min int) *time.Timer
- func RunCommand(cmds string, args ...string) (string, error)
- type Command
- type LinuxCommand
- func (c *LinuxCommand) Kill() error
- func (c *LinuxCommand) Run(cmds string, args []string) error
- func (c *LinuxCommand) RunCommand(cmds string, args []string) (string, error)
- func (c *LinuxCommand) RunCommandWithTimeout(timeout int, cmds string, args []string) (string, error)
- func (c *LinuxCommand) Scan(substr string, times int) error
- type MockACommand
- func (c *MockACommand) Kill() error
- func (c *MockACommand) Run(cmds string, args []string) error
- func (c *MockACommand) RunCommand(cmds string, args []string) (string, error)
- func (c *MockACommand) RunCommandWithTimeout(to int, cmds string, args []string) (string, error)
- func (c *MockACommand) Scan(substr string, times int) error
- type MockBCommand
- func (c *MockBCommand) Kill() error
- func (c *MockBCommand) Run(cmds string, args []string) error
- func (c *MockBCommand) RunCommand(cmds string, args []string) (string, error)
- func (c *MockBCommand) RunCommandWithTimeout(to int, cmds string, args []string) (string, error)
- func (c *MockBCommand) Scan(substr string, times int) error
- type MockCommand
- func (c *MockCommand) Kill() error
- func (c *MockCommand) Run(cmds string, args []string) error
- func (c *MockCommand) RunCommand(cmds string, args []string) (string, error)
- func (c *MockCommand) RunCommandWithTimeout(to int, cmds string, args []string) (string, error)
- func (c *MockCommand) Scan(substr string, times int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
type LinuxCommand ¶
type LinuxCommand struct {
// contains filtered or unexported fields
}
a warapper of command
func (*LinuxCommand) Kill ¶
func (c *LinuxCommand) Kill() error
func (*LinuxCommand) Run ¶
func (c *LinuxCommand) Run(cmds string, args []string) error
func (*LinuxCommand) RunCommand ¶
func (c *LinuxCommand) RunCommand(cmds string, args []string) (string, error)
func (*LinuxCommand) RunCommandWithTimeout ¶
func (*LinuxCommand) Scan ¶
func (c *LinuxCommand) Scan(substr string, times int) error
scan the substr until times reached or io.EOF got
type MockACommand ¶
type MockACommand struct {
}
mock command
func (*MockACommand) Kill ¶
func (c *MockACommand) Kill() error
func (*MockACommand) Run ¶
func (c *MockACommand) Run(cmds string, args []string) error
func (*MockACommand) RunCommand ¶
func (c *MockACommand) RunCommand(cmds string, args []string) (string, error)
func (*MockACommand) RunCommandWithTimeout ¶
func (*MockACommand) Scan ¶
func (c *MockACommand) Scan(substr string, times int) error
type MockBCommand ¶
type MockBCommand struct {
}
mock command
func (*MockBCommand) Kill ¶
func (c *MockBCommand) Kill() error
func (*MockBCommand) Run ¶
func (c *MockBCommand) Run(cmds string, args []string) error
func (*MockBCommand) RunCommand ¶
func (c *MockBCommand) RunCommand(cmds string, args []string) (string, error)
func (*MockBCommand) RunCommandWithTimeout ¶
func (*MockBCommand) Scan ¶
func (c *MockBCommand) Scan(substr string, times int) error
type MockCommand ¶
type MockCommand struct {
// contains filtered or unexported fields
}
mock command
func (*MockCommand) Kill ¶
func (c *MockCommand) Kill() error
func (*MockCommand) Run ¶
func (c *MockCommand) Run(cmds string, args []string) error
func (*MockCommand) RunCommand ¶
func (c *MockCommand) RunCommand(cmds string, args []string) (string, error)
func (*MockCommand) RunCommandWithTimeout ¶
func (*MockCommand) Scan ¶
func (c *MockCommand) Scan(substr string, times int) error
Source Files
¶
- common.go
- handler.go
- linux.go
- mock.go
Click to show internal directories.
Click to hide internal directories.