grafana

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package grafana implements Grafana client

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoTeamIDs = errors.New("Grafana Teams IDs not set")
)

Custom errors.

Functions

This section is empty.

Types

type Grafana

type Grafana struct {
	URL    *url.URL
	Client *http.Client
	// contains filtered or unexported fields
}

Grafana implements Grafana client.

func New added in v0.2.0

func New(webURL string, config config_util.HTTPClientConfig, logger log.Logger) (*Grafana, error)

New return a new instance of Grafana struct.

func (*Grafana) Available

func (g *Grafana) Available() bool

Available returns true if Grafana is available.

func (*Grafana) Ping

func (g *Grafana) Ping() error

Ping attempts to ping Grafana.

func (*Grafana) String

func (g *Grafana) String() string

String receiver for Grafana struct.

func (*Grafana) TeamMembers

func (g *Grafana) TeamMembers(ctx context.Context, teamsIDs []string) ([]string, error)

TeamMembers fetches team members from a given slice of Grafana teams IDs.

type GrafanaTeamsReponse

type GrafanaTeamsReponse struct {
	OrgID      int      `json:"orgId"`
	TeamID     int      `json:"teamId"`
	TeamUID    string   `json:"teamUID"`
	UserID     int      `json:"userId"`
	AuthModule string   `json:"auth_module"`
	Email      string   `json:"email"`
	Name       string   `json:"name"`
	Login      string   `json:"login"`
	AvatarURL  string   `json:"avatarUrl"`
	Labels     []string `json:"labels"`
	Permission int      `json:"permission"`
}

GrafanaTeamsReponse is the API response struct from Grafana.

Jump to

Keyboard shortcuts

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