statuscake

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: MIT Imports: 23 Imported by: 4

README

statuscake-go test

The Go implementation of the StatusCake API client. Documentation for this library can be found here.

Prerequisites

You will need the following things properly installed on your computer.

Installation

With Go module support (Go 1.11+), add the following import

import "github.com/StatusCakeDev/statuscake-go"

to your code, and then go [build|run|test] will automatically fetch the necessary dependencies.

Otherwise, to install the statuscake-go package, run the following command:

$ go get -u github.com/StatusCakeDev/statuscake-go

Usage

Within any Go file instantiate an API client and execute a request:

package main

import (
	"context"
	"fmt"

	"github.com/StatusCakeDev/statuscake-go"
	"github.com/StatusCakeDev/statuscake-go/credentials"
)

func main() {
	bearer := credentials.NewBearerWithStaticToken(apiToken)
	client := statuscake.NewClient(statuscake.WithRequestCredentials(bearer))

	tests, err := client.ListUptimeTests(context.Background()).Execute()
	if err != nil {
		panic(err)
	}

	fmt.Printg("%+v\n", tests.Data)

License

This project is licensed under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ContextServerIndex uses a server configuration from the index.
	ContextServerIndex = contextKey("serverIndex")

	// ContextOperationServerIndices uses a server configuration from the index mapping.
	ContextOperationServerIndices = contextKey("serverOperationIndices")

	// ContextServerVariables overrides a server configuration variables.
	ContextServerVariables = contextKey("serverVariables")

	// ContextOperationServerVariables overrides a server configuration variables using operation specific values.
	ContextOperationServerVariables = contextKey("serverOperationVariables")
)

Functions

func Errors

func Errors(err error) map[string][]string

Errors returns the map of error messages contained in an APIError. If the error passed into the function cannot be asserted to be of type APIError then an empty map is returned.

func HeartbeatTestStatusValues added in v1.3.0

func HeartbeatTestStatusValues() []string

HeartbeatTestStatusValues returns the values of HeartbeatTestStatus.

func MaintenanceWindowRepeatIntervalValues

func MaintenanceWindowRepeatIntervalValues() []string

MaintenanceWindowRepeatIntervalValues returns the values of MaintenanceWindowRepeatInterval.

func MaintenanceWindowStateValues

func MaintenanceWindowStateValues() []string

MaintenanceWindowStateValues returns the values of MaintenanceWindowState.

func MonitoringLocationStatusValues

func MonitoringLocationStatusValues() []string

MonitoringLocationStatusValues returns the values of MonitoringLocationStatus.

func PagespeedTestCheckRateValues

func PagespeedTestCheckRateValues() []int32

PagespeedTestCheckRateValues returns the values of PagespeedTestCheckRate.

func PagespeedTestRegionValues

func PagespeedTestRegionValues() []string

PagespeedTestRegionValues returns the values of PagespeedTestRegion.

func PagespeedTestThrottlingValues

func PagespeedTestThrottlingValues() []string

PagespeedTestThrottlingValues returns the values of PagespeedTestThrottling.

func PtrBool

func PtrBool(v bool) *bool

PtrBool is a helper routine that returns a pointer to given boolean value.

func PtrFloat32

func PtrFloat32(v float32) *float32

PtrFloat32 is a helper routine that returns a pointer to given float value.

func PtrFloat64

func PtrFloat64(v float64) *float64

PtrFloat64 is a helper routine that returns a pointer to given float value.

func PtrInt

func PtrInt(v int) *int

PtrInt is a helper routine that returns a pointer to given integer value.

func PtrInt32

func PtrInt32(v int32) *int32

PtrInt32 is a helper routine that returns a pointer to given integer value.

func PtrInt64

func PtrInt64(v int64) *int64

PtrInt64 is a helper routine that returns a pointer to given integer value.

func PtrString

func PtrString(v string) *string

PtrString is a helper routine that returns a pointer to given string value.

func PtrTime

func PtrTime(v time.Time) *time.Time

PtrTime is helper routine that returns a pointer to given Time value.

func SSLTestCheckRateValues

func SSLTestCheckRateValues() []int32

SSLTestCheckRateValues returns the values of SSLTestCheckRate.

func UptimeTestCheckRateValues

func UptimeTestCheckRateValues() []int32

UptimeTestCheckRateValues returns the values of UptimeTestCheckRate.

func UptimeTestProcessingStateValues

func UptimeTestProcessingStateValues() []string

UptimeTestProcessingStateValues returns the values of UptimeTestProcessingState.

func UptimeTestStatusValues

func UptimeTestStatusValues() []string

UptimeTestStatusValues returns the values of UptimeTestStatus.

func UptimeTestTypeValues

func UptimeTestTypeValues() []string

UptimeTestTypeValues returns the values of UptimeTestType.

Types

type APICreateContactGroupRequest

type APICreateContactGroupRequest struct {
	APIService ContactGroupsAPI
	// contains filtered or unexported fields
}

APICreateContactGroupRequest represents a request type.

func (APICreateContactGroupRequest) EmailAddresses

func (r APICreateContactGroupRequest) EmailAddresses(emailAddresses []string) APICreateContactGroupRequest

EmailAddresses sets emailAddresses on the request type.

func (APICreateContactGroupRequest) Execute

Execute executes the request.

func (APICreateContactGroupRequest) Integrations

func (r APICreateContactGroupRequest) Integrations(integrations []string) APICreateContactGroupRequest

Integrations sets integrations on the request type.

func (APICreateContactGroupRequest) MobileNumbers

func (r APICreateContactGroupRequest) MobileNumbers(mobileNumbers []string) APICreateContactGroupRequest

MobileNumbers sets mobileNumbers on the request type.

func (APICreateContactGroupRequest) Name

Name sets name on the request type.

func (APICreateContactGroupRequest) PingURL

PingURL sets pingUrl on the request type.

type APICreateHeartbeatTestRequest added in v1.3.0

type APICreateHeartbeatTestRequest struct {
	APIService HeartbeatAPI
	// contains filtered or unexported fields
}

APICreateHeartbeatTestRequest represents a request type.

func (APICreateHeartbeatTestRequest) ContactGroups added in v1.3.0

func (r APICreateHeartbeatTestRequest) ContactGroups(contactGroups []string) APICreateHeartbeatTestRequest

ContactGroups sets contactGroups on the request type.

func (APICreateHeartbeatTestRequest) Execute added in v1.3.0

Execute executes the request.

func (APICreateHeartbeatTestRequest) Host added in v1.3.0

Host sets host on the request type.

func (APICreateHeartbeatTestRequest) Name added in v1.3.0

Name sets name on the request type.

func (APICreateHeartbeatTestRequest) Paused added in v1.3.0

Paused sets paused on the request type.

func (APICreateHeartbeatTestRequest) Period added in v1.3.0

Period sets period on the request type.

func (APICreateHeartbeatTestRequest) Tags added in v1.3.0

Tags sets tags on the request type.

type APICreateMaintenanceWindowRequest

type APICreateMaintenanceWindowRequest struct {
	APIService MaintenanceWindowsAPI
	// contains filtered or unexported fields
}

APICreateMaintenanceWindowRequest represents a request type.

func (APICreateMaintenanceWindowRequest) End

End sets endAt on the request type.

func (APICreateMaintenanceWindowRequest) Execute

Execute executes the request.

func (APICreateMaintenanceWindowRequest) Name

Name sets name on the request type.

func (APICreateMaintenanceWindowRequest) RepeatInterval

RepeatInterval sets repeatInterval on the request type.

func (APICreateMaintenanceWindowRequest) Start

Start sets startAt on the request type.

func (APICreateMaintenanceWindowRequest) Tags

Tags sets tags on the request type.

func (APICreateMaintenanceWindowRequest) Tests

Tests sets tests on the request type.

func (APICreateMaintenanceWindowRequest) Timezone

Timezone sets timezone on the request type.

type APICreatePagespeedTestRequest

type APICreatePagespeedTestRequest struct {
	APIService PagespeedAPI
	// contains filtered or unexported fields
}

APICreatePagespeedTestRequest represents a request type.

func (APICreatePagespeedTestRequest) AlertBigger

AlertBigger sets alertBigger on the request type.

func (APICreatePagespeedTestRequest) AlertSlower

AlertSlower sets alertSlower on the request type.

func (APICreatePagespeedTestRequest) AlertSmaller

AlertSmaller sets alertSmaller on the request type.

func (APICreatePagespeedTestRequest) CheckRate

CheckRate sets checkRate on the request type.

func (APICreatePagespeedTestRequest) ContactGroups

func (r APICreatePagespeedTestRequest) ContactGroups(contactGroups []string) APICreatePagespeedTestRequest

ContactGroups sets contactGroups on the request type.

func (APICreatePagespeedTestRequest) Execute

Execute executes the request.

func (APICreatePagespeedTestRequest) Name

Name sets name on the request type.

func (APICreatePagespeedTestRequest) Paused

Paused sets paused on the request type.

func (APICreatePagespeedTestRequest) Region

Region sets region on the request type.

func (APICreatePagespeedTestRequest) WebsiteURL

WebsiteURL sets websiteUrl on the request type.

type APICreateSslTestRequest

type APICreateSslTestRequest struct {
	APIService SslAPI
	// contains filtered or unexported fields
}

APICreateSslTestRequest represents a request type.

func (APICreateSslTestRequest) AlertAt

AlertAt sets alertAt on the request type.

func (APICreateSslTestRequest) AlertBroken

func (r APICreateSslTestRequest) AlertBroken(alertBroken bool) APICreateSslTestRequest

AlertBroken sets alertBroken on the request type.

func (APICreateSslTestRequest) AlertExpiry

func (r APICreateSslTestRequest) AlertExpiry(alertExpiry bool) APICreateSslTestRequest

AlertExpiry sets alertExpiry on the request type.

func (APICreateSslTestRequest) AlertMixed

func (r APICreateSslTestRequest) AlertMixed(alertMixed bool) APICreateSslTestRequest

AlertMixed sets alertMixed on the request type.

func (APICreateSslTestRequest) AlertReminder

func (r APICreateSslTestRequest) AlertReminder(alertReminder bool) APICreateSslTestRequest

AlertReminder sets alertReminder on the request type.

func (APICreateSslTestRequest) CheckRate

CheckRate sets checkRate on the request type.

func (APICreateSslTestRequest) ContactGroups

func (r APICreateSslTestRequest) ContactGroups(contactGroups []string) APICreateSslTestRequest

ContactGroups sets contactGroups on the request type.

func (APICreateSslTestRequest) Execute

func (r APICreateSslTestRequest) Execute() (APIResponse, error)

Execute executes the request.

func (APICreateSslTestRequest) FollowRedirects

func (r APICreateSslTestRequest) FollowRedirects(followRedirects bool) APICreateSslTestRequest

FollowRedirects sets followRedirects on the request type.

func (APICreateSslTestRequest) Hostname

Hostname sets hostname on the request type.

func (APICreateSslTestRequest) Paused

Paused sets paused on the request type.

func (APICreateSslTestRequest) UserAgent

UserAgent sets userAgent on the request type.

func (APICreateSslTestRequest) WebsiteURL

func (r APICreateSslTestRequest) WebsiteURL(websiteUrl string) APICreateSslTestRequest

WebsiteURL sets websiteUrl on the request type.

type APICreateUptimeTestRequest

type APICreateUptimeTestRequest struct {
	APIService UptimeAPI
	// contains filtered or unexported fields
}

APICreateUptimeTestRequest represents a request type.

func (APICreateUptimeTestRequest) BasicPassword

func (r APICreateUptimeTestRequest) BasicPassword(basicPassword string) APICreateUptimeTestRequest

BasicPassword sets basicPassword on the request type.

func (APICreateUptimeTestRequest) BasicUsername

func (r APICreateUptimeTestRequest) BasicUsername(basicUsername string) APICreateUptimeTestRequest

BasicUsername sets basicUsername on the request type.

func (APICreateUptimeTestRequest) CheckRate

CheckRate sets checkRate on the request type.

func (APICreateUptimeTestRequest) Confirmation

func (r APICreateUptimeTestRequest) Confirmation(confirmation int32) APICreateUptimeTestRequest

Confirmation sets confirmation on the request type.

func (APICreateUptimeTestRequest) ContactGroups

func (r APICreateUptimeTestRequest) ContactGroups(contactGroups []string) APICreateUptimeTestRequest

ContactGroups sets contactGroups on the request type.

func (APICreateUptimeTestRequest) CustomHeader

func (r APICreateUptimeTestRequest) CustomHeader(customHeader string) APICreateUptimeTestRequest

CustomHeader sets customHeader on the request type.

func (APICreateUptimeTestRequest) DNSIPs

DNSIPs sets dnsIps on the request type.

func (APICreateUptimeTestRequest) DNSServer

DNSServer sets dnsServer on the request type.

func (APICreateUptimeTestRequest) DoNotFind

DoNotFind sets doNotFind on the request type.

func (APICreateUptimeTestRequest) EnableSSLAlert

func (r APICreateUptimeTestRequest) EnableSSLAlert(enableSslAlert bool) APICreateUptimeTestRequest

EnableSSLAlert sets enableSslAlert on the request type.

func (APICreateUptimeTestRequest) Execute

Execute executes the request.

func (APICreateUptimeTestRequest) FinalEndpoint

func (r APICreateUptimeTestRequest) FinalEndpoint(finalEndpoint string) APICreateUptimeTestRequest

FinalEndpoint sets finalEndpoint on the request type.

func (APICreateUptimeTestRequest) FindString

FindString sets findString on the request type.

func (APICreateUptimeTestRequest) FollowRedirects

func (r APICreateUptimeTestRequest) FollowRedirects(followRedirects bool) APICreateUptimeTestRequest

FollowRedirects sets followRedirects on the request type.

func (APICreateUptimeTestRequest) Host

Host sets host on the request type.

func (APICreateUptimeTestRequest) IncludeHeader

func (r APICreateUptimeTestRequest) IncludeHeader(includeHeader bool) APICreateUptimeTestRequest

IncludeHeader sets includeHeader on the request type.

func (APICreateUptimeTestRequest) Name

Name sets name on the request type.

func (APICreateUptimeTestRequest) Paused

Paused sets paused on the request type.

func (APICreateUptimeTestRequest) Port

Port sets port on the request type.

func (APICreateUptimeTestRequest) PostBody

PostBody sets postBody on the request type.

func (APICreateUptimeTestRequest) PostRaw

PostRaw sets postRaw on the request type.

func (APICreateUptimeTestRequest) Regions

Regions sets regions on the request type.

func (APICreateUptimeTestRequest) StatusCodes

func (r APICreateUptimeTestRequest) StatusCodes(statusCodesCsv []string) APICreateUptimeTestRequest

StatusCodes sets statusCodesCsv on the request type.

func (APICreateUptimeTestRequest) Tags

Tags sets tags on the request type.

func (APICreateUptimeTestRequest) TestType

TestType sets testType on the request type.

func (APICreateUptimeTestRequest) Timeout

Timeout sets timeout on the request type.

func (APICreateUptimeTestRequest) TriggerRate

