Documentation
¶
Index ¶
- Variables
- type Account
- type AccountDetailsResponse
- type Client
- func (c Client) CreateMonitor(ctx context.Context, monitor Monitor, contacts MonitorContacts) (string, error)
- func (c Client) DeleteMonitor(ctx context.Context, id string) error
- func (c Client) Do(ctx context.Context, endpoint string, form url.Values) (*http.Response, error)
- func (c Client) EditMonitor(ctx context.Context, id string, monitor Monitor, contacts MonitorContacts) (string, error)
- func (c Client) FindContactID(ctx context.Context, friendlyName string) (string, error)
- func (c Client) FindMonitorID(ctx context.Context, opts ...FindOpt) (string, error)
- func (c Client) GetAccountDetails(ctx context.Context) (string, error)
- func (c Client) MonitorValues(monitor Monitor, form url.Values, contacts MonitorContacts) url.Values
- func (c Client) NewRequest(ctx context.Context, endpoint string, form url.Values) (*http.Request, error)
- func (c Client) NewValues() url.Values
- type Contact
- type FindContactResponse
- type FindMonitorResponse
- type FindOpt
- type Monitor
- type MonitorAuth
- type MonitorContact
- type MonitorContactCommon
- type MonitorContacts
- type MonitorKeyword
- type MonitorPort
- type Response
- type ResponseContact
- type ResponseMonitor
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrStatus = errors.New("error code from Uptime Robot API") ErrResponse = errors.New("received fail from Uptime Robot API") )
View Source
var ErrContactNotFound = errors.New("contact not found")
View Source
var ErrMonitorNotFound = errors.New("monitor not found")
Functions ¶
This section is empty.
Types ¶
type AccountDetailsResponse ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) CreateMonitor ¶
func (Client) EditMonitor ¶
func (Client) FindContactID ¶
func (Client) FindMonitorID ¶
func (Client) GetAccountDetails ¶
func (Client) MonitorValues ¶
func (Client) NewRequest ¶
type Contact ¶
type Contact struct {
// FriendlyName sets the name that is shown in Uptime Robot.
FriendlyName string `json:"friendlyName"`
}
type FindContactResponse ¶
type FindContactResponse struct {
Status urtypes.Status `json:"stat"`
Contacts []ResponseContact `json:"alert_contacts"`
}
type FindMonitorResponse ¶
type FindMonitorResponse struct {
Status urtypes.Status `json:"stat"`
Monitors []ResponseMonitor `json:"monitors"`
}
type FindOpt ¶
func FindBySearch ¶
type Monitor ¶
type Monitor struct {
// FriendlyName sets the name that is shown in Uptime Robot.
FriendlyName string `json:"friendlyName"`
// URL is the URL or IP to monitor, including the scheme.
URL string `json:"url"`
// Type chooses the monitor type.
//+kubebuilder:default:=HTTPS
Type urtypes.MonitorType `json:"type,omitempty"`
// Interval is the monitoring interval.
//+kubebuilder:default:="60s"
Interval metav1.Duration `json:"interval,omitempty"`
// Status toggles pause status for the monitor. 0 is paused, 1 is running.
//+kubebuilder:default:=1
Status uint8 `json:"status,omitempty"`
// Timeout is the monitor timeout.
//+kubebuilder:default:="30s"
Timeout metav1.Duration `json:"timeout,omitempty"`
// HTTPMethod defines the HTTP verb to use.
//+kubebuilder:default:="HEAD"
HTTPMethod urtypes.HTTPMethod `json:"httpMethod,omitempty"`
// Keyword provides configuration for the Keyword monitor type.
Keyword *MonitorKeyword `json:"keyword,omitempty"`
// Port provides configuration for the Port monitor type.
Port *MonitorPort `json:"port,omitempty"`
// Auth enables monitor auth.
Auth *MonitorAuth `json:"auth,omitempty"`
}
func (*Monitor) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Monitor.
func (*Monitor) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MonitorAuth ¶
type MonitorAuth struct {
//+kubebuilder:default:="Basic"
Type urtypes.MonitorAuthType `json:"type"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
SecretName string `json:"secretName,omitempty"`
UsernameKey string `json:"usernameKey,omitempty"`
PasswordKey string `json:"passwordKey,omitempty"`
}
type MonitorContact ¶
type MonitorContact struct {
ID string `json:"id"`
MonitorContactCommon `json:",inline"`
}
func (MonitorContact) String ¶
func (m MonitorContact) String() string
type MonitorContactCommon ¶
type MonitorContactCommon struct {
// Threshold defines the number of minutes to wait to notify.
// +kubebuilder:default:="1m"
Threshold metav1.Duration `json:"threshold,omitempty"`
// Recurrence defines the number of minutes between a repeat notification.
// A value of 0, disables repeat notifications.
Recurrence metav1.Duration `json:"recurrence,omitempty"`
}
type MonitorContacts ¶
type MonitorContacts []MonitorContact
func (MonitorContacts) String ¶
func (m MonitorContacts) String() string
type MonitorKeyword ¶
type MonitorKeyword struct {
Type urtypes.KeywordType `json:"type"`
//+kubebuilder:default:=false
CaseSensitive bool `json:"caseSensitive,omitempty"`
Value string `json:"value"`
}
type MonitorPort ¶
type Response ¶
type Response struct {
Status urtypes.Status `json:"stat"`
Monitor ResponseMonitor `json:"monitor"`
}
type ResponseContact ¶
type ResponseMonitor ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.