protocols

package
v0.0.0-...-d0afcd5 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: GPL-2.0 Imports: 36 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handlers

func Handlers() []string

Handlers returns the names of all the registered protocol-handlers.

func Register

func Register(id string, newfunc TestCtor)

Register a test-type with a constructor.

Types

type DNSTest

type DNSTest struct {
}

DNSTest is our object.

func (*DNSTest) Arguments

func (s *DNSTest) 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 (*DNSTest) Example

func (s *DNSTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*DNSTest) GetUniqueHashForTest

func (s *DNSTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*DNSTest) RunTest

func (s *DNSTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a DNS-lookup against the named host, and compare the result with what the user specified. look for a response which appears to be an FTP-server.

func (*DNSTest) ShouldResolveHostname

func (s *DNSTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type DumbTest

type DumbTest struct {
	// contains filtered or unexported fields
}

DumbTest is our object.

func (*DumbTest) Arguments

func (s *DumbTest) 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 (*DumbTest) Example

func (s *DumbTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*DumbTest) GetUniqueHashForTest

func (s *DumbTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*DumbTest) RunTest

func (s *DumbTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

func (*DumbTest) ShouldResolveHostname

func (s *DumbTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

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.

func (*FINGERTest) GetUniqueHashForTest

func (s *FINGERTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*FINGERTest) RunTest

func (s *FINGERTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a TCP connection, defaulting to port 79, and look for a non-empty response.

func (*FINGERTest) ShouldResolveHostname

func (s *FINGERTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type FTPTest

type FTPTest struct {
}

FTPTest is our object.

func (*FTPTest) Arguments

func (s *FTPTest) 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 (*FTPTest) Example

func (s *FTPTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*FTPTest) GetUniqueHashForTest

func (s *FTPTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*FTPTest) RunTest

func (s *FTPTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a TCP connection, defaulting to port 21, and look for a response which appears to be an FTP-server.

func (*FTPTest) ShouldResolveHostname

func (s *FTPTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type HTTPTest

type HTTPTest struct {
}

HTTPTest is our object.

func (*HTTPTest) Arguments

func (s *HTTPTest) 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 (*HTTPTest) Example

func (s *HTTPTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*HTTPTest) GetUniqueHashForTest

func (s *HTTPTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*HTTPTest) RunTest

func (s *HTTPTest) RunTest(tst test.Test, target string, opts test.Options) error

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"

func (*HTTPTest) SSLExpiration

func (s *HTTPTest) SSLExpiration(host string, verbose bool) (int64, string, error)

SSLExpiration returns the number of hours remaining for a given SSL certificate chain.

func (*HTTPTest) ShouldResolveHostname

func (s *HTTPTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type IMAPSTest

type IMAPSTest struct {
}

IMAPSTest is our object

func (*IMAPSTest) Arguments

func (s *IMAPSTest) 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 (*IMAPSTest) Example

func (s *IMAPSTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*IMAPSTest) GetUniqueHashForTest

func (s *IMAPSTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*IMAPSTest) RunTest

func (s *IMAPSTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a IMAP connection to the specified host, and if a username + password were specified we then attempt to authenticate to the remote host too.

func (*IMAPSTest) ShouldResolveHostname

func (s *IMAPSTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type IMAPTest

type IMAPTest struct {
}

IMAPTest is our object

func (*IMAPTest) Arguments

func (s *IMAPTest) 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 (*IMAPTest) Example

func (s *IMAPTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*IMAPTest) GetUniqueHashForTest

func (s *IMAPTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*IMAPTest) RunTest

func (s *IMAPTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a IMAP connection to the specified host, and if a username + password were specified we then attempt to authenticate to the remote host too.

func (*IMAPTest) ShouldResolveHostname

func (s *IMAPTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type K8SSvcTest

type K8SSvcTest struct {
}

K8SSvcTest is our object.

func (*K8SSvcTest) Arguments

func (s *K8SSvcTest) 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 (*K8SSvcTest) Example

func (s *K8SSvcTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*K8SSvcTest) GetUniqueHashForTest

func (s *K8SSvcTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*K8SSvcTest) RunTest

func (s *K8SSvcTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

func (*K8SSvcTest) ShouldResolveHostname

func (s *K8SSvcTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type MYSQLTest

type MYSQLTest struct {
}

MYSQLTest is our object

func (*MYSQLTest) Arguments

func (s *MYSQLTest) 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 (*MYSQLTest) Example

func (s *MYSQLTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*MYSQLTest) GetUniqueHashForTest

func (s *MYSQLTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*MYSQLTest) RunTest

func (s *MYSQLTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a TCP connection to the host and attempt to login with the specified username & password.

func (*MYSQLTest) ShouldResolveHostname

func (s *MYSQLTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type NNTPTest

type NNTPTest struct {
}

NNTPTest is our object.

func (*NNTPTest) Arguments

func (s *NNTPTest) 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 (*NNTPTest) Example

func (s *NNTPTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*NNTPTest) GetUniqueHashForTest

func (s *NNTPTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*NNTPTest) RunTest

func (s *NNTPTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a TCP connection, defaulting to port 119, and look for a response which appears to be an NNTP-server.

func (*NNTPTest) ShouldResolveHostname

func (s *NNTPTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type PINGTest

type PINGTest struct {
}

PINGTest is our object.

func (*PINGTest) Arguments

func (s *PINGTest) 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 (*PINGTest) Example

func (s *PINGTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*PINGTest) GetUniqueHashForTest

func (s *PINGTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*PINGTest) Ping4

func (s *PINGTest) Ping4(target string) bool

Ping4 runs a ping test against an IPv4 address, returning true if the ping succeeded.

func (*PINGTest) Ping6

func (s *PINGTest) Ping6(target string) bool

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

func (*PINGTest) RunTest

func (s *PINGTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we run a ping-command with the appropriate binary depending on the address-family of the target host.

func (*PINGTest) ShouldResolveHostname

func (s *PINGTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type POP3STest

type POP3STest struct {
}

POP3STest is our object

func (*POP3STest) Arguments

func (s *POP3STest) 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 (*POP3STest) Example

func (s *POP3STest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*POP3STest) GetUniqueHashForTest

func (s *POP3STest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*POP3STest) RunTest

func (s *POP3STest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a POP3 connection to the specified host, and if a username + password were specified we then attempt to authenticate to the remote host too.

func (*POP3STest) ShouldResolveHostname

func (s *POP3STest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type POP3Test

type POP3Test struct {
}

POP3Test is our object

func (*POP3Test) Arguments

func (s *POP3Test) 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 (*POP3Test) Example

func (s *POP3Test) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*POP3Test) GetUniqueHashForTest

func (s *POP3Test) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*POP3Test) RunTest

func (s *POP3Test) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a POP3 connection to the specified host, and if a username + password were specified we then attempt to authenticate to the remote host too.

func (*POP3Test) ShouldResolveHostname

func (s *POP3Test) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type PSQLTest

type PSQLTest struct {
}

PSQLTest is our object

func (*PSQLTest) Arguments

func (s *PSQLTest) 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 (*PSQLTest) Example

func (s *PSQLTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*PSQLTest) GetUniqueHashForTest

func (s *PSQLTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*PSQLTest) RunTest

func (s *PSQLTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a TCP connection to the database host and attempt to login with the specified username & password.

func (*PSQLTest) ShouldResolveHostname

func (s *PSQLTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type ProtocolTest

type ProtocolTest interface {
	//
	// Arguments return the arguments which this protocol-test, 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

	ShouldResolveHostname() bool

	GetUniqueHashForTest(tst test.Test, opts test.Options) *string
}

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

func (s *REDISTest) 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 (*REDISTest) Example

func (s *REDISTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*REDISTest) GetUniqueHashForTest

func (s *REDISTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*REDISTest) RunTest

func (s *REDISTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a Redis-test against the given target.

func (*REDISTest) ShouldResolveHostname

func (s *REDISTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type RSYNCTest

type RSYNCTest struct {
}

RSYNCTest is our object.

func (*RSYNCTest) Arguments

func (s *RSYNCTest) 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 (*RSYNCTest) Example

func (s *RSYNCTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*RSYNCTest) GetUniqueHashForTest

func (s *RSYNCTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*RSYNCTest) RunTest

func (s *RSYNCTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a TCP connection, defaulting to port 873, and look for a response which appears to be an rsync-server.

func (*RSYNCTest) ShouldResolveHostname

func (s *RSYNCTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type SMTPTest

type SMTPTest struct {
}

SMTPTest is our object

func (*SMTPTest) Arguments

func (s *SMTPTest) 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 (*SMTPTest) Example

func (s *SMTPTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*SMTPTest) GetUniqueHashForTest

func (s *SMTPTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*SMTPTest) RunTest

func (s *SMTPTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a TCP connection, defaulting to port 25, and look for a response which appears to be an SMTP-server.

func (*SMTPTest) ShouldResolveHostname

func (s *SMTPTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type SSHTest

type SSHTest struct {
}

SSHTest is our object.

func (*SSHTest) Arguments

func (s *SSHTest) 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 (*SSHTest) Example

func (s *SSHTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*SSHTest) GetUniqueHashForTest

func (s *SSHTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*SSHTest) RunTest

func (s *SSHTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a TCP connection, defaulting to port 22, and look for a response which appears to be an SSH-server.

func (*SSHTest) ShouldResolveHostname

func (s *SSHTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type SSLTest

type SSLTest struct {
}

SSLTest is our object.

func (*SSLTest) Arguments

func (s *SSLTest) 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 (*SSLTest) Example

func (s *SSLTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*SSLTest) GetUniqueHashForTest

func (s *SSLTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*SSLTest) RunTest

func (s *SSLTest) RunTest(tst test.Test, _ string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a SSL-test against the given URL.

For the purposes of clarity this test makes a TCP dial and verifies SSL certificates validity. 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 => "steve.kemp.fi

target => "176.9.183.100"

func (*SSLTest) SSLExpiration

func (s *SSLTest) SSLExpiration(host string, verbose bool) (int64, error)

SSLExpiration returns the number of hours remaining for a given SSL certificate chain.

func (*SSLTest) ShouldResolveHostname

func (s *SSLTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type TCPTest

type TCPTest struct {
}

TCPTest is our object

func (*TCPTest) Arguments

func (s *TCPTest) 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 (*TCPTest) Example

func (s *TCPTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*TCPTest) GetUniqueHashForTest

func (s *TCPTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*TCPTest) RunTest

func (s *TCPTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a TCP connection to the specified port, and assume that everything is OK if that succeeded.

func (*TCPTest) ShouldResolveHostname

func (s *TCPTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

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.

func (*TELNETTest) GetUniqueHashForTest

func (s *TELNETTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*TELNETTest) RunTest

func (s *TELNETTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a TCP connection to the specified port, and assume that everything is OK if that succeeded.

func (*TELNETTest) ShouldResolveHostname

func (s *TELNETTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

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

func (s *VNCTest) 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 (*VNCTest) Example

func (s *VNCTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*VNCTest) GetUniqueHashForTest

func (s *VNCTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*VNCTest) RunTest

func (s *VNCTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a TCP connection, defaulting to port 5900, and look for a response which appears to be an VNC-server.

func (*VNCTest) ShouldResolveHostname

func (s *VNCTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

type XMPPTest

type XMPPTest struct {
}

XMPPTest is our object

func (*XMPPTest) Arguments

func (s *XMPPTest) 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 (*XMPPTest) Example

func (s *XMPPTest) Example() string

Example returns sample usage-instructions for self-documentation purposes.

func (*XMPPTest) GetUniqueHashForTest

func (s *XMPPTest) GetUniqueHashForTest(tst test.Test, opts test.Options) *string

func (*XMPPTest) RunTest

func (s *XMPPTest) RunTest(tst test.Test, target string, opts test.Options) error

RunTest is the part of our API which is invoked to actually execute a test against the given target.

In this case we make a TCP connection, defaulting to port 5222, and look for a response which appears to be an XMPP-server.

func (*XMPPTest) ShouldResolveHostname

func (s *XMPPTest) ShouldResolveHostname() bool

ShouldResolveHostname returns if this protocol requires the hostname resolution of the first test argument

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL