binocs

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

README

binocs-client-go

Go Reference

Go client for Binocs

Documentation

Index

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)

func (*ChannelService) Read added in v0.1.1

func (s *ChannelService) Read(ident string) (Channel, error)

func (*ChannelService) Update added in v0.1.1

func (s *ChannelService) Update(ident string, c 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) Create

func (s *CheckService) Create(c Check) (Check, error)

func (*CheckService) Delete

func (s *CheckService) Delete(ident string) error

func (*CheckService) List

func (s *CheckService) List() ([]Check, error)

func (*CheckService) Read

func (s *CheckService) Read(ident string) (Check, error)

func (*CheckService) Update

func (s *CheckService) Update(ident string, c Check) error

type Client

type Client struct {
	Checks   CheckService
	Channels ChannelService
}

func New

func New(config ClientConfig) (*Client, error)

type ClientConfig

type ClientConfig struct {
	AccessKey string
	SecretKey string
}

Jump to

Keyboard shortcuts

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