Categorygithub.com/StatusCakeDev/statuscake-go
modulepackage
1.3.0
Repository: https://github.com/statuscakedev/statuscake-go.git
Documentation: pkg.go.dev

# 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.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

Errors returns the map of error messages contained in an APIError.
HeartbeatTestStatusValues returns the values of HeartbeatTestStatus.
MaintenanceWindowRepeatIntervalValues returns the values of MaintenanceWindowRepeatInterval.
MaintenanceWindowStateValues returns the values of MaintenanceWindowState.
MonitoringLocationStatusValues returns the values of MonitoringLocationStatus.
NewAPIError returns a structured error type from an API response.
NewAPIResponse instantiates a new APIResponse object.
NewAPIResponseData instantiates a new APIResponseData object.
NewClient creates a new API client.
NewContactGroup instantiates a new ContactGroup object.
NewContactGroupResponse instantiates a new ContactGroupResponse object.
NewContactGroups instantiates a new ContactGroups object.
NewHeartbeatTest instantiates a new HeartbeatTest object.
NewHeartbeatTestOverview instantiates a new HeartbeatTestOverview object.
NewHeartbeatTestResponse instantiates a new HeartbeatTestResponse object.
NewHeartbeatTests instantiates a new HeartbeatTests object.
NewLinks instantiates a new Links object.
NewMaintenanceWindow instantiates a new MaintenanceWindow object.
NewMaintenanceWindowResponse instantiates a new MaintenanceWindowResponse object.
NewMaintenanceWindows instantiates a new MaintenanceWindows object.
NewMonitoringLocation instantiates a new MonitoringLocation object.
NewMonitoringLocations instantiates a new MonitoringLocations object.
NewPagespeedTest instantiates a new PagespeedTest object.
NewPagespeedTestHistory instantiates a new PagespeedTestHistory object.
NewPagespeedTestHistoryResult instantiates a new PagespeedTestHistoryResult object.
NewPagespeedTestResponse instantiates a new PagespeedTestResponse object.
NewPagespeedTests instantiates a new PagespeedTests object.
NewPagespeedTestStats instantiates a new PagespeedTestStats object.
NewPagination instantiates a new Pagination object.
NewSSLTest instantiates a new SSLTest object.
NewSSLTestFlags instantiates a new SSLTestFlags object.
NewSSLTestMixedContent instantiates a new SSLTestMixedContent object.
NewSSLTestResponse instantiates a new SSLTestResponse object.
NewSSLTests instantiates a new SSLTests object.
NewUptimeTest instantiates a new UptimeTest object.
NewUptimeTestAlert instantiates a new UptimeTestAlert object.
NewUptimeTestAlerts instantiates a new UptimeTestAlerts object.
NewUptimeTestHistory instantiates a new UptimeTestHistory object.
NewUptimeTestHistoryResult instantiates a new UptimeTestHistoryResult object.
NewUptimeTestOverview instantiates a new UptimeTestOverview object.
NewUptimeTestPeriod instantiates a new UptimeTestPeriod object.
NewUptimeTestPeriods instantiates a new UptimeTestPeriods object.
NewUptimeTestResponse instantiates a new UptimeTestResponse object.
NewUptimeTests instantiates a new UptimeTests object.
PagespeedTestCheckRateValues returns the values of PagespeedTestCheckRate.
PagespeedTestRegionValues returns the values of PagespeedTestRegion.
PagespeedTestThrottlingValues returns the values of PagespeedTestThrottling.
PtrBool is a helper routine that returns a pointer to given boolean value.
PtrFloat32 is a helper routine that returns a pointer to given float value.
PtrFloat64 is a helper routine that returns a pointer to given float value.
PtrInt is a helper routine that returns a pointer to given integer value.
PtrInt32 is a helper routine that returns a pointer to given integer value.
PtrInt64 is a helper routine that returns a pointer to given integer value.
PtrString is a helper routine that returns a pointer to given string value.
PtrTime is helper routine that returns a pointer to given Time value.
SSLTestCheckRateValues returns the values of SSLTestCheckRate.
UptimeTestCheckRateValues returns the values of UptimeTestCheckRate.
UptimeTestProcessingStateValues returns the values of UptimeTestProcessingState.
UptimeTestStatusValues returns the values of UptimeTestStatus.
UptimeTestTypeValues returns the values of UptimeTestType.
WithBackoff configures the backoff strategy after failed requests.
WithDebug configures the client to output debug information when making requests.
WithDisableRetry configures the client to disable request retries.
WithHeader configures the client to add the supplied header to each request.
WithHeaders configures the client to add supplied headers to each request.
WithHost configures the base host address for the API client.
WithHTTPClient configures the HTTP client used to perform requests.
WithMaxRetries configures the maximum number of retries that can be made before the request is considered to have failed.
WithRequestCredentials configures the HTTP client to forward authentication credentials.
WithUserAgent configures the HTTP client user agent.

# Constants