func (r APICreateUptimeTestRequest) TriggerRate(triggerRate int32) APICreateUptimeTestRequest

TriggerRate sets triggerRate on the request type.

func (APICreateUptimeTestRequest) UseJAR

UseJAR sets useJar on the request type.

func (APICreateUptimeTestRequest) UserAgent

UserAgent sets userAgent on the request type.

func (APICreateUptimeTestRequest) WebsiteURL

WebsiteURL sets websiteUrl on the request type.

type APIDeleteContactGroupRequest

type APIDeleteContactGroupRequest struct {
	APIService ContactGroupsAPI
	// contains filtered or unexported fields
}

APIDeleteContactGroupRequest represents a request type.

func (APIDeleteContactGroupRequest) Execute

func (r APIDeleteContactGroupRequest) Execute() error

Execute executes the request.

type APIDeleteHeartbeatTestRequest added in v1.3.0

type APIDeleteHeartbeatTestRequest struct {
	APIService HeartbeatAPI
	// contains filtered or unexported fields
}

APIDeleteHeartbeatTestRequest represents a request type.

func (APIDeleteHeartbeatTestRequest) Execute added in v1.3.0

Execute executes the request.

type APIDeleteMaintenanceWindowRequest

type APIDeleteMaintenanceWindowRequest struct {
	APIService MaintenanceWindowsAPI
	// contains filtered or unexported fields
}

APIDeleteMaintenanceWindowRequest represents a request type.

func (APIDeleteMaintenanceWindowRequest) Execute

Execute executes the request.

type APIDeletePagespeedTestRequest

type APIDeletePagespeedTestRequest struct {
	APIService PagespeedAPI
	// contains filtered or unexported fields
}

APIDeletePagespeedTestRequest represents a request type.

func (APIDeletePagespeedTestRequest) Execute

Execute executes the request.

type APIDeleteSslTestRequest

type APIDeleteSslTestRequest struct {
	APIService SslAPI
	// contains filtered or unexported fields
}

APIDeleteSslTestRequest represents a request type.

func (APIDeleteSslTestRequest) Execute

func (r APIDeleteSslTestRequest) Execute() error

Execute executes the request.

type APIDeleteUptimeTestRequest

type APIDeleteUptimeTestRequest struct {
	APIService UptimeAPI
	// contains filtered or unexported fields
}

APIDeleteUptimeTestRequest represents a request type.

func (APIDeleteUptimeTestRequest) Execute

func (r APIDeleteUptimeTestRequest) Execute() error

Execute executes the request.

type APIError

type APIError struct {
	Status  int
	Message string              `json:"message,omitempty"`
	Errors  map[string][]string `json:"errors,omitempty"`
	// contains filtered or unexported fields
}

APIError represents an error returned from the API. This type abstracts the different payloads that can be returned from the API in response to an error which would otherwise add unnecessary compexity to the interface of this package.

func NewAPIError

func NewAPIError(message string, parent error) APIError

NewAPIError returns a structured error type from an API response.

func (APIError) Error

func (e APIError) Error() string

func (APIError) Unwrap

func (e APIError) Unwrap() error

type APIGetContactGroupRequest

type APIGetContactGroupRequest struct {
	APIService ContactGroupsAPI
	// contains filtered or unexported fields
}

APIGetContactGroupRequest represents a request type.

func (APIGetContactGroupRequest) Execute

Execute executes the request.

type APIGetHeartbeatTestRequest added in v1.3.0

type APIGetHeartbeatTestRequest struct {
	APIService HeartbeatAPI
	// contains filtered or unexported fields
}

APIGetHeartbeatTestRequest represents a request type.

func (APIGetHeartbeatTestRequest) Execute added in v1.3.0

Execute executes the request.

type APIGetMaintenanceWindowRequest

type APIGetMaintenanceWindowRequest struct {
	APIService MaintenanceWindowsAPI
	// contains filtered or unexported fields
}

APIGetMaintenanceWindowRequest represents a request type.

func (APIGetMaintenanceWindowRequest) Execute

Execute executes the request.

type APIGetPagespeedTestRequest

type APIGetPagespeedTestRequest struct {
	APIService PagespeedAPI
	// contains filtered or unexported fields
}

APIGetPagespeedTestRequest represents a request type.

func (APIGetPagespeedTestRequest) Execute

Execute executes the request.

type APIGetSslTestRequest

type APIGetSslTestRequest struct {
	APIService SslAPI
	// contains filtered or unexported fields
}

APIGetSslTestRequest represents a request type.

func (APIGetSslTestRequest) Execute

Execute executes the request.

type APIGetUptimeTestRequest

type APIGetUptimeTestRequest struct {
	APIService UptimeAPI
	// contains filtered or unexported fields
}

APIGetUptimeTestRequest represents a request type.

func (APIGetUptimeTestRequest) Execute

Execute executes the request.

type APIListContactGroupsRequest

type APIListContactGroupsRequest struct {
	APIService ContactGroupsAPI
	// contains filtered or unexported fields
}

APIListContactGroupsRequest represents a request type.

func (APIListContactGroupsRequest) Execute

Execute executes the request.

func (APIListContactGroupsRequest) Limit

Limit sets limit on the request type.

func (APIListContactGroupsRequest) Page

Page sets page on the request type.

type APIListHeartbeatTestsRequest added in v1.3.0

type APIListHeartbeatTestsRequest struct {
	APIService HeartbeatAPI
	// contains filtered or unexported fields
}

APIListHeartbeatTestsRequest represents a request type.

func (APIListHeartbeatTestsRequest) Execute added in v1.3.0

Execute executes the request.

func (APIListHeartbeatTestsRequest) Limit added in v1.3.0

Limit sets limit on the request type.

func (APIListHeartbeatTestsRequest) Matchany added in v1.3.0

Matchany sets matchany on the request type.

func (APIListHeartbeatTestsRequest) Nouptime added in v1.3.0

Nouptime sets nouptime on the request type.

func (APIListHeartbeatTestsRequest) Page added in v1.3.0

Page sets page on the request type.

func (APIListHeartbeatTestsRequest) Status added in v1.3.0

Status sets status on the request type.

func (APIListHeartbeatTestsRequest) Tags added in v1.3.0

Tags sets tags on the request type.

type APIListMaintenanceWindowsRequest

type APIListMaintenanceWindowsRequest struct {
	APIService MaintenanceWindowsAPI
	// contains filtered or unexported fields
}

APIListMaintenanceWindowsRequest represents a request type.

func (APIListMaintenanceWindowsRequest) Execute

Execute executes the request.

func (APIListMaintenanceWindowsRequest) Limit

Limit sets limit on the request type.

func (APIListMaintenanceWindowsRequest) Page

Page sets page on the request type.

func (APIListMaintenanceWindowsRequest) State

State sets state on the request type.

type APIListPagespeedMonitoringLocationsRequest

type APIListPagespeedMonitoringLocationsRequest struct {
	APIService LocationsAPI
	// contains filtered or unexported fields
}

APIListPagespeedMonitoringLocationsRequest represents a request type.

func (APIListPagespeedMonitoringLocationsRequest) Execute

Execute executes the request.

func (APIListPagespeedMonitoringLocationsRequest) Location

Location sets location on the request type.

type APIListPagespeedTestHistoryRequest

type APIListPagespeedTestHistoryRequest struct {
	APIService PagespeedAPI
	// contains filtered or unexported fields
}

APIListPagespeedTestHistoryRequest represents a request type.

func (APIListPagespeedTestHistoryRequest) After added in v1.1.1

After sets after on the request type.

func (APIListPagespeedTestHistoryRequest) Before

Before sets before on the request type.

func (APIListPagespeedTestHistoryRequest) Execute

Execute executes the request.

func (APIListPagespeedTestHistoryRequest) Limit

Limit sets limit on the request type.

type APIListPagespeedTestsRequest

type APIListPagespeedTestsRequest struct {
	APIService PagespeedAPI
	// contains filtered or unexported fields
}

APIListPagespeedTestsRequest represents a request type.

func (APIListPagespeedTestsRequest) Execute

Execute executes the request.

func (APIListPagespeedTestsRequest) Limit

Limit sets limit on the request type.

func (APIListPagespeedTestsRequest) Page

Page sets page on the request type.

type APIListSslTestsRequest

type APIListSslTestsRequest struct {
	APIService SslAPI
	// contains filtered or unexported fields
}

APIListSslTestsRequest represents a request type.

func (APIListSslTestsRequest) Execute

func (r APIListSslTestsRequest) Execute() (SSLTests, error)

Execute executes the request.

func (APIListSslTestsRequest) Limit

Limit sets limit on the request type.

func (APIListSslTestsRequest) Page

Page sets page on the request type.

type APIListUptimeMonitoringLocationsRequest

type APIListUptimeMonitoringLocationsRequest struct {
	APIService LocationsAPI
	// contains filtered or unexported fields
}

APIListUptimeMonitoringLocationsRequest represents a request type.

func (APIListUptimeMonitoringLocationsRequest) Execute

Execute executes the request.

func (APIListUptimeMonitoringLocationsRequest) RegionCode

RegionCode sets regionCode on the request type.

type APIListUptimeTestAlertsRequest

type APIListUptimeTestAlertsRequest struct {
	APIService UptimeAPI
	// contains filtered or unexported fields
}

APIListUptimeTestAlertsRequest represents a request type.

func (APIListUptimeTestAlertsRequest) After added in v1.1.1

After sets after on the request type.

func (APIListUptimeTestAlertsRequest) Before

Before sets before on the request type.

func (APIListUptimeTestAlertsRequest) Execute

Execute executes the request.

func (APIListUptimeTestAlertsRequest) Limit

Limit sets limit on the request type.

type APIListUptimeTestHistoryRequest

type APIListUptimeTestHistoryRequest struct {
	APIService UptimeAPI
	// contains filtered or unexported fields
}

APIListUptimeTestHistoryRequest represents a request type.

func (APIListUptimeTestHistoryRequest) After added in v1.1.1

After sets after on the request type.

func (APIListUptimeTestHistoryRequest) Before

Before sets before on the request type.

func (APIListUptimeTestHistoryRequest) Execute

Execute executes the request.

func (APIListUptimeTestHistoryRequest) Limit

Limit sets limit on the request type.

type APIListUptimeTestPeriodsRequest

type APIListUptimeTestPeriodsRequest struct {
	APIService UptimeAPI
	// contains filtered or unexported fields
}

APIListUptimeTestPeriodsRequest represents a request type.

func (APIListUptimeTestPeriodsRequest) After added in v1.1.1

After sets after on the request type.

func (APIListUptimeTestPeriodsRequest) Before

Before sets before on the request type.

func (APIListUptimeTestPeriodsRequest) Execute

Execute executes the request.

func (APIListUptimeTestPeriodsRequest) Limit

Limit sets limit on the request type.

type APIListUptimeTestsRequest

type APIListUptimeTestsRequest struct {
	APIService UptimeAPI
	// contains filtered or unexported fields
}

APIListUptimeTestsRequest represents a request type.

func (APIListUptimeTestsRequest) Execute

Execute executes the request.

func (APIListUptimeTestsRequest) Limit

Limit sets limit on the request type.

func (APIListUptimeTestsRequest) Matchany

Matchany sets matchany on the request type.

func (APIListUptimeTestsRequest) Nouptime

Nouptime sets nouptime on the request type.

func (APIListUptimeTestsRequest) Page

Page sets page on the request type.

func (APIListUptimeTestsRequest) Status

Status sets status on the request type.

func (APIListUptimeTestsRequest) Tags

Tags sets tags on the request type.

type APIResponse

type APIResponse struct {
	Data APIResponseData `json:"data"`
}

APIResponse struct for APIResponse

func NewAPIResponse

func NewAPIResponse(data APIResponseData) *APIResponse

NewAPIResponse instantiates a new APIResponse object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (APIResponse) MarshalJSON

func (o APIResponse) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type APIResponseData

type APIResponseData struct {
	// ID of newly created resource.
	NewID string `json:"new_id"`
}

APIResponseData Response body

func NewAPIResponseData

func NewAPIResponseData(newId string) *APIResponseData

NewAPIResponseData instantiates a new APIResponseData object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (APIResponseData) MarshalJSON

func (o APIResponseData) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type APIUpdateContactGroupRequest

type APIUpdateContactGroupRequest struct {
	APIService ContactGroupsAPI
	// contains filtered or unexported fields
}

APIUpdateContactGroupRequest represents a request type.

func (APIUpdateContactGroupRequest) EmailAddresses

func (r APIUpdateContactGroupRequest) EmailAddresses(emailAddresses []string) APIUpdateContactGroupRequest

EmailAddresses sets emailAddresses on the request type.

func (APIUpdateContactGroupRequest) Execute

func (r APIUpdateContactGroupRequest) Execute() error

Execute executes the request.

func (APIUpdateContactGroupRequest) Integrations

func (r APIUpdateContactGroupRequest) Integrations(integrations []string) APIUpdateContactGroupRequest

Integrations sets integrations on the request type.

func (APIUpdateContactGroupRequest) MobileNumbers

func (r APIUpdateContactGroupRequest) MobileNumbers(mobileNumbers []string) APIUpdateContactGroupRequest

MobileNumbers sets mobileNumbers on the request type.

func (APIUpdateContactGroupRequest) Name

Name sets name on the request type.

func (APIUpdateContactGroupRequest) PingURL

PingURL sets pingUrl on the request type.

type APIUpdateHeartbeatTestRequest added in v1.3.0

type APIUpdateHeartbeatTestRequest struct {
	APIService HeartbeatAPI
	// contains filtered or unexported fields
}

APIUpdateHeartbeatTestRequest represents a request type.

func (APIUpdateHeartbeatTestRequest) ContactGroups added in v1.3.0

func (r APIUpdateHeartbeatTestRequest) ContactGroups(contactGroups []string) APIUpdateHeartbeatTestRequest

ContactGroups sets contactGroups on the request type.

func (APIUpdateHeartbeatTestRequest) Execute added in v1.3.0

Execute executes the request.

func (APIUpdateHeartbeatTestRequest) Host added in v1.3.0

Host sets host on the request type.

func (APIUpdateHeartbeatTestRequest) Name added in v1.3.0

Name sets name on the request type.

func (APIUpdateHeartbeatTestRequest) Paused added in v1.3.0

Paused sets paused on the request type.

func (APIUpdateHeartbeatTestRequest) Period added in v1.3.0

Period sets period on the request type.

func (APIUpdateHeartbeatTestRequest) Tags added in v1.3.0

Tags sets tags on the request type.

type APIUpdateMaintenanceWindowRequest

type APIUpdateMaintenanceWindowRequest struct {
	APIService MaintenanceWindowsAPI
	// contains filtered or unexported fields
}

APIUpdateMaintenanceWindowRequest represents a request type.

func (APIUpdateMaintenanceWindowRequest) End

End sets endAt on the request type.

func (APIUpdateMaintenanceWindowRequest) Execute

Execute executes the request.

func (APIUpdateMaintenanceWindowRequest) Name

Name sets name on the request type.

func (APIUpdateMaintenanceWindowRequest) RepeatInterval

