framework

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 4 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           int64         `json:"id"`
	AlertID      int64         `json:"alertId"`
	DashboardID  int64         `json:"dashboardId"`
	DashboardUID string        `json:"dashboardUID"`
	PanelID      int64         `json:"panelId"`
	PrevState    string        `json:"prevState"`
	NewState     string        `json:"newState"`
	Text         string        `json:"text"`
	Time         time.Time     `json:"time"`
	TimeEnd      time.Time     `json:"timeEnd"`
	Created      time.Time     `json:"created"`
	Updated      time.Time     `json:"updated"`
	Tags         []interface{} `json:"tags"`
	Data         interface{}   `json:"data"`
}

type AnnotationsQueryParams

type AnnotationsQueryParams struct {
	Limit        *int
	AlertID      *int
	DashboardID  *int
	DashboardUID *string
	Type         *string
	From         *time.Time
	To           *time.Time
}

type Client

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

func NewGrafanaClient

func NewGrafanaClient(url, apiKey string) *Client

NewGrafanaClient initializes a new Grafana client with the specified URL and API key.

func (*Client) GetAnnotations

func (c *Client) GetAnnotations(params AnnotationsQueryParams) ([]Annotation, *resty.Response, error)

GetAnnotations retrieves a list of annotations based on specified query parameters.

func (*Client) PostAnnotation

func (c *Client) PostAnnotation(annotation PostAnnotation) (PostAnnotationResponse, *resty.Response, error)

PostAnnotation sends a new annotation to a specified dashboard.

type PostAnnotation

type PostAnnotation struct {
	DashboardID  *int
	PanelID      *int
	DashboardUID string
	Time         *time.Time
	TimeEnd      *time.Time
	Tags         []string
	Text         string
}

type PostAnnotationResponse

type PostAnnotationResponse struct {
	Message string `json:"message"`
	ID      int64  `json:"id"`
}

Jump to

Keyboard shortcuts

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