HeartbeatTestStatusDown a heartbeat check with a down status.
HeartbeatTestStatusUp a heartbeat check with an up status.
MaintenanceWindowRepeatIntervalBiweekly a maintenance window occuring biweekly.
MaintenanceWindowRepeatIntervalDaily a maintenance window occuring daily.
MaintenanceWindowRepeatIntervalMonthly a maintenance window occuring monthly.
MaintenanceWindowRepeatIntervalNever a maintenance window that never reoccurs.
MaintenanceWindowRepeatIntervalWeekly a maintenance window occuring weekly.
MaintenanceWindowStateActive a maintenance window in an active state.
MaintenanceWindowStatePaused a maintenance window in a paused state.
MaintenanceWindowStatePending a maintenance window in a pending state.
MonitoringLocationStatusDown a monitoring location with a down status.
MonitoringLocationStatusUp a monitoring location with an up status.
PagespeedTestCheckRateFifteenMinutes a check rate of 15 minutes.
PagespeedTestCheckRateFiveMinutes a check rate of 5 minutes.
PagespeedTestCheckRateOneDay a check rate of 1 day.
PagespeedTestCheckRateOneHour a check rate of 1 hour.
PagespeedTestCheckRateOneMinute a check rate of 1 minute.
PagespeedTestCheckRateTenMinutes a check rate of 10 minutes.
PagespeedTestCheckRateThirtyMinutes a check rate of 30 minutes.
PagespeedTestRegionAmericaEast a testing region based in the United States of America (East).
PagespeedTestRegionAmericaWest a testing region based in the United States of America (West).
PagespeedTestRegionAustralia a testing region based in Australia.
PagespeedTestRegionCanada a testing region based in Canada.
PagespeedTestRegionFrance a testing region based in France.
PagespeedTestRegionGermany a testing region based in Germany.
PagespeedTestRegionIndia a testing region based in India.
PagespeedTestRegionJapan a testing region based in Japan.
PagespeedTestRegionNetherlands a testing region based in the Netherlands.
PagespeedTestRegionSingapore a testing region based in Singapore.
PagespeedTestRegionUnitedKingdom a testing region based in the United Kingdom.
PagespeedTestThrottling4G 4G.
PagespeedTestThrottlingEDGE EDGE.
PagespeedTestThrottlingFast3G fast 3G.
PagespeedTestThrottlingGPRS GPRS.
PagespeedTestThrottlingNone no throttling.
PagespeedTestThrottlingSlow3G slow 3G.
SSLTestCheckRateFiveMinutes a check rate of 5 minutes.
SSLTestCheckRateOneDay a check rate of 1 day.
SSLTestCheckRateOneHour a check rate of 1 hour.
SSLTestCheckRateOneWeek a check rate of 1 week.
SSLTestCheckRateTenMinutes a check rate of 10 minutes.
SSLTestCheckRateThirtyMinutes a check rate of 30 minutes.
UptimeTestCheckRateConstant a constant check rate.
UptimeTestCheckRateFifteenMinutes a check rate of 15 minutes.
UptimeTestCheckRateFiveMinutes a check rate of 5 minutes.
UptimeTestCheckRateOneDay a check rate of 1 day.
UptimeTestCheckRateOneHour a check rate of 1 hour.
UptimeTestCheckRateOneMinute a check rate of 1 minute.
UptimeTestCheckRateThirtyMinutes a check rate of 30 minutes.
UptimeTestCheckRateThirtySeconds a check rate of 30 seconds.
UptimeTestProcessingStateComplete a completed check state.
UptimeTestProcessingStatePretest a pretest check state.
UptimeTestProcessingStateRetest a retest check state.
UptimeTestProcessingStateUpRetest an up retest check state.
UptimeTestStatusDown an uptime check with a down status.
UptimeTestStatusUp an uptime check with an up status.
UptimeTestTypeDNS a DNS uptime check.
UptimeTestTypeHEAD an HTTP uptime check (HEAD verb).
UptimeTestTypeHTTP an HTTP uptime check (GET or POST verbs).
UptimeTestTypePING an PING uptime check.
UptimeTestTypeSMTP an SMTP uptime check.
UptimeTestTypeSSH an SSH uptime check.
UptimeTestTypeTCP a TCP uptime check.

# Variables

ContextOperationServerIndices uses a server configuration from the index mapping.
ContextOperationServerVariables overrides a server configuration variables using operation specific values.
ContextServerIndex uses a server configuration from the index.
ContextServerVariables overrides a server configuration variables.

# Structs