RepeatInterval sets repeatInterval on the request type.

func (APIUpdateMaintenanceWindowRequest) Start

Start sets startAt on the request type.

func (APIUpdateMaintenanceWindowRequest) Tags

Tags sets tags on the request type.

func (APIUpdateMaintenanceWindowRequest) Tests

Tests sets tests on the request type.

func (APIUpdateMaintenanceWindowRequest) Timezone

Timezone sets timezone on the request type.

type APIUpdatePagespeedTestRequest

type APIUpdatePagespeedTestRequest struct {
	APIService PagespeedAPI
	// contains filtered or unexported fields
}

APIUpdatePagespeedTestRequest represents a request type.

func (APIUpdatePagespeedTestRequest) AlertBigger

AlertBigger sets alertBigger on the request type.

func (APIUpdatePagespeedTestRequest) AlertSlower

AlertSlower sets alertSlower on the request type.

func (APIUpdatePagespeedTestRequest) AlertSmaller

AlertSmaller sets alertSmaller on the request type.

func (APIUpdatePagespeedTestRequest) CheckRate

CheckRate sets checkRate on the request type.

func (APIUpdatePagespeedTestRequest) ContactGroups

func (r APIUpdatePagespeedTestRequest) ContactGroups(contactGroups []string) APIUpdatePagespeedTestRequest

ContactGroups sets contactGroups on the request type.

func (APIUpdatePagespeedTestRequest) Execute

Execute executes the request.

func (APIUpdatePagespeedTestRequest) Name

Name sets name on the request type.

func (APIUpdatePagespeedTestRequest) Paused

Paused sets paused on the request type.

func (APIUpdatePagespeedTestRequest) Region

Region sets region on the request type.

func (APIUpdatePagespeedTestRequest) WebsiteURL added in v1.2.0

WebsiteURL sets websiteUrl on the request type.

type APIUpdateSslTestRequest

type APIUpdateSslTestRequest struct {
	APIService SslAPI
	// contains filtered or unexported fields
}

APIUpdateSslTestRequest represents a request type.

func (APIUpdateSslTestRequest) AlertAt

AlertAt sets alertAt on the request type.

func (APIUpdateSslTestRequest) AlertBroken

func (r APIUpdateSslTestRequest) AlertBroken(alertBroken bool) APIUpdateSslTestRequest

AlertBroken sets alertBroken on the request type.

func (APIUpdateSslTestRequest) AlertExpiry

func (r APIUpdateSslTestRequest) AlertExpiry(alertExpiry bool) APIUpdateSslTestRequest

AlertExpiry sets alertExpiry on the request type.

func (APIUpdateSslTestRequest) AlertMixed

func (r APIUpdateSslTestRequest) AlertMixed(alertMixed bool) APIUpdateSslTestRequest

AlertMixed sets alertMixed on the request type.

func (APIUpdateSslTestRequest) AlertReminder

func (r APIUpdateSslTestRequest) AlertReminder(alertReminder bool) APIUpdateSslTestRequest

AlertReminder sets alertReminder on the request type.

func (APIUpdateSslTestRequest) CheckRate

CheckRate sets checkRate on the request type.

func (APIUpdateSslTestRequest) ContactGroups

func (r APIUpdateSslTestRequest) ContactGroups(contactGroups []string) APIUpdateSslTestRequest

ContactGroups sets contactGroups on the request type.

func (APIUpdateSslTestRequest) Execute

func (r APIUpdateSslTestRequest) Execute() error

Execute executes the request.

func (APIUpdateSslTestRequest) FollowRedirects

func (r APIUpdateSslTestRequest) FollowRedirects(followRedirects bool) APIUpdateSslTestRequest

FollowRedirects sets followRedirects on the request type.

func (APIUpdateSslTestRequest) Hostname

Hostname sets hostname on the request type.

func (APIUpdateSslTestRequest) Paused

Paused sets paused on the request type.

func (APIUpdateSslTestRequest) UserAgent

UserAgent sets userAgent on the request type.

func (APIUpdateSslTestRequest) WebsiteURL added in v1.2.0

func (r APIUpdateSslTestRequest) WebsiteURL(websiteUrl string) APIUpdateSslTestRequest

WebsiteURL sets websiteUrl on the request type.

type APIUpdateUptimeTestRequest

type APIUpdateUptimeTestRequest struct {
	APIService UptimeAPI
	// contains filtered or unexported fields
}

APIUpdateUptimeTestRequest represents a request type.

func (APIUpdateUptimeTestRequest) BasicPassword

func (r APIUpdateUptimeTestRequest) BasicPassword(basicPassword string) APIUpdateUptimeTestRequest

BasicPassword sets basicPassword on the request type.

func (APIUpdateUptimeTestRequest) BasicUsername

func (r APIUpdateUptimeTestRequest) BasicUsername(basicUsername string) APIUpdateUptimeTestRequest

BasicUsername sets basicUsername on the request type.

func (APIUpdateUptimeTestRequest) CheckRate

CheckRate sets checkRate on the request type.

func (APIUpdateUptimeTestRequest) Confirmation

func (r APIUpdateUptimeTestRequest) Confirmation(confirmation int32) APIUpdateUptimeTestRequest

Confirmation sets confirmation on the request type.

func (APIUpdateUptimeTestRequest) ContactGroups

func (r APIUpdateUptimeTestRequest) ContactGroups(contactGroups []string) APIUpdateUptimeTestRequest

ContactGroups sets contactGroups on the request type.

func (APIUpdateUptimeTestRequest) CustomHeader

func (r APIUpdateUptimeTestRequest) CustomHeader(customHeader string) APIUpdateUptimeTestRequest

CustomHeader sets customHeader on the request type.

func (APIUpdateUptimeTestRequest) DNSIPs

DNSIPs sets dnsIps on the request type.

func (APIUpdateUptimeTestRequest) DNSServer

DNSServer sets dnsServer on the request type.

func (APIUpdateUptimeTestRequest) DoNotFind

DoNotFind sets doNotFind on the request type.

func (APIUpdateUptimeTestRequest) EnableSSLAlert

func (r APIUpdateUptimeTestRequest) EnableSSLAlert(enableSslAlert bool) APIUpdateUptimeTestRequest

EnableSSLAlert sets enableSslAlert on the request type.

func (APIUpdateUptimeTestRequest) Execute

func (r APIUpdateUptimeTestRequest) Execute() error

Execute executes the request.

func (APIUpdateUptimeTestRequest) FinalEndpoint

func (r APIUpdateUptimeTestRequest) FinalEndpoint(finalEndpoint string) APIUpdateUptimeTestRequest

FinalEndpoint sets finalEndpoint on the request type.

func (APIUpdateUptimeTestRequest) FindString

FindString sets findString on the request type.

func (APIUpdateUptimeTestRequest) FollowRedirects

func (r APIUpdateUptimeTestRequest) FollowRedirects(followRedirects bool) APIUpdateUptimeTestRequest

FollowRedirects sets followRedirects on the request type.

func (APIUpdateUptimeTestRequest) Host

Host sets host on the request type.

func (APIUpdateUptimeTestRequest) IncludeHeader

func (r APIUpdateUptimeTestRequest) IncludeHeader(includeHeader bool) APIUpdateUptimeTestRequest

IncludeHeader sets includeHeader on the request type.

func (APIUpdateUptimeTestRequest) Name

Name sets name on the request type.

func (APIUpdateUptimeTestRequest) Paused

Paused sets paused on the request type.

func (APIUpdateUptimeTestRequest) Port

Port sets port on the request type.

func (APIUpdateUptimeTestRequest) PostBody

PostBody sets postBody on the request type.

func (APIUpdateUptimeTestRequest) PostRaw

PostRaw sets postRaw on the request type.

func (APIUpdateUptimeTestRequest) Regions

Regions sets regions on the request type.

func (APIUpdateUptimeTestRequest) StatusCodes

func (r APIUpdateUptimeTestRequest) StatusCodes(statusCodesCsv []string) APIUpdateUptimeTestRequest

StatusCodes sets statusCodesCsv on the request type.

func (APIUpdateUptimeTestRequest) Tags

Tags sets tags on the request type.

func (APIUpdateUptimeTestRequest) Timeout

Timeout sets timeout on the request type.

func (APIUpdateUptimeTestRequest) TriggerRate

func (r APIUpdateUptimeTestRequest) TriggerRate(triggerRate int32) APIUpdateUptimeTestRequest

TriggerRate sets triggerRate on the request type.

func (APIUpdateUptimeTestRequest) UseJAR

UseJAR sets useJar on the request type.

func (APIUpdateUptimeTestRequest) UserAgent

UserAgent sets userAgent on the request type.

func (APIUpdateUptimeTestRequest) WebsiteURL added in v1.2.0

WebsiteURL sets websiteUrl on the request type.

type Client

type Client struct {

	// API Services
	// These are embedded so that from a user perspective they do not appear as
	// separate APIs. Since the operation IDs need to be unique within a
	// specification this will not cause function conflicts.
	ContactGroupsAPI
	HeartbeatAPI
	LocationsAPI
	MaintenanceWindowsAPI
	PagespeedAPI
	SslAPI
	UptimeAPI
	// contains filtered or unexported fields
}

Client manages communication with the StatusCake API API v1.2.0 In most cases there should be only one, shared, Client.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new API client. Additional options may be given to override default configuration values.

func (*Client) ServerURL

func (c *Client) ServerURL(index int, variables map[string]string) (string, error)

ServerURL returns URL based on server settings.

func (*Client) ServerURLWithContext

func (c *Client) ServerURLWithContext(ctx context.Context, endpoint string) (string, error)

ServerURLWithContext returns a new server URL given an endpoint.

type ContactGroup

type ContactGroup struct {
	// Contact group ID
	ID string `json:"id"`
	// Name of the contact group
	Name string `json:"name"`
	// List of email addresses
	EmailAddresses []string `json:"email_addresses"`
	// List of configured integration IDs
	Integrations []string `json:"integrations"`
	// List of international format mobile phone numbers
	MobileNumbers []string `json:"mobile_numbers"`
	// URL or IP address of an endpoint to push uptime events. Currently this only supports HTTP GET endpoints
	PingURL *string `json:"ping_url,omitempty"`
}

ContactGroup struct for ContactGroup

func NewContactGroup

func NewContactGroup(id string, name string, emailAddresses []string, integrations []string, mobileNumbers []string) *ContactGroup

NewContactGroup instantiates a new ContactGroup object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (ContactGroup) MarshalJSON

func (o ContactGroup) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type ContactGroupResponse

type ContactGroupResponse struct {
	Data ContactGroup `json:"data"`
}

ContactGroupResponse struct for ContactGroupResponse

func NewContactGroupResponse

func NewContactGroupResponse(data ContactGroup) *ContactGroupResponse

NewContactGroupResponse instantiates a new ContactGroupResponse object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (ContactGroupResponse) MarshalJSON

func (o ContactGroupResponse) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type ContactGroups

type ContactGroups struct {
	// List of contact groups
	Data     []ContactGroup `json:"data"`
	Metadata Pagination     `json:"metadata"`
}

ContactGroups struct for ContactGroups

func NewContactGroups

func NewContactGroups(data []ContactGroup, metadata Pagination) *ContactGroups

NewContactGroups instantiates a new ContactGroups object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (ContactGroups) MarshalJSON

func (o ContactGroups) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type ContactGroupsAPI

type ContactGroupsAPI interface {
	CreateContactGroup(ctx context.Context) APICreateContactGroupRequest
	CreateContactGroupWithData(ctx context.Context, m map[string]interface{}) APICreateContactGroupRequest
	CreateContactGroupExecute(r APICreateContactGroupRequest) (APIResponse, error)
	DeleteContactGroup(ctx context.Context, groupId string) APIDeleteContactGroupRequest
	DeleteContactGroupExecute(r APIDeleteContactGroupRequest) error
	GetContactGroup(ctx context.Context, groupId string) APIGetContactGroupRequest
	GetContactGroupExecute(r APIGetContactGroupRequest) (ContactGroupResponse, error)
	ListContactGroups(ctx context.Context) APIListContactGroupsRequest
	ListContactGroupsExecute(r APIListContactGroupsRequest) (ContactGroups, error)
	UpdateContactGroup(ctx context.Context, groupId string) APIUpdateContactGroupRequest
	UpdateContactGroupWithData(ctx context.Context, groupId string, m map[string]interface{}) APIUpdateContactGroupRequest
	UpdateContactGroupExecute(r APIUpdateContactGroupRequest) error
}

ContactGroupsAPI describes the necessary methods to adhere to this interface.

type ContactGroupsService

type ContactGroupsService service

ContactGroupsService ContactGroups service.

func (*ContactGroupsService) CreateContactGroup

CreateContactGroup Create a contact group.

func (*ContactGroupsService) CreateContactGroupExecute

func (a *ContactGroupsService) CreateContactGroupExecute(r APICreateContactGroupRequest) (APIResponse, error)

Execute executes the request.

func (*ContactGroupsService) CreateContactGroupWithData

func (a *ContactGroupsService) CreateContactGroupWithData(ctx context.Context, m map[string]interface{}) APICreateContactGroupRequest

CreateContactGroupWithData Create a contact group. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*ContactGroupsService) DeleteContactGroup

func (a *ContactGroupsService) DeleteContactGroup(ctx context.Context, groupId string) APIDeleteContactGroupRequest

DeleteContactGroup Delete a contact group.

func (*ContactGroupsService) DeleteContactGroupExecute

func (a *ContactGroupsService) DeleteContactGroupExecute(r APIDeleteContactGroupRequest) error

Execute executes the request.

func (*ContactGroupsService) DeleteContactGroupWithData

func (a *ContactGroupsService) DeleteContactGroupWithData(ctx context.Context, groupId string, m map[string]interface{}) APIDeleteContactGroupRequest

DeleteContactGroupWithData Delete a contact group. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*ContactGroupsService) GetContactGroup

func (a *ContactGroupsService) GetContactGroup(ctx context.Context, groupId string) APIGetContactGroupRequest

GetContactGroup Retrieve a contact group.

func (*ContactGroupsService) GetContactGroupExecute

Execute executes the request.

func (*ContactGroupsService) GetContactGroupWithData

func (a *ContactGroupsService) GetContactGroupWithData(ctx context.Context, groupId string, m map[string]interface{}) APIGetContactGroupRequest

GetContactGroupWithData Retrieve a contact group. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*ContactGroupsService) ListContactGroups

ListContactGroups Get all contact groups.

func (*ContactGroupsService) ListContactGroupsExecute

func (a *ContactGroupsService) ListContactGroupsExecute(r APIListContactGroupsRequest) (ContactGroups, error)

Execute executes the request.

func (*ContactGroupsService) ListContactGroupsWithData

func (a *ContactGroupsService) ListContactGroupsWithData(ctx context.Context, m map[string]interface{}) APIListContactGroupsRequest

ListContactGroupsWithData Get all contact groups. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*ContactGroupsService) UpdateContactGroup

func (a *ContactGroupsService) UpdateContactGroup(ctx context.Context, groupId string) APIUpdateContactGroupRequest

UpdateContactGroup Update a contact group.

