grafana

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 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 Annotation

type Annotation struct {
	ID          int      `json:"id"`
	AlertID     int      `json:"alertId"`
	DashboardID int      `json:"dashboardId"`
	PanelID     int      `json:"panelId"`
	UserID      int      `json:"userId"`
	UserName    string   `json:"userName"`
	NewState    string   `json:"newState"`
	PrevState   string   `json:"prevState"`
	Time        int64    `json:"time"`
	TimeEnd     int64    `json:"timeEnd"`
	Text        string   `json:"text"`
	Metric      string   `json:"metric"`
	Type        string   `json:"type"`
	Tags        []string `json:"tags"`
	Data        struct{} `json:"data"`
}

type Annotations

type Annotations []Annotation

type Client

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

func New

func New(baseURL string, token string) (*Client, error)

func (*Client) CreateAnnotation

func (c *Client) CreateAnnotation(req CreateAnnotationRequest) error

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

func (*Client) FindAnnotation

func (c *Client) FindAnnotation(req FindAnnotationRequest) (*Annotation, error)

func (*Client) UpdateAnnotation

func (c *Client) UpdateAnnotation(req UpdateAnnotationRequest) error

type CreateAnnotationRequest

type CreateAnnotationRequest struct {
	Time    int64    `json:"time"`
	TimeEnd int64    `json:"timeEnd"`
	Tags    []string `json:"tags"`
	Text    string   `json:"text"`
}

type FindAnnotationRequest

type FindAnnotationRequest struct {
	From  int64    `url:"from"`
	To    int64    `url:"to"`
	Tags  []string `url:"tags"`
	Limit int      `url:"limit"`
}

type UpdateAnnotationRequest

type UpdateAnnotationRequest struct {
	ID      int
	Time    int64    `json:"time"`
	TimeEnd int64    `json:"timeEnd"`
	Tags    []string `json:"tags"`
	Text    string   `json:"text"`
}

Jump to

Keyboard shortcuts

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