Documentation
¶
Overview ¶
Package protocols is where the protocol-testers live.
Tests are dynamically instantiated at run-time, via a class-factory pattern, and due to their plugin nature they are simple to implement as they require only implementing a single method.
Index ¶
- func Handlers() []string
- func Register(id string, newfunc TestCtor)
- type DNSTest
- type FINGERTest
- type FTPTest
- type HTTPTest
- type IMAPSTest
- type IMAPTest
- type MYSQLTest
- type NNTPTest
- type PINGTest
- func (s *PINGTest) Arguments() map[string]string
- func (s *PINGTest) Example() string
- func (s *PINGTest) Ping4(target string) bool
- func (s *PINGTest) Ping6(target string) bool
- func (s *PINGTest) RunCommand(name string, args ...string) (stdout string, stderr string, exitCode int)
- func (s *PINGTest) RunTest(tst test.Test, target string, opts test.Options) error
- type POP3STest
- type POP3Test
- type PSQLTest
- type ProtocolTest
- type REDISTest
- type RSYNCTest
- type SMTPTest
- type SSHTest
- type TCPTest
- type TELNETTest
- type TestCtor
- type VNCTest
- type XMPPTest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DNSTest ¶
type DNSTest struct { }
DNSTest is our object.
func (*DNSTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*DNSTest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
type FINGERTest ¶
type FINGERTest struct { }
FINGERTest is our object.
func (*FINGERTest) Arguments ¶
func (s *FINGERTest) Arguments() map[string]string
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*FINGERTest) Example ¶
func (s *FINGERTest) Example() string
Example returns sample usage-instructions for self-documentation purposes.
type FTPTest ¶
type FTPTest struct { }
FTPTest is our object.
func (*FTPTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*FTPTest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
type HTTPTest ¶
type HTTPTest struct { }
HTTPTest is our object.
func (*HTTPTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*HTTPTest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
func (*HTTPTest) RunTest ¶
RunTest is the part of our API which is invoked to actually execute a HTTP-test against the given URL.
For the purposes of clarity this test makes a HTTP-fetch. The `test.Test` structure contains our raw test, and the `target` variable contains the IP address against which to make the request.
So:
tst.Target => "https://steve.kemp.fi/ target => "176.9.183.100"
type IMAPSTest ¶
type IMAPSTest struct { }
IMAPSTest is our object
func (*IMAPSTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*IMAPSTest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
type IMAPTest ¶
type IMAPTest struct { }
IMAPTest is our object
func (*IMAPTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*IMAPTest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
type MYSQLTest ¶
type MYSQLTest struct { }
MYSQLTest is our object
func (*MYSQLTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*MYSQLTest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
type NNTPTest ¶
type NNTPTest struct { }
NNTPTest is our object.
func (*NNTPTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*NNTPTest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
type PINGTest ¶
type PINGTest struct { }
PINGTest is our object.
func (*PINGTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*PINGTest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
func (*PINGTest) Ping4 ¶
Ping4 runs a ping test against an IPv4 address, returning true if the ping succeeded.
func (*PINGTest) Ping6 ¶
Ping6 runs a ping test against an IPv6 address, returning true if the ping succeeded.
func (*PINGTest) RunCommand ¶
func (s *PINGTest) RunCommand(name string, args ...string) (stdout string, stderr string, exitCode int)
RunCommand invokes an external binary and returns stdout/stderr/exit-code
type POP3STest ¶
type POP3STest struct { }
POP3STest is our object
func (*POP3STest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*POP3STest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
type POP3Test ¶
type POP3Test struct { }
POP3Test is our object
func (*POP3Test) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*POP3Test) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
type PSQLTest ¶
type PSQLTest struct { }
PSQLTest is our object
func (*PSQLTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*PSQLTest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
type ProtocolTest ¶
type ProtocolTest interface { // // Arguments return the arguments which this protocol-test accepts, along // with a regular expression which will be used to validate a non-empty // argument. // Arguments() map[string]string // Example should return a string describing how your protocol-test // works and is invoked. // // Optional arguments will automatically be documented. Example() string // // RunTest actually invokes the protocol-handler to run its // tests. // // Return a suitable error if the test fails, or nil to indicate // it passed. // RunTest(tst test.Test, target string, opts test.Options) error }
ProtocolTest interface is the core of our code, it defines the implementation methods which must be implemented to add a new protocol-test.
func ProtocolHandler ¶
func ProtocolHandler(id string) (a ProtocolTest)
ProtocolHandler is the factory-method which looks up and returns an object of the given type - if possible.
type REDISTest ¶
type REDISTest struct { }
REDISTest is our object
func (*REDISTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
type RSYNCTest ¶
type RSYNCTest struct { }
RSYNCTest is our object.
func (*RSYNCTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*RSYNCTest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
type SMTPTest ¶
type SMTPTest struct { }
SMTPTest is our object
func (*SMTPTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*SMTPTest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
type SSHTest ¶
type SSHTest struct { }
SSHTest is our object.
func (*SSHTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*SSHTest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
type TCPTest ¶
type TCPTest struct { }
TCPTest is our object
func (*TCPTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*TCPTest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
type TELNETTest ¶
type TELNETTest struct { }
TELNETTest is our object
func (*TELNETTest) Arguments ¶
func (s *TELNETTest) Arguments() map[string]string
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*TELNETTest) Example ¶
func (s *TELNETTest) Example() string
Example returns sample usage-instructions for self-documentation purposes.
type TestCtor ¶
type TestCtor func() ProtocolTest
TestCtor is the signature of a constructor-function.
type VNCTest ¶
type VNCTest struct { }
VNCTest is our object
func (*VNCTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*VNCTest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.
type XMPPTest ¶
type XMPPTest struct { }
XMPPTest is our object
func (*XMPPTest) Arguments ¶
Arguments returns the names of arguments which this protocol-test understands, along with corresponding regular-expressions to validate their values.
func (*XMPPTest) Example ¶
Example returns sample usage-instructions for self-documentation purposes.