func (*ContactGroupsService) UpdateContactGroupExecute

func (a *ContactGroupsService) UpdateContactGroupExecute(r APIUpdateContactGroupRequest) error

Execute executes the request.

func (*ContactGroupsService) UpdateContactGroupWithData

func (a *ContactGroupsService) UpdateContactGroupWithData(ctx context.Context, groupId string, m map[string]interface{}) APIUpdateContactGroupRequest

UpdateContactGroupWithData Update a contact group. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

type HeartbeatAPI added in v1.3.0

type HeartbeatAPI interface {
	CreateHeartbeatTest(ctx context.Context) APICreateHeartbeatTestRequest
	CreateHeartbeatTestWithData(ctx context.Context, m map[string]interface{}) APICreateHeartbeatTestRequest
	CreateHeartbeatTestExecute(r APICreateHeartbeatTestRequest) (APIResponse, error)
	DeleteHeartbeatTest(ctx context.Context, testId string) APIDeleteHeartbeatTestRequest
	DeleteHeartbeatTestExecute(r APIDeleteHeartbeatTestRequest) error
	GetHeartbeatTest(ctx context.Context, testId string) APIGetHeartbeatTestRequest
	GetHeartbeatTestExecute(r APIGetHeartbeatTestRequest) (HeartbeatTestResponse, error)
	ListHeartbeatTests(ctx context.Context) APIListHeartbeatTestsRequest
	ListHeartbeatTestsExecute(r APIListHeartbeatTestsRequest) (HeartbeatTests, error)
	UpdateHeartbeatTest(ctx context.Context, testId string) APIUpdateHeartbeatTestRequest
	UpdateHeartbeatTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIUpdateHeartbeatTestRequest
	UpdateHeartbeatTestExecute(r APIUpdateHeartbeatTestRequest) error
}

HeartbeatAPI describes the necessary methods to adhere to this interface.

type HeartbeatService added in v1.3.0

type HeartbeatService service

HeartbeatService Heartbeat service.

func (*HeartbeatService) CreateHeartbeatTest added in v1.3.0

func (a *HeartbeatService) CreateHeartbeatTest(ctx context.Context) APICreateHeartbeatTestRequest

CreateHeartbeatTest Create a heartbeat check.

func (*HeartbeatService) CreateHeartbeatTestExecute added in v1.3.0

func (a *HeartbeatService) CreateHeartbeatTestExecute(r APICreateHeartbeatTestRequest) (APIResponse, error)

Execute executes the request.

func (*HeartbeatService) CreateHeartbeatTestWithData added in v1.3.0

func (a *HeartbeatService) CreateHeartbeatTestWithData(ctx context.Context, m map[string]interface{}) APICreateHeartbeatTestRequest

CreateHeartbeatTestWithData Create a heartbeat check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*HeartbeatService) DeleteHeartbeatTest added in v1.3.0

func (a *HeartbeatService) DeleteHeartbeatTest(ctx context.Context, testId string) APIDeleteHeartbeatTestRequest

DeleteHeartbeatTest Delete a heartbeat check.

func (*HeartbeatService) DeleteHeartbeatTestExecute added in v1.3.0

func (a *HeartbeatService) DeleteHeartbeatTestExecute(r APIDeleteHeartbeatTestRequest) error

Execute executes the request.

func (*HeartbeatService) DeleteHeartbeatTestWithData added in v1.3.0

func (a *HeartbeatService) DeleteHeartbeatTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIDeleteHeartbeatTestRequest

DeleteHeartbeatTestWithData Delete a heartbeat check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*HeartbeatService) GetHeartbeatTest added in v1.3.0

func (a *HeartbeatService) GetHeartbeatTest(ctx context.Context, testId string) APIGetHeartbeatTestRequest

GetHeartbeatTest Retrieve a heartbeat check.

func (*HeartbeatService) GetHeartbeatTestExecute added in v1.3.0

Execute executes the request.

func (*HeartbeatService) GetHeartbeatTestWithData added in v1.3.0

func (a *HeartbeatService) GetHeartbeatTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIGetHeartbeatTestRequest

GetHeartbeatTestWithData Retrieve a heartbeat check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*HeartbeatService) ListHeartbeatTests added in v1.3.0

func (a *HeartbeatService) ListHeartbeatTests(ctx context.Context) APIListHeartbeatTestsRequest

ListHeartbeatTests Get all heartbeat checks.

func (*HeartbeatService) ListHeartbeatTestsExecute added in v1.3.0

func (a *HeartbeatService) ListHeartbeatTestsExecute(r APIListHeartbeatTestsRequest) (HeartbeatTests, error)

Execute executes the request.

func (*HeartbeatService) ListHeartbeatTestsWithData added in v1.3.0

func (a *HeartbeatService) ListHeartbeatTestsWithData(ctx context.Context, m map[string]interface{}) APIListHeartbeatTestsRequest

ListHeartbeatTestsWithData Get all heartbeat checks. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*HeartbeatService) UpdateHeartbeatTest added in v1.3.0

func (a *HeartbeatService) UpdateHeartbeatTest(ctx context.Context, testId string) APIUpdateHeartbeatTestRequest

UpdateHeartbeatTest Update a heartbeat check.

func (*HeartbeatService) UpdateHeartbeatTestExecute added in v1.3.0

func (a *HeartbeatService) UpdateHeartbeatTestExecute(r APIUpdateHeartbeatTestRequest) error

Execute executes the request.

func (*HeartbeatService) UpdateHeartbeatTestWithData added in v1.3.0

func (a *HeartbeatService) UpdateHeartbeatTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIUpdateHeartbeatTestRequest

UpdateHeartbeatTestWithData Update a heartbeat check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

type HeartbeatTest added in v1.3.0

type HeartbeatTest struct {
	// Heartbeat check ID
	ID string `json:"id"`
	// Name of the check
	Name string `json:"name"`
	// URL of the check
	WebsiteURL string `json:"url"`
	// Number of seconds since the last ping before the check is considered down
	Period int32 `json:"period"`
	// List of contact group IDs
	ContactGroups []string `json:"contact_groups"`
	// Name of the hosting provider
	Host *string `json:"host,omitempty"`
	// When the check was last run (RFC3339 format)
	LastTested *time.Time `json:"last_tested_at,omitempty"`
	// Whether the check should be run
	Paused bool                `json:"paused"`
	Status HeartbeatTestStatus `json:"status"`
	// List of tags
	Tags []string `json:"tags"`
	// Uptime percentage for a check
	Uptime float32 `json:"uptime"`
}

HeartbeatTest struct for HeartbeatTest

func NewHeartbeatTest added in v1.3.0

func NewHeartbeatTest(id string, name string, url string, period int32, contactGroups []string, paused bool, status HeartbeatTestStatus, tags []string, uptime float32) *HeartbeatTest

NewHeartbeatTest instantiates a new HeartbeatTest object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (HeartbeatTest) MarshalJSON added in v1.3.0

func (o HeartbeatTest) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type HeartbeatTestOverview added in v1.3.0

type HeartbeatTestOverview struct {
	// Heartbeat check ID
	ID string `json:"id"`
	// Name of the check
	Name string `json:"name"`
	// URL of the check
	WebsiteURL string `json:"url"`
	// Number of seconds since the last ping before the check is considered down
	Period int32 `json:"period"`
	// List of contact group IDs
	ContactGroups []string `json:"contact_groups"`
	// Whether the check should be run
	Paused bool                `json:"paused"`
	Status HeartbeatTestStatus `json:"status"`
	// List of tags
	Tags []string `json:"tags"`
	// Uptime percentage for a check
	Uptime *float32 `json:"uptime,omitempty"`
}

HeartbeatTestOverview struct for HeartbeatTestOverview

func NewHeartbeatTestOverview added in v1.3.0

func NewHeartbeatTestOverview(id string, name string, url string, period int32, contactGroups []string, paused bool, status HeartbeatTestStatus, tags []string) *HeartbeatTestOverview

NewHeartbeatTestOverview instantiates a new HeartbeatTestOverview object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (HeartbeatTestOverview) MarshalJSON added in v1.3.0

func (o HeartbeatTestOverview) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type HeartbeatTestResponse added in v1.3.0

type HeartbeatTestResponse struct {
	Data HeartbeatTest `json:"data"`
}

HeartbeatTestResponse struct for HeartbeatTestResponse

func NewHeartbeatTestResponse added in v1.3.0

func NewHeartbeatTestResponse(data HeartbeatTest) *HeartbeatTestResponse

NewHeartbeatTestResponse instantiates a new HeartbeatTestResponse object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (HeartbeatTestResponse) MarshalJSON added in v1.3.0

func (o HeartbeatTestResponse) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type HeartbeatTestStatus added in v1.3.0

type HeartbeatTestStatus string

HeartbeatTestStatus The returned status of a heartbeat check

const (
	// HeartbeatTestStatusDown a heartbeat check with a down status.
	HeartbeatTestStatusDown HeartbeatTestStatus = "down"
	// HeartbeatTestStatusUp a heartbeat check with an up status.
	HeartbeatTestStatusUp HeartbeatTestStatus = "up"
)

func (*HeartbeatTestStatus) UnmarshalJSON added in v1.3.0

func (v *HeartbeatTestStatus) UnmarshalJSON(src []byte) error

Unmarshal JSON data into any of the pointers in the type.

func (HeartbeatTestStatus) Valid added in v1.3.0

func (v HeartbeatTestStatus) Valid() bool

Valid determines if the value is valid.

type HeartbeatTests added in v1.3.0

type HeartbeatTests struct {
	// List of heartbeat checks
	Data     []HeartbeatTestOverview `json:"data"`
	Metadata Pagination              `json:"metadata"`
}

HeartbeatTests struct for HeartbeatTests

func NewHeartbeatTests added in v1.3.0

func NewHeartbeatTests(data []HeartbeatTestOverview, metadata Pagination) *HeartbeatTests

NewHeartbeatTests instantiates a new HeartbeatTests object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (HeartbeatTests) MarshalJSON added in v1.3.0

func (o HeartbeatTests) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type Links struct {
	// The URL that created the current response document
	Self string `json:"self"`
	// Additional links. The nature of these fields is described in the endpoint description
	AdditionalProperties map[string]interface{}
}

Links struct for Links

func NewLinks(self string) *Links

NewLinks instantiates a new Links object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (Links) MarshalJSON

func (o Links) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

func (*Links) UnmarshalJSON

func (o *Links) UnmarshalJSON(bytes []byte) error

UnmarshalJSON deserialises JSON into a struct.

type LocationsAPI

type LocationsAPI interface {
	ListPagespeedMonitoringLocations(ctx context.Context) APIListPagespeedMonitoringLocationsRequest
	ListPagespeedMonitoringLocationsExecute(r APIListPagespeedMonitoringLocationsRequest) (MonitoringLocations, error)
	ListUptimeMonitoringLocations(ctx context.Context) APIListUptimeMonitoringLocationsRequest
	ListUptimeMonitoringLocationsExecute(r APIListUptimeMonitoringLocationsRequest) (MonitoringLocations, error)
}

LocationsAPI describes the necessary methods to adhere to this interface.

type LocationsService

type LocationsService service

LocationsService Locations service.

func (*LocationsService) ListPagespeedMonitoringLocations

func (a *LocationsService) ListPagespeedMonitoringLocations(ctx context.Context) APIListPagespeedMonitoringLocationsRequest

ListPagespeedMonitoringLocations Get all pagespeed monitoring locations.

func (*LocationsService) ListPagespeedMonitoringLocationsExecute

func (a *LocationsService) ListPagespeedMonitoringLocationsExecute(r APIListPagespeedMonitoringLocationsRequest) (MonitoringLocations, error)

Execute executes the request.

func (*LocationsService) ListPagespeedMonitoringLocationsWithData

func (a *LocationsService) ListPagespeedMonitoringLocationsWithData(ctx context.Context, m map[string]interface{}) APIListPagespeedMonitoringLocationsRequest

ListPagespeedMonitoringLocationsWithData Get all pagespeed monitoring locations. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*LocationsService) ListUptimeMonitoringLocations

func (a *LocationsService) ListUptimeMonitoringLocations(ctx context.Context) APIListUptimeMonitoringLocationsRequest

ListUptimeMonitoringLocations Get all uptime monitoring locations.

func (*LocationsService) ListUptimeMonitoringLocationsExecute

func (a *LocationsService) ListUptimeMonitoringLocationsExecute(r APIListUptimeMonitoringLocationsRequest) (MonitoringLocations, error)

Execute executes the request.

func (*LocationsService) ListUptimeMonitoringLocationsWithData

func (a *LocationsService) ListUptimeMonitoringLocationsWithData(ctx context.Context, m map[string]interface{}) APIListUptimeMonitoringLocationsRequest

ListUptimeMonitoringLocationsWithData Get all uptime monitoring locations. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

type MaintenanceWindow

type MaintenanceWindow struct {
	// Maintenance window ID
	ID string `json:"id"`
	// Name of the maintenance window
	Name string `json:"name"`
	// End of the maintenance window (RFC3339 format)
	End            time.Time                       `json:"end_at"`
	RepeatInterval MaintenanceWindowRepeatInterval `json:"repeat_interval"`
	// Start of the maintenance window (RFC3339 format)
	Start time.Time              `json:"start_at"`
	State MaintenanceWindowState `json:"state"`
	// List of tags used to include matching uptime checks in this maintenance window
	Tags []string `json:"tags"`
	// List of uptime check IDs explicitly included in this maintenance window
	Tests []string `json:"tests"`
	// Standard [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) associated with this maintenance window
	Timezone string `json:"timezone"`
}

MaintenanceWindow struct for MaintenanceWindow

func NewMaintenanceWindow

func NewMaintenanceWindow(id string, name string, endAt time.Time, repeatInterval MaintenanceWindowRepeatInterval, startAt time.Time, state MaintenanceWindowState, tags []string, tests []string, timezone string) *MaintenanceWindow

NewMaintenanceWindow instantiates a new MaintenanceWindow object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (MaintenanceWindow) MarshalJSON

func (o MaintenanceWindow) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type MaintenanceWindowRepeatInterval

type MaintenanceWindowRepeatInterval string

MaintenanceWindowRepeatInterval How often the maintenance window should occur

const (
	// MaintenanceWindowRepeatIntervalNever a maintenance window that never reoccurs.
	MaintenanceWindowRepeatIntervalNever MaintenanceWindowRepeatInterval = "never"
	// MaintenanceWindowRepeatIntervalDaily a maintenance window occuring daily.
	MaintenanceWindowRepeatIntervalDaily MaintenanceWindowRepeatInterval = "1d"
	// MaintenanceWindowRepeatIntervalWeekly a maintenance window occuring weekly.
	MaintenanceWindowRepeatIntervalWeekly MaintenanceWindowRepeatInterval = "1w"
	// MaintenanceWindowRepeatIntervalBiweekly a maintenance window occuring biweekly.
	MaintenanceWindowRepeatIntervalBiweekly MaintenanceWindowRepeatInterval = "2w"
	// MaintenanceWindowRepeatIntervalMonthly a maintenance window occuring monthly.
	MaintenanceWindowRepeatIntervalMonthly MaintenanceWindowRepeatInterval = "1m"
)