APICreateContactGroupRequest represents a request type.
APICreateHeartbeatTestRequest represents a request type.
APICreateMaintenanceWindowRequest represents a request type.
APICreatePagespeedTestRequest represents a request type.
APICreateSslTestRequest represents a request type.
APICreateUptimeTestRequest represents a request type.
APIDeleteContactGroupRequest represents a request type.
APIDeleteHeartbeatTestRequest represents a request type.
APIDeleteMaintenanceWindowRequest represents a request type.
APIDeletePagespeedTestRequest represents a request type.
APIDeleteSslTestRequest represents a request type.
APIDeleteUptimeTestRequest represents a request type.
APIError represents an error returned from the API.
APIGetContactGroupRequest represents a request type.
APIGetHeartbeatTestRequest represents a request type.
APIGetMaintenanceWindowRequest represents a request type.
APIGetPagespeedTestRequest represents a request type.
APIGetSslTestRequest represents a request type.
APIGetUptimeTestRequest represents a request type.
APIListContactGroupsRequest represents a request type.
APIListHeartbeatTestsRequest represents a request type.
APIListMaintenanceWindowsRequest represents a request type.
APIListPagespeedMonitoringLocationsRequest represents a request type.
APIListPagespeedTestHistoryRequest represents a request type.
APIListPagespeedTestsRequest represents a request type.
APIListSslTestsRequest represents a request type.
APIListUptimeMonitoringLocationsRequest represents a request type.
APIListUptimeTestAlertsRequest represents a request type.
APIListUptimeTestHistoryRequest represents a request type.
APIListUptimeTestPeriodsRequest represents a request type.
APIListUptimeTestsRequest represents a request type.
APIResponse struct for APIResponse.
APIResponseData Response body.
APIUpdateContactGroupRequest represents a request type.
APIUpdateHeartbeatTestRequest represents a request type.
APIUpdateMaintenanceWindowRequest represents a request type.
APIUpdatePagespeedTestRequest represents a request type.
APIUpdateSslTestRequest represents a request type.
APIUpdateUptimeTestRequest represents a request type.
Client manages communication with the StatusCake API API v1.2.0 In most cases there should be only one, shared, Client.
ContactGroup struct for ContactGroup.
ContactGroupResponse struct for ContactGroupResponse.
ContactGroups struct for ContactGroups.
HeartbeatTest struct for HeartbeatTest.
HeartbeatTestOverview struct for HeartbeatTestOverview.
HeartbeatTestResponse struct for HeartbeatTestResponse.
HeartbeatTests struct for HeartbeatTests.
Links struct for Links.
MaintenanceWindow struct for MaintenanceWindow.
MaintenanceWindowResponse struct for MaintenanceWindowResponse.
MaintenanceWindows struct for MaintenanceWindows.
MonitoringLocation struct for MonitoringLocation.
MonitoringLocations struct for MonitoringLocations.
PagespeedTest struct for PagespeedTest.
PagespeedTestHistory struct for PagespeedTestHistory.
PagespeedTestHistoryResult struct for PagespeedTestHistoryResult.
PagespeedTestResponse struct for PagespeedTestResponse.
PagespeedTests struct for PagespeedTests.
PagespeedTestStats struct for PagespeedTestStats.
Pagination struct for Pagination.
ServerConfiguration stores the information about a server.
ServerVariable stores the information about a server variable.
SSLTest struct for SSLTest.
SSLTestFlags struct for SSLTestFlags.
SSLTestMixedContent struct for SSLTestMixedContent.
SSLTestResponse struct for SSLTestResponse.
SSLTests struct for SSLTests.
UptimeTest struct for UptimeTest.
UptimeTestAlert struct for UptimeTestAlert.
UptimeTestAlerts struct for UptimeTestAlerts.
UptimeTestHistory struct for UptimeTestHistory.
UptimeTestHistoryResult struct for UptimeTestHistoryResult.
UptimeTestOverview struct for UptimeTestOverview.
UptimeTestPeriod struct for UptimeTestPeriod.
UptimeTestPeriods struct for UptimeTestPeriods.
UptimeTestResponse struct for UptimeTestResponse.
UptimeTests struct for UptimeTests.

# Interfaces

ContactGroupsAPI describes the necessary methods to adhere to this interface.
HeartbeatAPI describes the necessary methods to adhere to this interface.
LocationsAPI describes the necessary methods to adhere to this interface.
MaintenanceWindowsAPI describes the necessary methods to adhere to this interface.
PagespeedAPI describes the necessary methods to adhere to this interface.
RequestCredentials describes a common interface for attaching security credentials to every outbound request.
SslAPI describes the necessary methods to adhere to this interface.
Strategy describes a common interface to satisfy a backoff strategy when a request fails.
UptimeAPI describes the necessary methods to adhere to this interface.

# Type aliases

ContactGroupsService ContactGroups service.
HeartbeatService Heartbeat service.
HeartbeatTestStatus The returned status of a heartbeat check.
LocationsService Locations service.
MaintenanceWindowRepeatInterval How often the maintenance window should occur.
MaintenanceWindowsService MaintenanceWindows service.
MaintenanceWindowState Maintenance window state.
MonitoringLocationStatus Server status.
Option consigures a HTTP client and connection.
PagespeedService Pagespeed service.
PagespeedTestCheckRate Number of seconds between checks.
PagespeedTestRegion Testing regions.
PagespeedTestThrottling Simulated throttling speed.
No description provided by the author
ServerConfigurations stores multiple ServerConfiguration items.
SslService Ssl service.
SSLTestCheckRate Number of seconds between checks.
UptimeService Uptime service.
UptimeTestCheckRate Number of seconds between checks.
UptimeTestProcessingState Uptime check proccessing state.
UptimeTestStatus The returned status of an uptime check.
UptimeTestType Uptime check type.