betterstack

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderAuthorization = "Authorization"
	HeaderAccept        = "Accept"
	HeaderContentType   = "Content-Type"
	HeaderUserAgent     = "User-Agent"
	MediaTypeJSON       = "application/json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config Config) Client

func (Client) ListMonitors

func (c Client) ListMonitors() ([]Monitor, error)

type Config

type Config struct {
	APIToken string
	PageSize int
}

type Monitor

type Monitor struct {
	ID                string
	URL               string
	PronounceableName string
	Status            string
}

type MonitorListResponse

type MonitorListResponse struct {
	Data []struct {
		ID         string `json:"id"`
		Attributes *struct {
			URL               string `json:"url"`
			PronounceableName string `json:"pronounceable_name"`
			Status            string `json:"status"`
		} `json:"attributes"`
	} `json:"data"`
	Pagination *struct {
		First string `json:"first"`
		Last  string `json:"last"`
		Prev  string `json:"prev"`
		Next  string `json:"next"`
	} `json:"pagination"`
}

Maps the relevant subset of fields from the 'list monitors' API

Jump to

Keyboard shortcuts

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