func (*MaintenanceWindowRepeatInterval) UnmarshalJSON

func (v *MaintenanceWindowRepeatInterval) UnmarshalJSON(src []byte) error

Unmarshal JSON data into any of the pointers in the type.

func (MaintenanceWindowRepeatInterval) Valid

Valid determines if the value is valid.

type MaintenanceWindowResponse

type MaintenanceWindowResponse struct {
	Data MaintenanceWindow `json:"data"`
}

MaintenanceWindowResponse struct for MaintenanceWindowResponse

func NewMaintenanceWindowResponse

func NewMaintenanceWindowResponse(data MaintenanceWindow) *MaintenanceWindowResponse

NewMaintenanceWindowResponse instantiates a new MaintenanceWindowResponse object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (MaintenanceWindowResponse) MarshalJSON

func (o MaintenanceWindowResponse) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type MaintenanceWindowState

type MaintenanceWindowState string

MaintenanceWindowState Maintenance window state

const (
	// MaintenanceWindowStateActive a maintenance window in an active state.
	MaintenanceWindowStateActive MaintenanceWindowState = "active"
	// MaintenanceWindowStatePaused a maintenance window in a paused state.
	MaintenanceWindowStatePaused MaintenanceWindowState = "paused"
	// MaintenanceWindowStatePending a maintenance window in a pending state.
	MaintenanceWindowStatePending MaintenanceWindowState = "pending"
)

func (*MaintenanceWindowState) UnmarshalJSON

func (v *MaintenanceWindowState) UnmarshalJSON(src []byte) error

Unmarshal JSON data into any of the pointers in the type.

func (MaintenanceWindowState) Valid

func (v MaintenanceWindowState) Valid() bool

Valid determines if the value is valid.

type MaintenanceWindows

type MaintenanceWindows struct {
	// List of maintenance windows
	Data     []MaintenanceWindow `json:"data"`
	Metadata Pagination          `json:"metadata"`
}

MaintenanceWindows struct for MaintenanceWindows

func NewMaintenanceWindows

func NewMaintenanceWindows(data []MaintenanceWindow, metadata Pagination) *MaintenanceWindows

NewMaintenanceWindows instantiates a new MaintenanceWindows object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (MaintenanceWindows) MarshalJSON

func (o MaintenanceWindows) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type MaintenanceWindowsAPI

type MaintenanceWindowsAPI interface {
	CreateMaintenanceWindow(ctx context.Context) APICreateMaintenanceWindowRequest
	CreateMaintenanceWindowWithData(ctx context.Context, m map[string]interface{}) APICreateMaintenanceWindowRequest
	CreateMaintenanceWindowExecute(r APICreateMaintenanceWindowRequest) (APIResponse, error)
	DeleteMaintenanceWindow(ctx context.Context, windowId string) APIDeleteMaintenanceWindowRequest
	DeleteMaintenanceWindowExecute(r APIDeleteMaintenanceWindowRequest) error
	GetMaintenanceWindow(ctx context.Context, windowId string) APIGetMaintenanceWindowRequest
	GetMaintenanceWindowExecute(r APIGetMaintenanceWindowRequest) (MaintenanceWindowResponse, error)
	ListMaintenanceWindows(ctx context.Context) APIListMaintenanceWindowsRequest
	ListMaintenanceWindowsExecute(r APIListMaintenanceWindowsRequest) (MaintenanceWindows, error)
	UpdateMaintenanceWindow(ctx context.Context, windowId string) APIUpdateMaintenanceWindowRequest
	UpdateMaintenanceWindowWithData(ctx context.Context, windowId string, m map[string]interface{}) APIUpdateMaintenanceWindowRequest
	UpdateMaintenanceWindowExecute(r APIUpdateMaintenanceWindowRequest) error
}

MaintenanceWindowsAPI describes the necessary methods to adhere to this interface.

type MaintenanceWindowsService

type MaintenanceWindowsService service

MaintenanceWindowsService MaintenanceWindows service.

func (*MaintenanceWindowsService) CreateMaintenanceWindow

CreateMaintenanceWindow Create a maintenance window.

func (*MaintenanceWindowsService) CreateMaintenanceWindowExecute

func (a *MaintenanceWindowsService) CreateMaintenanceWindowExecute(r APICreateMaintenanceWindowRequest) (APIResponse, error)

Execute executes the request.

func (*MaintenanceWindowsService) CreateMaintenanceWindowWithData

func (a *MaintenanceWindowsService) CreateMaintenanceWindowWithData(ctx context.Context, m map[string]interface{}) APICreateMaintenanceWindowRequest

CreateMaintenanceWindowWithData Create a maintenance window. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*MaintenanceWindowsService) DeleteMaintenanceWindow

func (a *MaintenanceWindowsService) DeleteMaintenanceWindow(ctx context.Context, windowId string) APIDeleteMaintenanceWindowRequest

DeleteMaintenanceWindow Delete a maintenance window.

func (*MaintenanceWindowsService) DeleteMaintenanceWindowExecute

func (a *MaintenanceWindowsService) DeleteMaintenanceWindowExecute(r APIDeleteMaintenanceWindowRequest) error

Execute executes the request.

func (*MaintenanceWindowsService) DeleteMaintenanceWindowWithData

func (a *MaintenanceWindowsService) DeleteMaintenanceWindowWithData(ctx context.Context, windowId string, m map[string]interface{}) APIDeleteMaintenanceWindowRequest

DeleteMaintenanceWindowWithData Delete a maintenance window. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*MaintenanceWindowsService) GetMaintenanceWindow

func (a *MaintenanceWindowsService) GetMaintenanceWindow(ctx context.Context, windowId string) APIGetMaintenanceWindowRequest

GetMaintenanceWindow Retrieve a maintenance window.

func (*MaintenanceWindowsService) GetMaintenanceWindowExecute

Execute executes the request.

func (*MaintenanceWindowsService) GetMaintenanceWindowWithData

func (a *MaintenanceWindowsService) GetMaintenanceWindowWithData(ctx context.Context, windowId string, m map[string]interface{}) APIGetMaintenanceWindowRequest

GetMaintenanceWindowWithData Retrieve a maintenance window. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*MaintenanceWindowsService) ListMaintenanceWindows

ListMaintenanceWindows Get all maintenance windows.

func (*MaintenanceWindowsService) ListMaintenanceWindowsExecute

Execute executes the request.

func (*MaintenanceWindowsService) ListMaintenanceWindowsWithData

func (a *MaintenanceWindowsService) ListMaintenanceWindowsWithData(ctx context.Context, m map[string]interface{}) APIListMaintenanceWindowsRequest

ListMaintenanceWindowsWithData Get all maintenance windows. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*MaintenanceWindowsService) UpdateMaintenanceWindow

func (a *MaintenanceWindowsService) UpdateMaintenanceWindow(ctx context.Context, windowId string) APIUpdateMaintenanceWindowRequest

UpdateMaintenanceWindow Update a maintenance window.

func (*MaintenanceWindowsService) UpdateMaintenanceWindowExecute

func (a *MaintenanceWindowsService) UpdateMaintenanceWindowExecute(r APIUpdateMaintenanceWindowRequest) error

Execute executes the request.

func (*MaintenanceWindowsService) UpdateMaintenanceWindowWithData

func (a *MaintenanceWindowsService) UpdateMaintenanceWindowWithData(ctx context.Context, windowId string, m map[string]interface{}) APIUpdateMaintenanceWindowRequest

UpdateMaintenanceWindowWithData Update a maintenance window. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

type MonitoringLocation

type MonitoringLocation struct {
	// Server description
	Description string `json:"description"`
	// Server IPv4 address
	IPv4 *string `json:"ipv4,omitempty"`
	// Server IPv6 address
	IPv6 *string `json:"ipv6,omitempty"`
	// Server region
	Region string `json:"region"`
	// Server region code
	RegionCode string                   `json:"region_code"`
	Status     MonitoringLocationStatus `json:"status"`
}

MonitoringLocation struct for MonitoringLocation

func NewMonitoringLocation

func NewMonitoringLocation(description string, region string, regionCode string, status MonitoringLocationStatus) *MonitoringLocation

NewMonitoringLocation instantiates a new MonitoringLocation object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (MonitoringLocation) MarshalJSON

func (o MonitoringLocation) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type MonitoringLocationStatus

type MonitoringLocationStatus string

MonitoringLocationStatus Server status

const (
	// MonitoringLocationStatusDown a monitoring location with a down status.
	MonitoringLocationStatusDown MonitoringLocationStatus = "down"
	// MonitoringLocationStatusUp a monitoring location with an up status.
	MonitoringLocationStatusUp MonitoringLocationStatus = "up"
)

func (*MonitoringLocationStatus) UnmarshalJSON

func (v *MonitoringLocationStatus) UnmarshalJSON(src []byte) error

Unmarshal JSON data into any of the pointers in the type.

func (MonitoringLocationStatus) Valid

func (v MonitoringLocationStatus) Valid() bool

Valid determines if the value is valid.

type MonitoringLocations

type MonitoringLocations struct {
	// List of monitoring locations
	Data []MonitoringLocation `json:"data"`
}

MonitoringLocations struct for MonitoringLocations

func NewMonitoringLocations

func NewMonitoringLocations(data []MonitoringLocation) *MonitoringLocations

NewMonitoringLocations instantiates a new MonitoringLocations object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (MonitoringLocations) MarshalJSON

func (o MonitoringLocations) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type Option

type Option func(*options)

Option consigures a HTTP client and connection.

func WithBackoff

func WithBackoff(s Strategy) Option

WithBackoff configures the backoff strategy after failed requests.

func WithDebug

func WithDebug() Option

WithDebug configures the client to output debug information when making requests.

func WithDisableRetry

func WithDisableRetry() Option

WithDisableRetry configures the client to disable request retries. Retry support is currently enabled by default and will make `maxRetries` attempts before failure.

func WithHTTPClient

func WithHTTPClient(c *http.Client) Option

WithHTTPClient configures the HTTP client used to perform requests

func WithHeader

func WithHeader(name, value string) Option

WithHeader configures the client to add the supplied header to each request. This header will be appended to an existing header set by other client options and endpoint specific header parameters.

func WithHeaders

func WithHeaders(headers http.Header) Option

WithHeaders configures the client to add supplied headers to each request. These headers will be appended to existing headers set by other client options and endpoint specific header parameters.

func WithHost

func WithHost(host string) Option

WithHost configures the base host address for the API client.

func WithMaxRetries

func WithMaxRetries(retries int) Option

WithMaxRetries configures the maximum number of retries that can be made before the request is considered to have failed.

func WithRequestCredentials

func WithRequestCredentials(creds RequestCredentials) Option

WithRequestCredentials configures the HTTP client to forward authentication credentials.

func WithUserAgent

func WithUserAgent(s string) Option

WithUserAgent configures the HTTP client user agent.

type PagespeedAPI

type PagespeedAPI interface {
	CreatePagespeedTest(ctx context.Context) APICreatePagespeedTestRequest
	CreatePagespeedTestWithData(ctx context.Context, m map[string]interface{}) APICreatePagespeedTestRequest
	CreatePagespeedTestExecute(r APICreatePagespeedTestRequest) (APIResponse, error)
	DeletePagespeedTest(ctx context.Context, testId string) APIDeletePagespeedTestRequest
	DeletePagespeedTestExecute(r APIDeletePagespeedTestRequest) error
	GetPagespeedTest(ctx context.Context, testId string) APIGetPagespeedTestRequest
	GetPagespeedTestExecute(r APIGetPagespeedTestRequest) (PagespeedTestResponse, error)
	ListPagespeedTestHistory(ctx context.Context, testId string) APIListPagespeedTestHistoryRequest
	ListPagespeedTestHistoryExecute(r APIListPagespeedTestHistoryRequest) (PagespeedTestHistory, error)
	ListPagespeedTests(ctx context.Context) APIListPagespeedTestsRequest
	ListPagespeedTestsExecute(r APIListPagespeedTestsRequest) (PagespeedTests, error)
	UpdatePagespeedTest(ctx context.Context, testId string) APIUpdatePagespeedTestRequest
	UpdatePagespeedTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIUpdatePagespeedTestRequest
	UpdatePagespeedTestExecute(r APIUpdatePagespeedTestRequest) error
}

PagespeedAPI describes the necessary methods to adhere to this interface.

type PagespeedService

type PagespeedService service

PagespeedService Pagespeed service.

func (*PagespeedService) CreatePagespeedTest

func (a *PagespeedService) CreatePagespeedTest(ctx context.Context) APICreatePagespeedTestRequest

CreatePagespeedTest Create a pagespeed check.

func (*PagespeedService) CreatePagespeedTestExecute

func (a *PagespeedService) CreatePagespeedTestExecute(r APICreatePagespeedTestRequest) (APIResponse, error)

Execute executes the request.

func (*PagespeedService) CreatePagespeedTestWithData

func (a *PagespeedService) CreatePagespeedTestWithData(ctx context.Context, m map[string]interface{}) APICreatePagespeedTestRequest

CreatePagespeedTestWithData Create a pagespeed check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*PagespeedService) DeletePagespeedTest

func (a *PagespeedService) DeletePagespeedTest(ctx context.Context, testId string) APIDeletePagespeedTestRequest

DeletePagespeedTest Delete a pagespeed check.

func (*PagespeedService) DeletePagespeedTestExecute

func (a *PagespeedService) DeletePagespeedTestExecute(r APIDeletePagespeedTestRequest) error

Execute executes the request.

func (*PagespeedService) DeletePagespeedTestWithData

func (a *PagespeedService) DeletePagespeedTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIDeletePagespeedTestRequest

DeletePagespeedTestWithData Delete a pagespeed check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*PagespeedService) GetPagespeedTest

func (a *PagespeedService) GetPagespeedTest(ctx context.Context, testId string) APIGetPagespeedTestRequest

GetPagespeedTest Retrieve a pagespeed check.

func (*PagespeedService) GetPagespeedTestExecute

Execute executes the request.

func (*PagespeedService) GetPagespeedTestWithData

func (a *PagespeedService) GetPagespeedTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIGetPagespeedTestRequest

GetPagespeedTestWithData Retrieve a pagespeed check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*PagespeedService) ListPagespeedTestHistory

func (a *PagespeedService) ListPagespeedTestHistory(ctx context.Context, testId string) APIListPagespeedTestHistoryRequest

ListPagespeedTestHistory Get all pagespeed check history.

func (*PagespeedService) ListPagespeedTestHistoryExecute

func (a *PagespeedService) ListPagespeedTestHistoryExecute(r APIListPagespeedTestHistoryRequest) (PagespeedTestHistory, error)

Execute executes the request.

func (*PagespeedService) ListPagespeedTestHistoryWithData

func (a *PagespeedService) ListPagespeedTestHistoryWithData(ctx context.Context, testId string, m map[string]interface{}) APIListPagespeedTestHistoryRequest

ListPagespeedTestHistoryWithData Get all pagespeed check history. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*PagespeedService) ListPagespeedTests

