dmsclient

package
v0.0.0-...-a6dd3e1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DmsApiUrl = "https://api.deadmanssnitch.com/v1/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// RequestCount has to be the first words
	// in order to be 64-aligned on 32-bit architectures.
	RequestCount   uint64
	RequestRetries int
	// contains filtered or unexported fields
}

func NewClient

func NewClient(token string) *Client

func (*Client) GetRequestCount

func (c *Client) GetRequestCount() float64

func (*Client) Init

func (c *Client) Init()

func (*Client) ListSnitches

func (c *Client) ListSnitches() (list ResponseSnitchList, error error)

func (*Client) SetAccessToken

func (c *Client) SetAccessToken(token string)

func (*Client) SetRetries

func (c *Client) SetRetries(v int)

func (*Client) SetUserAgent

func (c *Client) SetUserAgent(v string)

type ResponseSnitch

type ResponseSnitch struct {
	Token       string        `json:"token"`
	Href        string        `json:"href"`
	Name        string        `json:"name"`
	Tags        []string      `json:"tags"`
	Notes       string        `json:"notes,omitempty"`
	Status      string        `json:"status"`
	CheckedInAt *time.Time    `json:"checked_in_at"`
	CreatedAt   time.Time     `json:"created_at"`
	Interval    string        `json:"interval"`
	AlertType   string        `json:"alert_type"`
	AlertEmail  []interface{} `json:"alert_email"`
}

func (*ResponseSnitch) IsHealthy

func (s *ResponseSnitch) IsHealthy() bool

type ResponseSnitchList

type ResponseSnitchList []ResponseSnitch

Jump to

Keyboard shortcuts

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