command

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SQL = iota
	Prometheus
)

Variables

View Source
var (
	GCSBackupProvider   = BackupProvider("gcs")
	LocalBackupProvider = BackupProvider("local")
)

Functions

This section is empty.

Types

type BackupCmd added in v0.0.3

type BackupCmd struct {
	Conf *BackupConfig

	*ffcli.Command
}

BackupCmd wraps the dashboardBackup config and a ffcli.Command

func NewBackupCmd added in v0.0.3

func NewBackupCmd(rootConf *RootConfig) *BackupCmd

NewBackupCmd creates a new BackupCmd

func (*BackupCmd) Exec added in v0.0.3

func (c *BackupCmd) Exec(ctx context.Context, args []string) error

Exec executes the dashboardBackup command

func (*BackupCmd) RegisterFlags added in v0.0.3

func (c *BackupCmd) RegisterFlags(fs *flag.FlagSet)

RegisterFlags registers a set of flags for the dashboardBackup command

type BackupConfig added in v0.0.3

type BackupConfig struct {
	*RootConfig

	Provider string
	Out      string
}

BackupConfig has the config for the dashboardBackup command and a reference to the root command config

type BackupProvider added in v0.0.3

type BackupProvider string

type Client

type Client struct {
	*grafsdk.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apiURL string, apiKey string, verbose bool) *Client

func (*Client) BackupGrafana added in v0.0.3

func (c *Client) BackupGrafana(ctx context.Context, provider BackupProvider, dest string) error

func (*Client) SyncDashboard

func (c *Client) SyncDashboard(ctx context.Context, uid string, queriesDir string) error

type DashboardCmd

type DashboardCmd struct {
	Conf *DashboardConfig

	*ffcli.Command
}

DashboardCmd wraps the dashboard config and a ffcli.Command

func NewDashboardCmd

func NewDashboardCmd(rootConf *RootConfig) *DashboardCmd

NewDashboardCmd creates a new DashboardCmd

func (*DashboardCmd) Exec

func (c *DashboardCmd) Exec(ctx context.Context, args []string) error

Exec executes the dashboard command

func (*DashboardCmd) RegisterFlags

func (c *DashboardCmd) RegisterFlags(fs *flag.FlagSet)

RegisterFlags registers a set of flags for the dashboard command

type DashboardConfig

type DashboardConfig struct {
	*RootConfig
}

DashboardConfig has the config for the dashboard command and a reference to the root command config

type DashboardInspectCmd added in v0.0.2

type DashboardInspectCmd struct {
	Conf *DashboardInspectConfig

	*ffcli.Command
}

DashboardInspectCmd wraps the dashboardInspect config and a ffcli.Command

func NewDashboardInspectCmd added in v0.0.2

func NewDashboardInspectCmd(dashConf *DashboardConfig) *DashboardInspectCmd

NewDashboardInspectCmd creates a new DashboardInspectCmd

func (*DashboardInspectCmd) Exec added in v0.0.2

func (c *DashboardInspectCmd) Exec(ctx context.Context, args []string) error

Exec executes the dashboard ls command

func (*DashboardInspectCmd) RegisterFlags added in v0.0.2

func (c *DashboardInspectCmd) RegisterFlags(fs *flag.FlagSet)

RegisterFlags registers a set of flags for the dashboardInspect command

type DashboardInspectConfig added in v0.0.2

type DashboardInspectConfig struct {
	*DashboardConfig

	UID string
}

DashboardInspectConfig has the config for the dashboardInspect command and a reference to the root command config

type DashboardLsCmd

type DashboardLsCmd struct {
	Conf *DashboardLsConfig

	*ffcli.Command
}

DashboardLsCmd wraps the dashboardLs config and a ffcli.Command

func NewDashboardLsCmd

func NewDashboardLsCmd(dashConf *DashboardConfig) *DashboardLsCmd

NewDashboardLsCmd creates a new DashboardLsCmd

func (*DashboardLsCmd) Exec

func (c *DashboardLsCmd) Exec(ctx context.Context, args []string) error

Exec executes the dashboard ls command

func (*DashboardLsCmd) RegisterFlags