func (a *PagespeedService) ListPagespeedTests(ctx context.Context) APIListPagespeedTestsRequest

ListPagespeedTests Get all pagespeed checks.

func (*PagespeedService) ListPagespeedTestsExecute

func (a *PagespeedService) ListPagespeedTestsExecute(r APIListPagespeedTestsRequest) (PagespeedTests, error)

Execute executes the request.

func (*PagespeedService) ListPagespeedTestsWithData

func (a *PagespeedService) ListPagespeedTestsWithData(ctx context.Context, m map[string]interface{}) APIListPagespeedTestsRequest

ListPagespeedTestsWithData Get all pagespeed checks. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*PagespeedService) UpdatePagespeedTest

func (a *PagespeedService) UpdatePagespeedTest(ctx context.Context, testId string) APIUpdatePagespeedTestRequest

UpdatePagespeedTest Update a pagespeed check.

func (*PagespeedService) UpdatePagespeedTestExecute

func (a *PagespeedService) UpdatePagespeedTestExecute(r APIUpdatePagespeedTestRequest) error

Execute executes the request.

func (*PagespeedService) UpdatePagespeedTestWithData

func (a *PagespeedService) UpdatePagespeedTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIUpdatePagespeedTestRequest

UpdatePagespeedTestWithData Update a pagespeed check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

type PagespeedTest

type PagespeedTest struct {
	// Pagespeed check ID
	ID string `json:"id"`
	// Name of the check
	Name string `json:"name"`
	// URL, FQDN, or IP address of the website under test
	WebsiteURL string                 `json:"website_url"`
	CheckRate  PagespeedTestCheckRate `json:"check_rate"`
	// An alert will be sent if the size of the page is larger than this value (kb). A value of 0 prevents alerts being sent.
	AlertBigger int32 `json:"alert_bigger"`
	// An alert will be sent if the load time of the page exceeds this value (ms). A value of 0 prevents alerts being sent
	AlertSlower int64 `json:"alert_slower"`
	// An alert will be sent if the size of the page is smaller than this value (kb). A value of 0 prevents alerts being sent
	AlertSmaller int32 `json:"alert_smaller"`
	// List of contact group IDs
	ContactGroups []string            `json:"contact_groups"`
	LatestStats   *PagespeedTestStats `json:"latest_stats,omitempty"`
	// Assigned monitoring location on which checks will be run
	Location string `json:"location"`
	// Whether the check should be run
	Paused bool `json:"paused"`
}

PagespeedTest struct for PagespeedTest

func NewPagespeedTest

func NewPagespeedTest(id string, name string, websiteUrl string, checkRate PagespeedTestCheckRate, alertBigger int32, alertSlower int64, alertSmaller int32, contactGroups []string, location string, paused bool) *PagespeedTest

NewPagespeedTest instantiates a new PagespeedTest object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (PagespeedTest) MarshalJSON

func (o PagespeedTest) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type PagespeedTestCheckRate

type PagespeedTestCheckRate int32

PagespeedTestCheckRate Number of seconds between checks

const (
	// PagespeedTestCheckRateOneMinute a check rate of 1 minute.
	PagespeedTestCheckRateOneMinute PagespeedTestCheckRate = 60
	// PagespeedTestCheckRateFiveMinutes a check rate of 5 minutes.
	PagespeedTestCheckRateFiveMinutes PagespeedTestCheckRate = 300
	// PagespeedTestCheckRateTenMinutes a check rate of 10 minutes.
	PagespeedTestCheckRateTenMinutes PagespeedTestCheckRate = 600
	// PagespeedTestCheckRateFifteenMinutes a check rate of 15 minutes.
	PagespeedTestCheckRateFifteenMinutes PagespeedTestCheckRate = 900
	// PagespeedTestCheckRateThirtyMinutes a check rate of 30 minutes.
	PagespeedTestCheckRateThirtyMinutes PagespeedTestCheckRate = 1800
	// PagespeedTestCheckRateOneHour a check rate of 1 hour.
	PagespeedTestCheckRateOneHour PagespeedTestCheckRate = 3600
	// PagespeedTestCheckRateOneDay a check rate of 1 day.
	PagespeedTestCheckRateOneDay PagespeedTestCheckRate = 86400
)

func (*PagespeedTestCheckRate) UnmarshalJSON

func (v *PagespeedTestCheckRate) UnmarshalJSON(src []byte) error

Unmarshal JSON data into any of the pointers in the type.

func (PagespeedTestCheckRate) Valid

func (v PagespeedTestCheckRate) Valid() bool

Valid determines if the value is valid.

type PagespeedTestHistory

type PagespeedTestHistory struct {
	// List of pagespeed check history results
	Data     []PagespeedTestHistoryResult `json:"data"`
	Links    Links                        `json:"links"`
	Metadata map[string]interface{}       `json:"metadata,omitempty"`
}

PagespeedTestHistory struct for PagespeedTestHistory

func NewPagespeedTestHistory

func NewPagespeedTestHistory(data []PagespeedTestHistoryResult, links Links) *PagespeedTestHistory

NewPagespeedTestHistory instantiates a new PagespeedTestHistory object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (PagespeedTestHistory) MarshalJSON

func (o PagespeedTestHistory) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type PagespeedTestHistoryResult

type PagespeedTestHistoryResult struct {
	// Creation time of the result (RFC3339 format)
	Created time.Time `json:"created_at"`
	// Recorded filesize (kb)
	Filesize float32 `json:"filesize"`
	// Location of the saved HAR file
	HARLocation string `json:"har_location"`
	// Recorded loadtime (ms)
	Loadtime int64 `json:"loadtime"`
	// Recorded request count
	Requests   int32                   `json:"requests"`
	Throttling PagespeedTestThrottling `json:"throttling"`
}

PagespeedTestHistoryResult struct for PagespeedTestHistoryResult

func NewPagespeedTestHistoryResult

func NewPagespeedTestHistoryResult(createdAt time.Time, filesize float32, harLocation string, loadtime int64, requests int32, throttling PagespeedTestThrottling) *PagespeedTestHistoryResult

NewPagespeedTestHistoryResult instantiates a new PagespeedTestHistoryResult object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (PagespeedTestHistoryResult) MarshalJSON

func (o PagespeedTestHistoryResult) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type PagespeedTestRegion

type PagespeedTestRegion string

PagespeedTestRegion Testing regions

const (
	// PagespeedTestRegionAustralia a testing region based in Australia.
	PagespeedTestRegionAustralia PagespeedTestRegion = "AU"
	// PagespeedTestRegionCanada a testing region based in Canada.
	PagespeedTestRegionCanada PagespeedTestRegion = "CA"
	// PagespeedTestRegionGermany a testing region based in Germany.
	PagespeedTestRegionGermany PagespeedTestRegion = "DE"
	// PagespeedTestRegionFrance a testing region based in France.
	PagespeedTestRegionFrance PagespeedTestRegion = "FR"
	// PagespeedTestRegionIndia a testing region based in India.
	PagespeedTestRegionIndia PagespeedTestRegion = "IN"
	// PagespeedTestRegionJapan a testing region based in Japan.
	PagespeedTestRegionJapan PagespeedTestRegion = "JP"
	// PagespeedTestRegionNetherlands a testing region based in the Netherlands.
	PagespeedTestRegionNetherlands PagespeedTestRegion = "NL"
	// PagespeedTestRegionSingapore a testing region based in Singapore.
	PagespeedTestRegionSingapore PagespeedTestRegion = "SG"
	// PagespeedTestRegionUnitedKingdom a testing region based in the United Kingdom.
	PagespeedTestRegionUnitedKingdom PagespeedTestRegion = "UK"
	// PagespeedTestRegionAmericaEast a testing region based in the United States of America (East).
	PagespeedTestRegionAmericaEast PagespeedTestRegion = "US"
	// PagespeedTestRegionAmericaWest a testing region based in the United States of America (West).
	PagespeedTestRegionAmericaWest PagespeedTestRegion = "USW"
)

func (*PagespeedTestRegion) UnmarshalJSON

func (v *PagespeedTestRegion) UnmarshalJSON(src []byte) error

Unmarshal JSON data into any of the pointers in the type.

func (PagespeedTestRegion) Valid

func (v PagespeedTestRegion) Valid() bool

Valid determines if the value is valid.

type PagespeedTestResponse

type PagespeedTestResponse struct {
	Data PagespeedTest `json:"data"`
}

PagespeedTestResponse struct for PagespeedTestResponse

func NewPagespeedTestResponse

func NewPagespeedTestResponse(data PagespeedTest) *PagespeedTestResponse

NewPagespeedTestResponse instantiates a new PagespeedTestResponse object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (PagespeedTestResponse) MarshalJSON

func (o PagespeedTestResponse) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type PagespeedTestStats

type PagespeedTestStats struct {
	// Latest recorded filesize (kb)
	Filesize float32 `json:"filesize"`
	// Whether the latest check has an issue
	HasIssue bool `json:"has_issue"`
	// Latest recorded loadtime (ms)
	Loadtime int32 `json:"loadtime"`
	// Latest recorded request count
	Requests int32 `json:"requests"`
	// Latest recorded issue
	LatestIssue *string `json:"latest_issue,omitempty"`
}

PagespeedTestStats struct for PagespeedTestStats

func NewPagespeedTestStats

func NewPagespeedTestStats(filesize float32, hasIssue bool, loadtime int32, requests int32) *PagespeedTestStats

NewPagespeedTestStats instantiates a new PagespeedTestStats object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (PagespeedTestStats) MarshalJSON

func (o PagespeedTestStats) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type PagespeedTestThrottling

type PagespeedTestThrottling string

PagespeedTestThrottling Simulated throttling speed

const (
	// PagespeedTestThrottlingNone no throttling.
	PagespeedTestThrottlingNone PagespeedTestThrottling = "NONE"
	// PagespeedTestThrottlingFast3G fast 3G.
	PagespeedTestThrottlingFast3G PagespeedTestThrottling = "3G_FAST"
	// PagespeedTestThrottlingSlow3G slow 3G.
	PagespeedTestThrottlingSlow3G PagespeedTestThrottling = "3G_SLOW"
	// PagespeedTestThrottling4G 4G.
	PagespeedTestThrottling4G PagespeedTestThrottling = "4G"
	// PagespeedTestThrottlingEDGE EDGE.
	PagespeedTestThrottlingEDGE PagespeedTestThrottling = "EDGE"
	// PagespeedTestThrottlingGPRS GPRS.
	PagespeedTestThrottlingGPRS PagespeedTestThrottling = "GPRS"
)

func (*PagespeedTestThrottling) UnmarshalJSON

func (v *PagespeedTestThrottling) UnmarshalJSON(src []byte) error

Unmarshal JSON data into any of the pointers in the type.

func (PagespeedTestThrottling) Valid

func (v PagespeedTestThrottling) Valid() bool

Valid determines if the value is valid.

type PagespeedTests

type PagespeedTests struct {
	// List of pagespeed checks
	Data     []PagespeedTest `json:"data"`
	Metadata Pagination      `json:"metadata"`
}

PagespeedTests struct for PagespeedTests

func NewPagespeedTests

func NewPagespeedTests(data []PagespeedTest, metadata Pagination) *PagespeedTests

NewPagespeedTests instantiates a new PagespeedTests object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (PagespeedTests) MarshalJSON

func (o PagespeedTests) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type Pagination

type Pagination struct {
	// The current page of results
	Page int32 `json:"page"`
	// The number of results per page
	PerPage int32 `json:"per_page"`
	// The total number of pages
	PageCount int32 `json:"page_count"`
	// The total number of results
	TotalCount int32 `json:"total_count"`
}

Pagination struct for Pagination

func NewPagination

func NewPagination(page int32, perPage int32, pageCount int32, totalCount int32) *Pagination

NewPagination instantiates a new Pagination object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (Pagination) MarshalJSON

func (o Pagination) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type ReadCloserFunc added in v1.1.0

type ReadCloserFunc func() io.ReadCloser

type RequestCredentials

type RequestCredentials interface {
	AddCredentials(r *http.Request) *http.Request
}

RequestCredentials describes a common interface for attaching security credentials to every outbound request.

type SSLTest

type SSLTest struct {
	// SSL check ID
	ID string `json:"id"`
	// URL of the server under test
	WebsiteURL string           `json:"website_url"`
	CheckRate  SSLTestCheckRate `json:"check_rate"`
	// List representing when alerts should be sent (days).
	AlertAt []int32 `json:"alert_at"`
	// Whether to enable alerts when SSL certificate issues are found
	AlertBroken bool `json:"alert_broken"`
	// Whether to enable alerts when the SSL certificate is to expire
	AlertExpiry bool `json:"alert_expiry"`
	// Whether to enable alerts when mixed content is found
	AlertMixed bool `json:"alert_mixed"`
	// Whether to enable alert reminders
	AlertReminder bool `json:"alert_reminder"`
	// SSL certificate score (%)
	CertificateScore *int32 `json:"certificate_score,omitempty"`
	// SSL certificate status
	CertificateStatus *string `json:"certificate_status,omitempty"`
	// SSL/TLS cipher suite belonging to the SSL certificate
	Cipher *string `json:"cipher,omitempty"`
	// SSL certificate cipher strength (%)
	CipherScore *int32 `json:"cipher_score,omitempty"`
	// List of contact group IDs
	ContactGroups []string `json:"contact_groups"`
	// Issuer of the SSL certificate
	IssuerCommonName *string       `json:"issuer_common_name,omitempty"`
	Flags            *SSLTestFlags `json:"flags,omitempty"`
	// Whether to follow redirects when testing. Disabled by default
	FollowRedirects bool `json:"follow_redirects"`
	// Hostname of the server under test
	Hostname *string `json:"hostname,omitempty"`
	// The last reminder to have been sent (days)
	LastReminder *int32 `json:"last_reminder,omitempty"`
	// List of mixed content resources
	MixedContent []SSLTestMixedContent `json:"mixed_content"`
	// Whether the check should be run
	Paused bool `json:"paused"`
	// When the SSL certificate was last updated (RFC3339 format)
	Updated *time.Time `json:"updated_at,omitempty"`
	// Custom user agent string set when testing
	UserAgent *string `json:"user_agent,omitempty"`
	// SSL certificate validity start (RFC3339 format)
	ValidFrom *time.Time `json:"valid_from,omitempty"`
	// SSL certificate validity end (RFC3339 format)
	ValidUntil *time.Time `json:"valid_until,omitempty"`
}

SSLTest struct for SSLTest

func NewSSLTest

func NewSSLTest(id string, websiteUrl string, checkRate SSLTestCheckRate, alertAt []int32, alertBroken bool, alertExpiry bool, alertMixed bool, alertReminder bool, contactGroups []string, followRedirects bool, mixedContent []SSLTestMixedContent, paused bool) *SSLTest

NewSSLTest instantiates a new SSLTest object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (SSLTest) MarshalJSON

func (o SSLTest) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type SSLTestCheckRate

type SSLTestCheckRate int32

SSLTestCheckRate Number of seconds between checks

