grafana

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrOrganizationNotFound = errors.New("organization not found")

ErrOrganizationNotFound is returned when we couldn't find an organization with a given slug.

View Source
var ErrPrivateOrganization = errors.New("organization is private")

ErrPrivateOrganization is returned when an organization exists but hasn't published any plugins yet.

Functions

This section is empty.

Types

type Client

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

Client provides operations to the grafana.com API.

func NewClient

func NewClient() *Client

NewClient returns a new Client.

func (*Client) FindOrgBySlug

func (c *Client) FindOrgBySlug(slug string) (*Organization, error)

FindOrgBySlug returns the organization with a given slug.

func (*Client) FindPluginVersions

func (c *Client) FindPluginVersions(pluginID string) ([]PluginVersion, error)

FindPluginVersions returns all published versions for a given plugin ID.

func (*Client) ListPlugins

func (c *Client) ListPlugins() ([]*Plugin, error)
type Link struct {
	Rel  string `json:"rel"`
	Href string `json:"href"`
}

type Organization

type Organization struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	Slug string `json:"slug,omitempty"`
}

Organization maps to a Grafana.com organization.

type Plugin

type Plugin struct {
	ID      int64  `json:"id"`
	Name    string `json:"name"`
	Version string `json:"version"`
	Slug    string `json:"slug"`
	Links   []Link `json:"links"`
}

type PluginVersion

type PluginVersion struct {
	Version   string    `json:"version"`
	Commit    string    `json:"commit"`
	CreatedAt time.Time `json:"createdAt"`
	Downloads int       `json:"downloads"`
	URL       string    `json:"url"`
	Verified  bool      `json:"verified"`
}

PluginVersion contains information about a published plugin.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