func (c *DashboardLsCmd) RegisterFlags(fs *flag.FlagSet)

RegisterFlags registers a set of flags for the dashboardLs command

type DashboardLsConfig

type DashboardLsConfig struct {
	*DashboardConfig

	UID string
}

DashboardLsConfig has the config for the dashboardLs command and a reference to the root command config

type DashboardSyncCmd

type DashboardSyncCmd struct {
	Conf *DashboardSyncConfig

	*ffcli.Command
}

DashboardSyncCmd wraps the dashboardSync config and a ffcli.Command

func NewDashboardSyncCmd

func NewDashboardSyncCmd(dashConf *DashboardConfig) *DashboardSyncCmd

NewDashboardSyncCmd creates a new DashboardSyncCmd

func (*DashboardSyncCmd) Exec

func (c *DashboardSyncCmd) Exec(ctx context.Context, args []string) error

Exec executes the dashboard sync command

func (*DashboardSyncCmd) RegisterFlags

func (c *DashboardSyncCmd) RegisterFlags(fs *flag.FlagSet)

RegisterFlags registers a set of flags for the dashboardSync command

type DashboardSyncConfig

type DashboardSyncConfig struct {
	*DashboardConfig

	UID        string
	QueriesDir string
}

DashboardSyncConfig has the config for the dashboardSync command and a reference to the root command config

type GrafanaBackup added in v0.0.3

type GrafanaBackup struct {
	Datasources []*grafsdk.Datasource        `json:"datasources"`
	Folders     []*grafsdk.Folder            `json:"folders"`
	Dashboards  []*grafsdk.DashboardWithMeta `json:"dashboards"`
}

type ImportCmd added in v0.0.3

type ImportCmd struct {
	Conf *ImportConfig

	*ffcli.Command
}

ImportCmd wraps the dashboardImport config and a ffcli.Command

func NewImportCmd added in v0.0.3

func NewImportCmd(rootConf *RootConfig) *ImportCmd

NewImportCmd creates a new ImportCmd

func (*ImportCmd) Exec added in v0.0.3

func (c *ImportCmd) Exec(ctx context.Context, args []string) error

Exec executes the dashboardImport command

func (*ImportCmd) RegisterFlags added in v0.0.3

func (c *ImportCmd) RegisterFlags(fs *flag.FlagSet)

RegisterFlags registers a set of flags for the dashboardImport command

type ImportConfig added in v0.0.3

type ImportConfig struct {
	*RootConfig

	Src string
}

ImportConfig has the config for the dashboardImport command and a reference to the root command config

type Query added in v0.0.3

type Query struct {
	Name string
	Raw  string
	Type QueryType
}

type QueryManager added in v0.0.3

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

func NewQueryManager added in v0.0.3

func NewQueryManager(queryDir string) (*QueryManager, error)

func (QueryManager) Get added in v0.0.3

func (q QueryManager) Get(file string) *Query

func (QueryManager) Put added in v0.0.3

func (q QueryManager) Put(file string) error

func (QueryManager) SupportedQueryFile added in v0.0.3

func (q QueryManager) SupportedQueryFile(file string) bool

type QueryType added in v0.0.3

type QueryType int

type RootCmd

type RootCmd struct {
	Conf *RootConfig

	*ffcli.Command
}

RootCmd wraps the config and a ffcli.Command

func NewRootCmd

func NewRootCmd(opts ...RootConfigOption) *RootCmd

NewRootCmd creates a new RootCmd

func (*RootCmd) Exec

func (c *RootCmd) Exec(ctx context.Context, args []string) error

Exec executes the root command

func (*RootCmd) RegisterFlags

func (c *RootCmd) RegisterFlags(fs *flag.FlagSet)

RegisterFlags registers a set of flags for the root command

type RootConfig

type RootConfig struct {
	APIURL  string
	APIKey  string
	Verbose bool
}

RootConfig has the config for the root command

func (*RootConfig) Client

func (c *RootConfig) Client() *Client

type RootConfigOption

type RootConfigOption = func(c *RootConfig)

RootConfigOption defines the signature for functional options to be applied to the root command

Jump to

Keyboard shortcuts

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