const (
	// SSLTestCheckRateFiveMinutes a check rate of 5 minutes.
	SSLTestCheckRateFiveMinutes SSLTestCheckRate = 300
	// SSLTestCheckRateTenMinutes a check rate of 10 minutes.
	SSLTestCheckRateTenMinutes SSLTestCheckRate = 600
	// SSLTestCheckRateThirtyMinutes a check rate of 30 minutes.
	SSLTestCheckRateThirtyMinutes SSLTestCheckRate = 1800
	// SSLTestCheckRateOneHour a check rate of 1 hour.
	SSLTestCheckRateOneHour SSLTestCheckRate = 3600
	// SSLTestCheckRateOneDay a check rate of 1 day.
	SSLTestCheckRateOneDay SSLTestCheckRate = 86400
	// SSLTestCheckRateOneWeek a check rate of 1 week.
	SSLTestCheckRateOneWeek SSLTestCheckRate = 2073600
)

func (*SSLTestCheckRate) UnmarshalJSON

func (v *SSLTestCheckRate) UnmarshalJSON(src []byte) error

Unmarshal JSON data into any of the pointers in the type.

func (SSLTestCheckRate) Valid

func (v SSLTestCheckRate) Valid() bool

Valid determines if the value is valid.

type SSLTestFlags

type SSLTestFlags struct {
	// Wherher follow redirects has been enabled for the SSL check
	FollowRedirects bool `json:"follow_redirects"`
	// Whether the requested page has mixed content
	HasMixed bool `json:"has_mixed"`
	// Whether the SSL certificate has Perfect Forward Security enabled
	HasPFS bool `json:"has_pfs"`
	// Whether the SSL certificate has errors
	IsBroken bool `json:"is_broken"`
	// Whether the SSL certificate has expired
	IsExpired bool `json:"is_expired"`
	// Whether the SSL certificate has Extended Validation (EV)
	IsExtended bool `json:"is_extended"`
	// Whether the SSL certificate is missing
	IsMissing bool `json:"is_missing"`
	// Whether the SSL certificate has been revoked by the certificate authority
	IsRevoked bool `json:"is_revoked"`
}

SSLTestFlags struct for SSLTestFlags

func NewSSLTestFlags

func NewSSLTestFlags(followRedirects bool, hasMixed bool, hasPfs bool, isBroken bool, isExpired bool, isExtended bool, isMissing bool, isRevoked bool) *SSLTestFlags

NewSSLTestFlags instantiates a new SSLTestFlags object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (SSLTestFlags) MarshalJSON

func (o SSLTestFlags) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type SSLTestMixedContent

type SSLTestMixedContent struct {
	// Full path to the content resource
	URL string `json:"src"`
	// Type of the content
	Type string `json:"type"`
}

SSLTestMixedContent struct for SSLTestMixedContent

func NewSSLTestMixedContent

func NewSSLTestMixedContent(src string, type_ string) *SSLTestMixedContent

NewSSLTestMixedContent instantiates a new SSLTestMixedContent object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (SSLTestMixedContent) MarshalJSON

func (o SSLTestMixedContent) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type SSLTestResponse

type SSLTestResponse struct {
	Data SSLTest `json:"data"`
}

SSLTestResponse struct for SSLTestResponse

func NewSSLTestResponse

func NewSSLTestResponse(data SSLTest) *SSLTestResponse

NewSSLTestResponse instantiates a new SSLTestResponse object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (SSLTestResponse) MarshalJSON

func (o SSLTestResponse) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type SSLTests

type SSLTests struct {
	// List of SSL checks
	Data     []SSLTest  `json:"data"`
	Metadata Pagination `json:"metadata"`
}

SSLTests struct for SSLTests

func NewSSLTests

func NewSSLTests(data []SSLTest, metadata Pagination) *SSLTests

NewSSLTests instantiates a new SSLTests object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (SSLTests) MarshalJSON

func (o SSLTests) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type ServerConfiguration

type ServerConfiguration struct {
	URL         string
	Description string
	Variables   map[string]ServerVariable
}

ServerConfiguration stores the information about a server.

type ServerConfigurations

type ServerConfigurations []ServerConfiguration

ServerConfigurations stores multiple ServerConfiguration items.

func (ServerConfigurations) URL

func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error)

URL formats template on a index using given variables.

type ServerVariable

type ServerVariable struct {
	Description  string
	DefaultValue string
	EnumValues   []string
}

ServerVariable stores the information about a server variable.

type SslAPI

type SslAPI interface {
	CreateSslTest(ctx context.Context) APICreateSslTestRequest
	CreateSslTestWithData(ctx context.Context, m map[string]interface{}) APICreateSslTestRequest
	CreateSslTestExecute(r APICreateSslTestRequest) (APIResponse, error)
	DeleteSslTest(ctx context.Context, testId string) APIDeleteSslTestRequest
	DeleteSslTestExecute(r APIDeleteSslTestRequest) error
	GetSslTest(ctx context.Context, testId string) APIGetSslTestRequest
	GetSslTestExecute(r APIGetSslTestRequest) (SSLTestResponse, error)
	ListSslTests(ctx context.Context) APIListSslTestsRequest
	ListSslTestsExecute(r APIListSslTestsRequest) (SSLTests, error)
	UpdateSslTest(ctx context.Context, testId string) APIUpdateSslTestRequest
	UpdateSslTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIUpdateSslTestRequest
	UpdateSslTestExecute(r APIUpdateSslTestRequest) error
}

SslAPI describes the necessary methods to adhere to this interface.

type SslService

type SslService service

SslService Ssl service.

func (*SslService) CreateSslTest

func (a *SslService) CreateSslTest(ctx context.Context) APICreateSslTestRequest

CreateSslTest Create an SSL check.

func (*SslService) CreateSslTestExecute

func (a *SslService) CreateSslTestExecute(r APICreateSslTestRequest) (APIResponse, error)

Execute executes the request.

func (*SslService) CreateSslTestWithData

func (a *SslService) CreateSslTestWithData(ctx context.Context, m map[string]interface{}) APICreateSslTestRequest

CreateSslTestWithData Create an SSL check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*SslService) DeleteSslTest

func (a *SslService) DeleteSslTest(ctx context.Context, testId string) APIDeleteSslTestRequest

DeleteSslTest Delete an SSL check.

func (*SslService) DeleteSslTestExecute

func (a *SslService) DeleteSslTestExecute(r APIDeleteSslTestRequest) error

Execute executes the request.

func (*SslService) DeleteSslTestWithData

func (a *SslService) DeleteSslTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIDeleteSslTestRequest

DeleteSslTestWithData Delete an SSL check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*SslService) GetSslTest

func (a *SslService) GetSslTest(ctx context.Context, testId string) APIGetSslTestRequest

GetSslTest Retrieve an SSL check.

func (*SslService) GetSslTestExecute

func (a *SslService) GetSslTestExecute(r APIGetSslTestRequest) (SSLTestResponse, error)

Execute executes the request.

func (*SslService) GetSslTestWithData

func (a *SslService) GetSslTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIGetSslTestRequest

GetSslTestWithData Retrieve an SSL check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*SslService) ListSslTests

func (a *SslService) ListSslTests(ctx context.Context) APIListSslTestsRequest

ListSslTests Get all SSL checks.

func (*SslService) ListSslTestsExecute

func (a *SslService) ListSslTestsExecute(r APIListSslTestsRequest) (SSLTests, error)

Execute executes the request.

func (*SslService) ListSslTestsWithData

func (a *SslService) ListSslTestsWithData(ctx context.Context, m map[string]interface{}) APIListSslTestsRequest

ListSslTestsWithData Get all SSL checks. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*SslService) UpdateSslTest

func (a *SslService) UpdateSslTest(ctx context.Context, testId string) APIUpdateSslTestRequest

UpdateSslTest Update an SSL check.

func (*SslService) UpdateSslTestExecute

func (a *SslService) UpdateSslTestExecute(r APIUpdateSslTestRequest) error

Execute executes the request.

func (*SslService) UpdateSslTestWithData

func (a *SslService) UpdateSslTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIUpdateSslTestRequest

UpdateSslTestWithData Update an SSL check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

type Strategy

type Strategy interface {
	Backoff(idx int) time.Duration
}

Strategy describes a common interface to satisfy a backoff strategy when a request fails.

type UptimeAPI

type UptimeAPI interface {
	CreateUptimeTest(ctx context.Context) APICreateUptimeTestRequest
	CreateUptimeTestWithData(ctx context.Context, m map[string]interface{}) APICreateUptimeTestRequest
	CreateUptimeTestExecute(r APICreateUptimeTestRequest) (APIResponse, error)
	DeleteUptimeTest(ctx context.Context, testId string) APIDeleteUptimeTestRequest
	DeleteUptimeTestExecute(r APIDeleteUptimeTestRequest) error
	GetUptimeTest(ctx context.Context, testId string) APIGetUptimeTestRequest
	GetUptimeTestExecute(r APIGetUptimeTestRequest) (UptimeTestResponse, error)
	ListUptimeTestAlerts(ctx context.Context, testId string) APIListUptimeTestAlertsRequest
	ListUptimeTestAlertsExecute(r APIListUptimeTestAlertsRequest) (UptimeTestAlerts, error)
	ListUptimeTestHistory(ctx context.Context, testId string) APIListUptimeTestHistoryRequest
	ListUptimeTestHistoryExecute(r APIListUptimeTestHistoryRequest) (UptimeTestHistory, error)
	ListUptimeTestPeriods(ctx context.Context, testId string) APIListUptimeTestPeriodsRequest
	ListUptimeTestPeriodsExecute(r APIListUptimeTestPeriodsRequest) (UptimeTestPeriods, error)
	ListUptimeTests(ctx context.Context) APIListUptimeTestsRequest
	ListUptimeTestsExecute(r APIListUptimeTestsRequest) (UptimeTests, error)
	UpdateUptimeTest(ctx context.Context, testId string) APIUpdateUptimeTestRequest
	UpdateUptimeTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIUpdateUptimeTestRequest
	UpdateUptimeTestExecute(r APIUpdateUptimeTestRequest) error
}

UptimeAPI describes the necessary methods to adhere to this interface.

type UptimeService

type UptimeService service

UptimeService Uptime service.

func (*UptimeService) CreateUptimeTest

func (a *UptimeService) CreateUptimeTest(ctx context.Context) APICreateUptimeTestRequest

CreateUptimeTest Create an uptime check.

func (*UptimeService) CreateUptimeTestExecute

func (a *UptimeService) CreateUptimeTestExecute(r APICreateUptimeTestRequest) (APIResponse, error)

Execute executes the request.

func (*UptimeService) CreateUptimeTestWithData

func (a *UptimeService) CreateUptimeTestWithData(ctx context.Context, m map[string]interface{}) APICreateUptimeTestRequest

CreateUptimeTestWithData Create an uptime check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*UptimeService) DeleteUptimeTest

func (a *UptimeService) DeleteUptimeTest(ctx context.Context, testId string) APIDeleteUptimeTestRequest

DeleteUptimeTest Delete an uptime check.

func (*UptimeService) DeleteUptimeTestExecute

func (a *UptimeService) DeleteUptimeTestExecute(r APIDeleteUptimeTestRequest) error

Execute executes the request.

func (*UptimeService) DeleteUptimeTestWithData

func (a *UptimeService) DeleteUptimeTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIDeleteUptimeTestRequest

DeleteUptimeTestWithData Delete an uptime check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*UptimeService) GetUptimeTest

func (a *UptimeService) GetUptimeTest(ctx context.Context, testId string) APIGetUptimeTestRequest

GetUptimeTest Retrieve an uptime check.

func (*UptimeService) GetUptimeTestExecute

func (a *UptimeService) GetUptimeTestExecute(r APIGetUptimeTestRequest) (UptimeTestResponse, error)

Execute executes the request.

func (*UptimeService) GetUptimeTestWithData

func (a *UptimeService) GetUptimeTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIGetUptimeTestRequest

GetUptimeTestWithData Retrieve an uptime check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*UptimeService) ListUptimeTestAlerts

func (a *UptimeService) ListUptimeTestAlerts(ctx context.Context, testId string) APIListUptimeTestAlertsRequest

ListUptimeTestAlerts Get all uptime check alerts.

func (*UptimeService) ListUptimeTestAlertsExecute

func (a *UptimeService) ListUptimeTestAlertsExecute(r APIListUptimeTestAlertsRequest) (UptimeTestAlerts, error)

Execute executes the request.

func (*UptimeService) ListUptimeTestAlertsWithData

func (a *UptimeService) ListUptimeTestAlertsWithData(ctx context.Context, testId string, m map[string]interface{}) APIListUptimeTestAlertsRequest

ListUptimeTestAlertsWithData Get all uptime check alerts. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*UptimeService) ListUptimeTestHistory

func (a *UptimeService) ListUptimeTestHistory(ctx context.Context, testId string) APIListUptimeTestHistoryRequest

ListUptimeTestHistory Get all uptime check history.

func (*UptimeService) ListUptimeTestHistoryExecute

func (a *UptimeService) ListUptimeTestHistoryExecute(r APIListUptimeTestHistoryRequest) (UptimeTestHistory, error)

Execute executes the request.

func (*UptimeService) ListUptimeTestHistoryWithData

func (a *UptimeService) ListUptimeTestHistoryWithData(ctx context.Context, testId string, m map[string]interface{}) APIListUptimeTestHistoryRequest

ListUptimeTestHistoryWithData Get all uptime check history. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*UptimeService) ListUptimeTestPeriods

func (a *UptimeService) ListUptimeTestPeriods(ctx context.Context, testId string) APIListUptimeTestPeriodsRequest

ListUptimeTestPeriods Get all uptime check periods.

func (*UptimeService) ListUptimeTestPeriodsExecute

func (a *UptimeService) ListUptimeTestPeriodsExecute(r APIListUptimeTestPeriodsRequest) (UptimeTestPeriods, error)

Execute executes the request.

func (*UptimeService) ListUptimeTestPeriodsWithData

func (a *UptimeService) ListUptimeTestPeriodsWithData(ctx context.Context, testId string, m map[string]interface{}) APIListUptimeTestPeriodsRequest

ListUptimeTestPeriodsWithData Get all uptime check periods. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*UptimeService) ListUptimeTests

func (a *UptimeService) ListUptimeTests(ctx context.Context) APIListUptimeTestsRequest

ListUptimeTests Get all uptime checks.

func (*UptimeService) ListUptimeTestsExecute

func (a *UptimeService) ListUptimeTestsExecute(r APIListUptimeTestsRequest) (UptimeTests, error)

Execute executes the request.

func (*UptimeService) ListUptimeTestsWithData

func (a *UptimeService) ListUptimeTestsWithData(ctx context.Context, m map[string]interface{}) APIListUptimeTestsRequest

ListUptimeTestsWithData Get all uptime checks. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

func (*UptimeService) UpdateUptimeTest

func (a *UptimeService) UpdateUptimeTest(ctx context.Context, testId string) APIUpdateUptimeTestRequest

UpdateUptimeTest Update an uptime check.

func (*UptimeService) UpdateUptimeTestExecute

func (a *UptimeService) UpdateUptimeTestExecute(r APIUpdateUptimeTestRequest) error

Execute executes the request.

