repo

package
v0.0.1-test Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchMeta

type ArchMeta struct {
	SHA256 string `json:"sha256"`
}

type Client

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

type CompatOpts

type CompatOpts struct {
	GrafanaVersion string
	OS             string
	Arch           string
}

func NewCompatOpts

func NewCompatOpts(grafanaVersion, os, arch string) CompatOpts

func (CompatOpts) OSAndArch

func (co CompatOpts) OSAndArch() string

func (CompatOpts) String

func (co CompatOpts) String() string

type ErrVersionNotFound

type ErrVersionNotFound struct {
	PluginID         string
	RequestedVersion string
	SystemInfo       string
}

func (ErrVersionNotFound) Error

func (e ErrVersionNotFound) Error() string

type ErrVersionUnsupported

type ErrVersionUnsupported struct {
	PluginID         string
	RequestedVersion string
	SystemInfo       string
}

func (ErrVersionUnsupported) Error

func (e ErrVersionUnsupported) Error() string

type Manager

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

func New

func New(skipTLSVerify bool, baseURL string, logger logger.Logger) *Manager

func ProvideService

func ProvideService() *Manager

func (*Manager) GetPluginArchive

func (m *Manager) GetPluginArchive(ctx context.Context, pluginID, version string, compatOpts CompatOpts) (*PluginArchive, error)

GetPluginArchive fetches the requested plugin archive

func (*Manager) GetPluginArchiveByURL

func (m *Manager) GetPluginArchiveByURL(ctx context.Context, pluginZipURL string, compatOpts CompatOpts) (*PluginArchive, error)

GetPluginArchiveByURL fetches the requested plugin archive from the provided `pluginZipURL`

func (*Manager) GetPluginDownloadOptions

func (m *Manager) GetPluginDownloadOptions(_ context.Context, pluginID, version string, compatOpts CompatOpts) (*PluginDownloadOptions, error)

GetPluginDownloadOptions returns the options for downloading the requested plugin (with optional `version`)

type Plugin

type Plugin struct {
	ID       string    `json:"id"`
	Category string    `json:"category"`
	Versions []Version `json:"versions"`
}

type PluginArchive

type PluginArchive struct {
	File *zip.ReadCloser
}

type PluginDownloadOptions

type PluginDownloadOptions struct {
	PluginZipURL string
	Version      string
	Checksum     string
}

type PluginRepo

type PluginRepo struct {
	Plugins []Plugin `json:"plugins"`
	Version string   `json:"version"`
}

type Response4xxError

type Response4xxError struct {
	Message    string
	StatusCode int
	SystemInfo string
}

func (Response4xxError) Error

func (e Response4xxError) Error() string

type Service

type Service interface {
	// GetPluginArchive fetches the requested plugin archive.
	GetPluginArchive(ctx context.Context, pluginID, version string, opts CompatOpts) (*PluginArchive, error)
	// GetPluginArchiveByURL fetches the requested plugin from the specified URL.
	GetPluginArchiveByURL(ctx context.Context, archiveURL string, opts CompatOpts) (*PluginArchive, error)
	// GetPluginDownloadOptions fetches information for downloading the requested plugin.
	GetPluginDownloadOptions(ctx context.Context, pluginID, version string, opts CompatOpts) (*PluginDownloadOptions, error)
}

Service is responsible for retrieving plugin information from a repository.

type Version

type Version struct {
	Commit  string              `json:"commit"`
	URL     string              `json:"repoURL"`
	Version string              `json:"version"`
	Arch    map[string]ArchMeta `json:"arch"`
}

Jump to

Keyboard shortcuts

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