mondash

package
v2.2.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2020 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents an accessor to the MonDash API

func New

func New(boardID, token string) *Client

New creates a new Client pre-filled with board-ID and token

func (*Client) DeleteDashboard

func (c *Client) DeleteDashboard() error

DeleteDashboard will delete all your monitoring results available on your dashboard and release the dashboard URL to the public

func (*Client) DeleteMetric

func (c *Client) DeleteMetric(input *DeleteMetricInput) error

DeleteMetric deletes a metric from your dashboard

func (*Client) PostMetric

func (c *Client) PostMetric(input *PostMetricInput) error

PostMetric submits a new monitoring result

func (*Client) WithContext

func (c *Client) WithContext(ctx context.Context) *Client

WithContext craetes a copy of the Client using the passed context instead of context.Background()

func (*Client) WithHost

func (c *Client) WithHost(host string) *Client

WithHost creates a copy of the Client with replaced hostname for own instances

type DeleteMetricInput

type DeleteMetricInput struct {
	// The unique name for your metric Example: `beer_available`.
	MetricID string
}

DeleteMetricInput contains parameters for the API request

type PostMetricInput

type PostMetricInput struct {
	// The unique name for your metric Example: `beer_available`.
	MetricID string `json:"-"`

	// The title of the metric to display on the dashboard
	Title string `json:"title"`

	// A descriptive text for the current state of the metric
	Description string `json:"description"`

	// An URL with further information of the status
	DetailURL string `json:"detail_url"`

	// One of: OK, Warning, Critical, Unknown
	Status Status `json:"status"`

	// The metric value to store with the status
	Value float64 `json:"value"`

	// Time in seconds when to remove the metric if there is no update (Valid: `0 < x < 604800`)
	// Default: `604800`
	Expires int64 `json:"expires,omitempty"`

	// Time in seconds when to switch to stale state of there is no update (Valid: `0 < x < 604800`)
	// Default: 3600
	Freshness int64 `json:"freshness,omitempty"`

	// If set to true the status passed in the update will be used instead of the median absolute deviation
	// Default: false
	IgnoreMAD bool `json:"ignore_mad,omitempty"`

	// If set to true the median absolute deviation is hidden on the dashboard for this metric
	// Default: false
	HideMAD bool `json:"hide_mad,omitempty"`

	// If set to true the value of the metric is not shown on the dashboard
	// Default: false
	HideValue bool `json:"hide_value,omitempty"`

	// If set this status will be set when the metric gets stale (no updates within freshness time range
	// Default: "Unknown"
	StalenessStatus string `json:"staleness_status,omitifempty"`
}

PostMetricInput contains parameters for the API request

type Status

type Status string

Status type represents a collection of available status strings

const (
	StatusOK       Status = "OK"
	StatusWarning  Status = "Warning"
	StatusCritical Status = "Critical"
	StatusUnknown  Status = "Unknown"
)

Collection of available status strings

Jump to

Keyboard shortcuts

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