func (*UptimeService) UpdateUptimeTestWithData

func (a *UptimeService) UpdateUptimeTestWithData(ctx context.Context, testId string, m map[string]interface{}) APIUpdateUptimeTestRequest

UpdateUptimeTestWithData Update an uptime check. The use of this method is discouraged as it does not provide the level of type safety afforded by the field methods on the request type.

type UptimeTest

type UptimeTest struct {
	// Uptime check ID
	ID string `json:"id"`
	// Name of the check
	Name     string         `json:"name"`
	TestType UptimeTestType `json:"test_type"`
	// URL, FQDN, or IP address of the server under test
	WebsiteURL string              `json:"website_url"`
	CheckRate  UptimeTestCheckRate `json:"check_rate"`
	// Number of confirmation servers to confirm downtime before an alert is triggered
	Confirmation int32 `json:"confirmation"`
	// List of contact group IDs
	ContactGroups []string `json:"contact_groups"`
	// JSON object. Represents headers to be sent when making requests
	CustomHeader *string `json:"custom_header,omitempty"`
	// List of IP addresses to compare against returned DNS records
	DNSIPs []string `json:"dns_ips"`
	// FQDN or IP address of the nameserver to query
	DNSServer *string `json:"dns_server,omitempty"`
	// Whether to consider the check as down if the content is present within the response
	DoNotFind bool `json:"do_not_find"`
	// Whether to send an alert if the SSL certificate is soon to expire
	EnableSSLAlert bool `json:"enable_ssl_alert"`
	// Specify where the redirect chain should end
	FinalEndpoint *string `json:"final_endpoint,omitempty"`
	// String to look for within the response. Considered down if not found
	FindString *string `json:"find_string,omitempty"`
	// Whether to follow redirects when testing. Disabled by default
	FollowRedirects bool `json:"follow_redirects"`
	// Include header content in string match search
	IncludeHeader bool `json:"include_header"`
	// Name of the hosting provider
	Host *string `json:"host,omitempty"`
	// When the check was last run (RFC3339 format)
	LastTested *time.Time `json:"last_tested_at,omitempty"`
	// The server location the check will run next
	NextLocation *string `json:"next_location,omitempty"`
	// Whether the check should be run
	Paused bool `json:"paused"`
	// Destination port for TCP checks
	Port *int32 `json:"port,omitempty"`
	// JSON object. Payload submitted with the request. Setting this updates the check to use the HTTP POST verb
	PostBody *string `json:"post_body,omitempty"`
	// Raw HTTP POST string to send to the server
	PostRaw *string `json:"post_raw,omitempty"`
	// Whether the check is currently being processed
	Processing bool `json:"processing"`
	// The server location the check is currently being run
	ProcessingOn    *string                    `json:"processing_on,omitempty"`
	ProcessingState *UptimeTestProcessingState `json:"processing_state,omitempty"`
	// List of assigned monitoring locations on which to run checks
	Servers []MonitoringLocation `json:"servers"`
	Status  UptimeTestStatus     `json:"status"`
	// List of status codes that trigger an alert
	StatusCodes []string `json:"status_codes"`
	// List of tags
	Tags []string `json:"tags"`
	// The number of seconds to wait to receive the first byte
	Timeout int32 `json:"timeout"`
	// The number of minutes to wait before sending an alert
	TriggerRate int32 `json:"trigger_rate"`
	// Uptime percentage for a check
	Uptime float32 `json:"uptime"`
	// Whether to enable cookie storage
	UseJAR bool `json:"use_jar"`
	// Custom user agent string set when testing
	UserAgent *string `json:"user_agent,omitempty"`
}

UptimeTest struct for UptimeTest

func NewUptimeTest

func NewUptimeTest(id string, name string, testType UptimeTestType, websiteUrl string, checkRate UptimeTestCheckRate, confirmation int32, contactGroups []string, dnsIps []string, doNotFind bool, enableSslAlert bool, followRedirects bool, includeHeader bool, paused bool, processing bool, servers []MonitoringLocation, status UptimeTestStatus, statusCodes []string, tags []string, timeout int32, triggerRate int32, uptime float32, useJar bool) *UptimeTest

NewUptimeTest instantiates a new UptimeTest object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (UptimeTest) MarshalJSON

func (o UptimeTest) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type UptimeTestAlert

type UptimeTestAlert struct {
	// Uptime check ID
	ID     string           `json:"id"`
	Status UptimeTestStatus `json:"status"`
	// Uptime check status code
	StatusCode int32 `json:"status_code"`
	// When the alert was triggered (RFC3339 format)
	Triggered *time.Time `json:"triggered_at,omitempty"`
}

UptimeTestAlert struct for UptimeTestAlert

func NewUptimeTestAlert

func NewUptimeTestAlert(id string, status UptimeTestStatus, statusCode int32) *UptimeTestAlert

NewUptimeTestAlert instantiates a new UptimeTestAlert object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (UptimeTestAlert) MarshalJSON

func (o UptimeTestAlert) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type UptimeTestAlerts

type UptimeTestAlerts struct {
	// List of uptime check alerts
	Data     []UptimeTestAlert      `json:"data"`
	Links    Links                  `json:"links"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

UptimeTestAlerts struct for UptimeTestAlerts

func NewUptimeTestAlerts

func NewUptimeTestAlerts(data []UptimeTestAlert, links Links) *UptimeTestAlerts

NewUptimeTestAlerts instantiates a new UptimeTestAlerts object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (UptimeTestAlerts) MarshalJSON

func (o UptimeTestAlerts) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type UptimeTestCheckRate

type UptimeTestCheckRate int32

UptimeTestCheckRate Number of seconds between checks

const (
	// UptimeTestCheckRateConstant a constant check rate.
	UptimeTestCheckRateConstant UptimeTestCheckRate = 0
	// UptimeTestCheckRateThirtySeconds a check rate of 30 seconds.
	UptimeTestCheckRateThirtySeconds UptimeTestCheckRate = 30
	// UptimeTestCheckRateOneMinute a check rate of 1 minute.
	UptimeTestCheckRateOneMinute UptimeTestCheckRate = 60
	// UptimeTestCheckRateFiveMinutes a check rate of 5 minutes.
	UptimeTestCheckRateFiveMinutes UptimeTestCheckRate = 300
	// UptimeTestCheckRateFifteenMinutes a check rate of 15 minutes.
	UptimeTestCheckRateFifteenMinutes UptimeTestCheckRate = 900
	// UptimeTestCheckRateThirtyMinutes a check rate of 30 minutes.
	UptimeTestCheckRateThirtyMinutes UptimeTestCheckRate = 1800
	// UptimeTestCheckRateOneHour a check rate of 1 hour.
	UptimeTestCheckRateOneHour UptimeTestCheckRate = 3600
	// UptimeTestCheckRateOneDay a check rate of 1 day.
	UptimeTestCheckRateOneDay UptimeTestCheckRate = 86400
)

func (*UptimeTestCheckRate) UnmarshalJSON

func (v *UptimeTestCheckRate) UnmarshalJSON(src []byte) error

Unmarshal JSON data into any of the pointers in the type.

func (UptimeTestCheckRate) Valid

func (v UptimeTestCheckRate) Valid() bool

Valid determines if the value is valid.

type UptimeTestHistory

type UptimeTestHistory struct {
	// List of uptime check history results
	Data     []UptimeTestHistoryResult `json:"data"`
	Links    Links                     `json:"links"`
	Metadata map[string]interface{}    `json:"metadata,omitempty"`
}

UptimeTestHistory struct for UptimeTestHistory

func NewUptimeTestHistory

func NewUptimeTestHistory(data []UptimeTestHistoryResult, links Links) *UptimeTestHistory

NewUptimeTestHistory instantiates a new UptimeTestHistory object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (UptimeTestHistory) MarshalJSON

func (o UptimeTestHistory) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type UptimeTestHistoryResult

type UptimeTestHistoryResult struct {
	// Creation time of the result (RFC3339 format)
	Created time.Time `json:"created_at"`
	// The server location the check ran
	Location *string `json:"location,omitempty"`
	// Recorded loadtime (ms)
	Performance *int64 `json:"performance,omitempty"`
	// Uptime check status code
	StatusCode *int32 `json:"status_code,omitempty"`
}

UptimeTestHistoryResult struct for UptimeTestHistoryResult

func NewUptimeTestHistoryResult

func NewUptimeTestHistoryResult(createdAt time.Time) *UptimeTestHistoryResult

NewUptimeTestHistoryResult instantiates a new UptimeTestHistoryResult object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (UptimeTestHistoryResult) MarshalJSON

func (o UptimeTestHistoryResult) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type UptimeTestOverview

type UptimeTestOverview struct {
	// Uptime check ID
	ID string `json:"id"`
	// Name of the check
	Name string `json:"name"`
	// URL or IP address of the server under test
	WebsiteURL string              `json:"website_url"`
	TestType   UptimeTestType      `json:"test_type"`
	CheckRate  UptimeTestCheckRate `json:"check_rate"`
	// List of contact group IDs
	ContactGroups []string `json:"contact_groups"`
	// Whether the check should be run
	Paused bool             `json:"paused"`
	Status UptimeTestStatus `json:"status"`
	// List of tags
	Tags []string `json:"tags"`
	// Uptime percentage for a check
	Uptime *float32 `json:"uptime,omitempty"`
}

UptimeTestOverview struct for UptimeTestOverview

func NewUptimeTestOverview

func NewUptimeTestOverview(id string, name string, websiteUrl string, testType UptimeTestType, checkRate UptimeTestCheckRate, contactGroups []string, paused bool, status UptimeTestStatus, tags []string) *UptimeTestOverview

NewUptimeTestOverview instantiates a new UptimeTestOverview object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (UptimeTestOverview) MarshalJSON

func (o UptimeTestOverview) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type UptimeTestPeriod

type UptimeTestPeriod struct {
	// When the status period was created (RFC3339 format)
	Created time.Time `json:"created_at"`
	// Status period duration (ms)
	Duration *int64 `json:"duration,omitempty"`
	// When the status period ended (RFC3339 format)
	Ended  *time.Time       `json:"ended_at,omitempty"`
	Status UptimeTestStatus `json:"status"`
}

UptimeTestPeriod struct for UptimeTestPeriod

func NewUptimeTestPeriod

func NewUptimeTestPeriod(createdAt time.Time, status UptimeTestStatus) *UptimeTestPeriod

NewUptimeTestPeriod instantiates a new UptimeTestPeriod object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (UptimeTestPeriod) MarshalJSON

func (o UptimeTestPeriod) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type UptimeTestPeriods

type UptimeTestPeriods struct {
	// List of uptime check periods
	Data     []UptimeTestPeriod     `json:"data"`
	Links    Links                  `json:"links"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

UptimeTestPeriods struct for UptimeTestPeriods

func NewUptimeTestPeriods

func NewUptimeTestPeriods(data []UptimeTestPeriod, links Links) *UptimeTestPeriods

NewUptimeTestPeriods instantiates a new UptimeTestPeriods object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (UptimeTestPeriods) MarshalJSON

func (o UptimeTestPeriods) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type UptimeTestProcessingState

type UptimeTestProcessingState string

UptimeTestProcessingState Uptime check proccessing state

const (
	// UptimeTestProcessingStateComplete a completed check state.
	UptimeTestProcessingStateComplete UptimeTestProcessingState = "complete"
	// UptimeTestProcessingStatePretest a pretest check state.
	UptimeTestProcessingStatePretest UptimeTestProcessingState = "pretest"
	// UptimeTestProcessingStateRetest a retest check state.
	UptimeTestProcessingStateRetest UptimeTestProcessingState = "retest"
	// UptimeTestProcessingStateUpRetest an up retest check state.
	UptimeTestProcessingStateUpRetest UptimeTestProcessingState = "up_retest"
)

func (*UptimeTestProcessingState) UnmarshalJSON

func (v *UptimeTestProcessingState) UnmarshalJSON(src []byte) error

Unmarshal JSON data into any of the pointers in the type.

func (UptimeTestProcessingState) Valid

func (v UptimeTestProcessingState) Valid() bool

Valid determines if the value is valid.

type UptimeTestResponse

type UptimeTestResponse struct {
	Data UptimeTest `json:"data"`
}

UptimeTestResponse struct for UptimeTestResponse

func NewUptimeTestResponse

func NewUptimeTestResponse(data UptimeTest) *UptimeTestResponse

NewUptimeTestResponse instantiates a new UptimeTestResponse object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (UptimeTestResponse) MarshalJSON

func (o UptimeTestResponse) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

type UptimeTestStatus

type UptimeTestStatus string

UptimeTestStatus The returned status of an uptime check

const (
	// UptimeTestStatusDown an uptime check with a down status.
	UptimeTestStatusDown UptimeTestStatus = "down"
	// UptimeTestStatusUp an uptime check with an up status.
	UptimeTestStatusUp UptimeTestStatus = "up"
)

func (*UptimeTestStatus) UnmarshalJSON

func (v *UptimeTestStatus) UnmarshalJSON(src []byte) error

Unmarshal JSON data into any of the pointers in the type.

func (UptimeTestStatus) Valid

func (v UptimeTestStatus) Valid() bool

Valid determines if the value is valid.

type UptimeTestType

type UptimeTestType string

UptimeTestType Uptime check type

const (
	// UptimeTestTypeDNS a DNS uptime check.
	UptimeTestTypeDNS UptimeTestType = "DNS"
	// UptimeTestTypeHEAD an HTTP uptime check (HEAD verb).
	UptimeTestTypeHEAD UptimeTestType = "HEAD"
	// UptimeTestTypeHTTP an HTTP uptime check (GET or POST verbs).
	UptimeTestTypeHTTP UptimeTestType = "HTTP"
	// UptimeTestTypePING an PING uptime check.
	UptimeTestTypePING UptimeTestType = "PING"
	// UptimeTestTypeSMTP an SMTP uptime check.
	UptimeTestTypeSMTP UptimeTestType = "SMTP"
	// UptimeTestTypeSSH an SSH uptime check.
	UptimeTestTypeSSH UptimeTestType = "SSH"
	// UptimeTestTypeTCP a TCP uptime check.
	UptimeTestTypeTCP UptimeTestType = "TCP"
)

func (*UptimeTestType) UnmarshalJSON

func (v *UptimeTestType) UnmarshalJSON(src []byte) error

Unmarshal JSON data into any of the pointers in the type.

func (UptimeTestType) Valid

func (v UptimeTestType) Valid() bool

Valid determines if the value is valid.

type UptimeTests

type UptimeTests struct {
	// List of uptime checks
	Data     []UptimeTestOverview `json:"data"`
	Metadata Pagination           `json:"metadata"`
}

UptimeTests struct for UptimeTests

func NewUptimeTests

func NewUptimeTests(data []UptimeTestOverview, metadata Pagination) *UptimeTests

NewUptimeTests instantiates a new UptimeTests object. This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.

func (UptimeTests) MarshalJSON

func (o UptimeTests) MarshalJSON() ([]byte, error)

MarshalJSON serialises data in the struct to JSON.

Source Files

Directories

Path Synopsis
examples
ssl

Jump to

Keyboard shortcuts

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