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 ¶
func NormalTicker ¶
func NormalTimeout ¶
func NormalTimerRelaese ¶
func RandomPort ¶
func RandomTimeout ¶
Types ¶
type Command ¶
type Command interface { Run(string, []string) error Scan(string, int) error Kill() error RunCommand(string, []string) (string, error) RunCommandWithTimeout(int, string, []string) (string, error) }
func NewLinuxCommand ¶
func NewMockACommand ¶
func NewMockACommand() Command
func NewMockBCommand ¶
func NewMockBCommand() Command
func NewMockCommand ¶
func NewMockCommand() 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) RunCommand ¶
func (c *LinuxCommand) RunCommand(cmds string, args []string) (string, error)
func (*LinuxCommand) RunCommandWithTimeout ¶
type MockACommand ¶
type MockACommand struct { }
mock command
func (*MockACommand) Kill ¶
func (c *MockACommand) Kill() error
func (*MockACommand) RunCommand ¶
func (c *MockACommand) RunCommand(cmds string, args []string) (string, error)
func (*MockACommand) RunCommandWithTimeout ¶
type MockBCommand ¶
type MockBCommand struct { }
mock command
func (*MockBCommand) Kill ¶
func (c *MockBCommand) Kill() error
func (*MockBCommand) RunCommand ¶
func (c *MockBCommand) RunCommand(cmds string, args []string) (string, error)
func (*MockBCommand) RunCommandWithTimeout ¶
type MockCommand ¶
type MockCommand struct {
// contains filtered or unexported fields
}
mock command
func (*MockCommand) Kill ¶
func (c *MockCommand) Kill() error
func (*MockCommand) RunCommand ¶
func (c *MockCommand) RunCommand(cmds string, args []string) (string, error)
func (*MockCommand) RunCommandWithTimeout ¶
Click to show internal directories.
Click to hide internal directories.