services

package
v0.3.7-alpha5 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success = "Success!"
)

Variables

View Source
var ErrDNSLookupMissing = errors.New("you must pass a lookup parameter for DNS test")
View Source
var ErrDidNotMatchExpectedOutput = errors.New("did not match Expected Output")
View Source
var ErrFTPNeedsEitherTextOrReadFile = errors.New("FTP check_service needs either text, or read_file parameter")
View Source
var ErrFTPNeedsUsernameAndPassword = errors.New("FTP check_service needs username and password")
View Source
var ErrIMAPRequiresUsernameAndPassword = errors.New("IMAP check_service needs password, and username to operate")
View Source
var ErrInvalidResponseCodeReceived = errors.New("invalid response code received")
View Source
var ErrLDAPRequiresUsernamePasswordDomain = errors.New("LDAP check_service needs password, username, and Domain to operate")
View Source
var ErrNonZeroReturn = errors.New("process returned a non-zero code")
View Source
var ErrNumberOfRowsLessThanExpected = errors.New("number of rows was less than expected")
View Source
var ErrNumberOfRowsMoreThanExpected = errors.New("number of rows was more than expected")
View Source
var ErrParameterShouldBeEither = errors.New("parameter Operation should be one of the following")
View Source
var ErrSQLNeedsUsernameOrPassword = errors.New("sql check_service needs username, and password")
View Source
var ErrSQLRequiresCommand = errors.New("sql check needs a command parameter")
View Source
var ErrSSHRequiresUsernameAndPassword = errors.New("ssh check_service needs username, and password")
View Source
var ErrShareShouldNotBeEmpty = errors.New("parameter Share should not be empty")
View Source
var ErrUnsupportedDBType = errors.New("DBType should either be mysql, or postgres")
View Source
var ErrUnsupportedParameter = errors.New("invalid protocol selected")
View Source
var ErrWinrmRequiresUsernameAndPassword = errors.New("winrm check_service needs username, and password")

Functions

func ConstructURI

func ConstructURI(port, subdomain, host, path, scheme string) *url.URL

func ContainsString

func ContainsString(s []string, e string) bool

func IsSecure

func IsSecure(s string) bool

Types

type CalDav

type CalDav struct {
	Scheme         string
	Port           string
	Path           string
	Subdomain      string
	ExpectedOutput string
	Username       string
	Password       string
}

func NewCalDav

func NewCalDav() *CalDav

func (*CalDav) Execute

func (h *CalDav) Execute(e exec.Exec) (passed bool, logOutput string, err error)

func (*CalDav) Validate

func (h *CalDav) Validate() error

type DNS

type DNS struct {
	Lookup         string
	ExpectedOutput string
}

func NewDNS

func NewDNS() *DNS

func (*DNS) Execute

func (p *DNS) Execute(e exec.Exec) (passed bool, logOutput string, err error)

func (*DNS) Validate

func (p *DNS) Validate() error

type FTP

type FTP struct {
	Username string
	Password string
	Port     string
	// Text to upload to remote computer
	Text string
	// Name of the file to which write the parameter
	WriteFilename string
	// Filename to find on a remote computer
	ReadFilename string
	// Check expected output of the file
	ExpectedOutput string
}

func NewFTP

func NewFTP() *FTP

func (*FTP) Execute

func (f *FTP) Execute(e exec.Exec) (passed bool, l string, err error)

func (*FTP) Validate

func (f *FTP) Validate() error

type HTTP

type HTTP struct {
	ExpectedOutput string
	Scheme         string
	Port           string
	Path           string
	Subdomain      string
}

func NewHTTP

func NewHTTP() *HTTP

func (*HTTP) Execute

func (h *HTTP) Execute(e exec.Exec) (passed bool, logOutput string, err error)

func (*HTTP) Validate

func (h *HTTP) Validate() error

type IMAP

type IMAP struct {
	Username string
	Password string
	Port     string
	Scheme   string
}

func NewIMAP

func NewIMAP() *IMAP

func (*IMAP) Execute

func (i *IMAP) Execute(e exec.Exec) (passed bool, logOutput string, err error)

func (*IMAP) Validate

func (i *IMAP) Validate() error

type LDAP

type LDAP struct {
	Username            string
	Password            string
	Domain              string
	Port                string
	BaseDN              string
	TransportProtocol   string
	ApplicationProtocol string
	Filter              string
	Attributes          string
}

func NewLDAP

func NewLDAP() *LDAP

func (*LDAP) Execute

func (l *LDAP) Execute(e exec.Exec) (passed bool, logOutput string, err error)

func (*LDAP) Validate

func (l *LDAP) Validate() error

type Ping

type Ping struct {
	Protocol string
	Attempts string
}

func NewPing

func NewPing() *Ping

func (*Ping) Execute

func (p *Ping) Execute(e exec.Exec) (passed bool, logOutput string, err error)

func (*Ping) Validate

func (p *Ping) Validate() error

type SMB

type SMB struct {
	Username          string
	Password          string
	Domain            string
	Port              string
	TransportProtocol string
	Share             string
	FileName          string
	Text              string
	Operation         string
	ExpectedOutput    string
}

func NewSMB

func NewSMB() *SMB

func (*SMB) Execute

func (s *SMB) Execute(e exec.Exec) (passed bool, logOutput string, err error)

func (*SMB) Validate

func (s *SMB) Validate() error

type SQL

type SQL struct {
	Username        string
	Password        string
	Port            string
	DBType          string
	DBName          string
	Command         string
	MinExpectedRows string
	MaxExpectedRows string
}

func NewSQL

func NewSQL() *SQL

func (*SQL) Execute

func (w *SQL) Execute(e exec.Exec) (passed bool, logOutput string, err error)

func (*SQL) Validate

func (w *SQL) Validate() error

type SSH

type SSH struct {
	Username       string
	Password       string
	Port           string
	Command        string
	ExpectedOutput string
}

func NewSSH

func NewSSH() *SSH

func (*SSH) Execute

func (s *SSH) Execute(e exec.Exec) (passed bool, logOutput string, err error)

func (*SSH) Validate

func (s *SSH) Validate() error

type Winrm

type Winrm struct {
	Username       string
	Password       string
	Port           string
	Command        string
	ExpectedOutput string
	Scheme         string
	ClientType     string
}

func NewWinrm

func NewWinrm() *Winrm

func (*Winrm) Execute

func (w *Winrm) Execute(e exec.Exec) (passed bool, logOutput string, err error)

func (*Winrm) Validate

func (w *Winrm) Validate() error

Jump to

Keyboard shortcuts

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