Documentation
¶
Index ¶
- Constants
- type AuthenticationResponse
- type Channel
- type ChannelAttachment
- type ChannelService
- func (s *ChannelService) Attach(channel string, check string) error
- func (s *ChannelService) Create(c Channel) (Channel, error)
- func (s *ChannelService) Delete(ident string) error
- func (s *ChannelService) Detach(channel string, check string) error
- func (s *ChannelService) List() ([]Channel, error)
- func (s *ChannelService) Read(ident string) (Channel, error)
- func (s *ChannelService) Update(ident string, c Channel) error
- type Check
- type CheckService
- type Client
- type ClientConfig
Constants ¶
View Source
const BaseURL = "https://api.binocs.sh"
View Source
const UserAgent = "BinocsClientGo"
View Source
const Version = "v0.1.3"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticationResponse ¶
type AuthenticationResponse struct {
AccessToken string `json:"access_token"`
}
type Channel ¶ added in v0.1.1
type Channel struct { ID int `json:"id,omitempty"` Ident string `json:"ident,omitempty"` Type string `json:"type,omitempty"` Alias string `json:"alias"` Handle string `json:"handle,omitempty"` UsedCount int `json:"used_count,omitempty"` LastUsed string `json:"last_used,omitempty"` Verified string `json:"verified,omitempty"` Checks []string `json:"checks,omitempty"` }
type ChannelAttachment ¶ added in v0.1.1
type ChannelAttachment struct {
NotificationType string `json:"notification_type"`
}
type ChannelService ¶
type ChannelService struct {
// contains filtered or unexported fields
}
func (*ChannelService) Attach ¶ added in v0.1.1
func (s *ChannelService) Attach(channel string, check string) error
func (*ChannelService) Create ¶ added in v0.1.1
func (s *ChannelService) Create(c Channel) (Channel, error)
func (*ChannelService) Delete ¶ added in v0.1.1
func (s *ChannelService) Delete(ident string) error
func (*ChannelService) Detach ¶ added in v0.1.1
func (s *ChannelService) Detach(channel string, check string) error
func (*ChannelService) List ¶ added in v0.1.1
func (s *ChannelService) List() ([]Channel, error)
type Check ¶
type Check struct { ID int `json:"id,omitempty"` Ident string `json:"ident,omitempty"` Name string `json:"name"` Protocol string `json:"protocol,omitempty"` Resource string `json:"resource,omitempty"` Method string `json:"method,omitempty"` Interval int `json:"interval,omitempty"` Target float64 `json:"target,omitempty"` Regions []string `json:"regions,omitempty"` UpCodes string `json:"up_codes,omitempty"` UpConfirmationsThreshold int `json:"up_confirmations_threshold,omitempty"` UpConfirmations int `json:"up_confirmations,omitempty"` DownConfirmationsThreshold int `json:"down_confirmations_threshold,omitempty"` DownConfirmations int `json:"down_confirmations,omitempty"` LastStatus int `json:"last_status,omitempty"` LastStatusCode string `json:"last_status_code,omitempty"` LastStatusDuration string `json:"last_status_duration,omitempty"` Created string `json:"created,omitempty"` Updated string `json:"updated,omitempty"` Channels []string `json:"channels,omitempty"` }
type CheckService ¶
type CheckService struct {
// contains filtered or unexported fields
}
func (*CheckService) Delete ¶
func (s *CheckService) Delete(ident string) error
func (*CheckService) List ¶
func (s *CheckService) List() ([]Check, error)
type Client ¶
type Client struct { Checks CheckService Channels ChannelService }
func New ¶
func New(config ClientConfig) (*Client, error)
type ClientConfig ¶
Click to show internal directories.
Click to hide internal directories.