Documentation
¶
Index ¶
- type Client
- func (c *Client) Create(check Healthcheck) (*HealthcheckResponse, error)
- func (c *Client) Delete(id string) (*HealthcheckResponse, error)
- func (c *Client) GetAll() ([]*HealthcheckResponse, error)
- func (c *Client) GetAllChannels() ([]*HealthcheckChannelResponse, error)
- func (c *Client) Pause(id string) (*HealthcheckResponse, error)
- func (c *Client) Update(id string, check Healthcheck) (*HealthcheckResponse, error)
- type Healthcheck
- type HealthcheckChannelResponse
- type HealthcheckResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client provides access to create, read, update and delete healthchecks.io resources
func (*Client) Create ¶
func (c *Client) Create(check Healthcheck) (*HealthcheckResponse, error)
Create creates a new healthcheck
func (*Client) Delete ¶
func (c *Client) Delete(id string) (*HealthcheckResponse, error)
Delete deletes an existing healthcheck
func (*Client) GetAll ¶
func (c *Client) GetAll() ([]*HealthcheckResponse, error)
GetAll returns all healthchecks
func (*Client) GetAllChannels ¶
func (c *Client) GetAllChannels() ([]*HealthcheckChannelResponse, error)
GetAllChannels returns all channels
func (*Client) Pause ¶
func (c *Client) Pause(id string) (*HealthcheckResponse, error)
Pause pauses monitoring on existing healthcheck
func (*Client) Update ¶
func (c *Client) Update(id string, check Healthcheck) (*HealthcheckResponse, error)
Update updates an existing healthcheck
type Healthcheck ¶
type Healthcheck struct {
Channels string `json:"channels,omitempty"`
Grace int `json:"grace,omitempty"`
Name string `json:"name,omitempty"`
Schedule string `json:"schedule,omitempty"`
Tags string `json:"tags,omitempty"`
Timeout int `json:"timeout,omitempty"`
Timezone string `json:"tz,omitempty"`
Unique []string `json:"unique,omitempty"`
Description string `json:"desc,omitempty"`
Methods string `json:"methods,omniempty"`
}
Healthcheck represents a healthcheck
func (*Healthcheck) ToJSON ¶
func (hc *Healthcheck) ToJSON() (string, error)
ToJSON returns a json representation of a healthcheck data
type HealthcheckChannelResponse ¶
type HealthcheckChannelResponse struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Kind string `json:"kind,omitempty"`
}
HealthcheckChannelResponse represents a channel response of healthcheck api
func (*HealthcheckChannelResponse) String ¶
func (hc *HealthcheckChannelResponse) String() string
func (*HealthcheckChannelResponse) ToJSON ¶
func (hc *HealthcheckChannelResponse) ToJSON() (string, error)
ToJSON returns a json representation of a healthcheck channel
type HealthcheckResponse ¶
type HealthcheckResponse struct {
Channels string `json:"channels,omitempty"`
Grace int `json:"grace,omitempty"`
LastPing string `json:"last_ping,omitempty"`
Name string `json:"name,omitempty"`
NextPing string `json:"next_ping,omitempty"`
PauseURL string `json:"pause_url,omitempty"`
Pings int `json:"n_pings,omitempty"`
PingURL string `json:"ping_url,omitempty"`
Schedule string `json:"schedule,omitempty"`
Status string `json:"status,omitempty"`
Tags string `json:"tags,omitempty"`
Timeout int `json:"timeout,omitempty"`
Timezone string `json:"tz,omitempty"`
UpdateURL string `json:"update_url,omitempty"`
Description string `json:"desc,omitempty"`
Methods string `json:"methods,omniempty"`
}
HealthcheckResponse represents a healthcheck api response
func (*HealthcheckResponse) ID ¶
func (hc *HealthcheckResponse) ID() string
ID returns the identifier of a healthcheck
func (*HealthcheckResponse) String ¶
func (hc *HealthcheckResponse) String() string
func (*HealthcheckResponse) ToJSON ¶
func (hc *HealthcheckResponse) ToJSON() (string, error)
ToJSON returns a json representation of a healthcheck