dmsclient

package
v0.0.0-...-e6d1b10 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	ListAll() ([]Snitch, error)
	List(snitchToken string) (Snitch, error)
	Create(newSnitch Snitch) (Snitch, error)
	Delete(snitchToken string) (bool, error)
	FindSnitchesByName(snitchName string) ([]Snitch, error)
	Update(updateSnitch Snitch) (Snitch, error)
	CheckIn(s Snitch) error
}

Client is a wrapper interface for the dmsClient to allow for easier testing

func NewClient

func NewClient(authToken string, collector *localmetrics.MetricsCollector) Client

NewClient creates an API client

type Snitch

type Snitch struct {
	Name        string     `json:"name"`
	Token       string     `json:"token"`
	Href        string     `json:"href"`
	Tags        []string   `json:"tags"`
	Notes       string     `json:"notes"`
	Status      string     `json:"status"`
	CheckedInAt string     `json:"checked_in_at"`
	CheckInURL  string     `json:"check_in_url"`
	CreatedAt   string     `json:"created_at"`
	Interval    string     `json:"interval"`
	AlertType   string     `json:"alert_type"`
	AlertEmail  []string   `json:"alert_email"`
	Type        SnitchType `json:"type"`
}

Snitch Struct

func NewSnitch

func NewSnitch(name string, tags []string, interval string, alertType string) Snitch

NewSnitch creates a new Snitch only requiring a few items

type SnitchType

type SnitchType struct {
	Interval string `json:"interval"`
}

SnitchType Struct

Directories

Path Synopsis
Package mock_dmsclient is a generated GoMock package.
Package mock_dmsclient is a generated GoMock package.

Jump to

Keyboard shortcuts

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