Documentation
¶
Overview ¶
Package serverchecker contains the functions to check if a cloud server is ready.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockSSHClient ¶ added in v0.1.2
type MockSSHClient struct { ConnectFunc func() error CloseFunc func() error ExecCommandFunc func(string) (string, error) }
func (*MockSSHClient) Close ¶ added in v0.1.2
func (m *MockSSHClient) Close() error
func (*MockSSHClient) Connect ¶ added in v0.1.2
func (m *MockSSHClient) Connect() error
func (*MockSSHClient) ExecCommand ¶ added in v0.1.2
func (m *MockSSHClient) ExecCommand(cmd string) (string, error)
type RealSSHClient ¶ added in v0.1.2
type RealSSHClient struct {
// contains filtered or unexported fields
}
func (*RealSSHClient) Close ¶ added in v0.1.2
func (r *RealSSHClient) Close() error
func (*RealSSHClient) Connect ¶ added in v0.1.2
func (r *RealSSHClient) Connect() error
func (*RealSSHClient) ExecCommand ¶ added in v0.1.2
func (r *RealSSHClient) ExecCommand(cmd string) (string, error)
type ServerChecker ¶
type ServerChecker struct {
// contains filtered or unexported fields
}
func NewServerChecker ¶
func (*ServerChecker) Check ¶ added in v0.1.2
func (sc *ServerChecker) Check() (bool, error)
Check verifies if the server is ready This is now a wrapper around CheckWithContext using the server's timeout
func (*ServerChecker) CheckWithContext ¶ added in v0.1.2
func (sc *ServerChecker) CheckWithContext(ctx context.Context) (bool, error)
CheckWithContext verifies if the server is ready using the provided context Returns true if the server is ready, false otherwise If an error occurs during checking, it returns false and the error
Click to show internal directories.
Click to hide internal directories.