pingdomclient

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2017 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CheckTypeHTTP       = "http"
	CheckTypeHTTPCustom = "httpcustom"
	CheckTypeTCP        = "tcp"
	CheckTypePing       = "ping"
	CheckTypeDNS        = "dns"
	CheckTypeUDP        = "udp"
	CheckTypeSMTP       = "smtp"
	CheckTypePOP3       = "pop3"
	CheckTypeIMAP       = "imap"
)

This const block defines all the Check types that are supported by the Pingdom API TODO: currently only HTTP is supported, need to add support for all the others

View Source
const (
	APIv21Checks = "/api/2.1/checks"
)

This const block defines all the Pingdom API Endpoints supported by this package

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check interface {
	GetType() string

	SetData(map[string]interface{}) error
	SetID(int)
	GetID() int
	Compare(Check) bool
	// contains filtered or unexported methods
}

Check allows us to work with multiple structs when working with the Pingdom API

func NewHTTPCheck

func NewHTTPCheck(name, endpoint string) (Check, error)

NewHTTPCheck creates a HTTP Check to send to the Pingdom API

type Client

type Client struct {
	Pass string
	User string
	// contains filtered or unexported fields
}

Client handles sending requests to the Pingdom API

func NewClient

func NewClient(user, pass string) *Client

NewClient creates a new Pingdom Client to make requests against the Pingdom API

func (*Client) CreateCheck

func (c *Client) CreateCheck(check Check) error

CreateCheck takes a Check struct and creates a new check against the Pingdom API

func (*Client) DeleteCheck

func (c *Client) DeleteCheck(check Check) error

DeleteCheck takes a Check struct and deletes the matching check in the Pingdom API

func (*Client) GetCheck

func (c *Client) GetCheck(ID int) (Check, error)

GetCheck takes an ID for a Check and retreives it from the Pingdom API

func (*Client) UpdateCheck

func (c *Client) UpdateCheck(check Check) error

UpdateCheck takes a Check struct and updates the matching check in the Pingdom API

Jump to

Keyboard shortcuts

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