dmsclient

package
v0.0.0-...-be237b4 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

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) 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"`
}

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

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