statuscake

package
v2.1.62 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StatusCakeApiResponseDataToBaseMonitorMapper added in v2.1.20

func StatusCakeApiResponseDataToBaseMonitorMapper(statuscakeData statuscake.UptimeTestResponse) *models.Monitor

StatusCakeApiResponseDataToBaseMonitorMapper function to map Statuscake Uptime Test Response to Monitor

func StatusCakeMonitorMonitorToBaseMonitorMapper

func StatusCakeMonitorMonitorToBaseMonitorMapper(statuscakeData StatusCakeMonitorData) *models.Monitor

StatusCakeMonitorMonitorToBaseMonitorMapper function to map Statuscake structure to Monitor

func StatusCakeMonitorMonitorsToBaseMonitorsMapper

func StatusCakeMonitorMonitorsToBaseMonitorsMapper(statuscakeData []StatusCakeMonitorData) []models.Monitor

StatusCakeMonitorMonitorsToBaseMonitorsMapper function to map Statuscake structure to Monitor

Types

type StatusCakeData added in v2.1.20

type StatusCakeData struct {
	statuscake.UptimeTest
}

TODO use statuscake managed structs, rather than managing own structs

type StatusCakeMonitor added in v2.1.20

type StatusCakeMonitor struct {
	StatusCakeData     []StatusCakeMonitorData   `json:"data"`
	StatusCakeMetadata StatusCakeMonitorMetadata `json:"metadata"`
}

type StatusCakeMonitorData added in v2.1.20

type StatusCakeMonitorData struct {
	TestID       string   `json:"id"`
	Paused       bool     `json:"paused"`
	WebsiteName  string   `json:"name"`
	WebsiteURL   string   `json:"website_url"`
	TestType     string   `json:"test_type"`
	CheckRate    int      `json:"check_rate"`
	ContactGroup []string `json:"contact_groups"`
	Status       string   `json:"status"`
	Tags         []string `json:"tags"`
	Uptime       float64  `json:"uptime"`
}

type StatusCakeMonitorMetadata added in v2.1.20

type StatusCakeMonitorMetadata struct {
	Page       int `json:"page"`
	PerPage    int `json:"per_page"`
	PageCount  int `json:"page_count"`
	TotalCount int `json:"total_count"`
}

type StatusCakeMonitorService

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

StatusCakeMonitorService is the service structure for StatusCake

func (*StatusCakeMonitorService) Add

func (service *StatusCakeMonitorService) Add(m models.Monitor)

Add will create a new Monitor

func (*StatusCakeMonitorService) Equal

func (monitor *StatusCakeMonitorService) Equal(oldMonitor models.Monitor, newMonitor models.Monitor) bool

func (*StatusCakeMonitorService) GetAll

func (service *StatusCakeMonitorService) GetAll() []models.Monitor

GetAll function will fetch all monitors

func (*StatusCakeMonitorService) GetByID added in v2.1.20

func (service *StatusCakeMonitorService) GetByID(id string) (*models.Monitor, error)

GetByID function will Get a monitor by it's ID

func (*StatusCakeMonitorService) GetByName

func (service *StatusCakeMonitorService) GetByName(name string) (*models.Monitor, error)

GetByName function will Get a monitor by it's name

func (*StatusCakeMonitorService) Remove

func (service *StatusCakeMonitorService) Remove(m models.Monitor)

Remove will delete an existing Monitor

func (*StatusCakeMonitorService) Setup

func (service *StatusCakeMonitorService) Setup(p config.Provider)

Setup function is used to initialise the StatusCake service

func (*StatusCakeMonitorService) Update

func (service *StatusCakeMonitorService) Update(m models.Monitor)

Update will update an existing Monitor

Jump to

Keyboard shortcuts

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