commands

package
v11.1.4-modfix Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: AGPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAdminUserId = 1
View Source
const DefaultCommitValue = "NA"

Variables

View Source
var Commands = []*cli.Command{
	{
		Name:        "plugins",
		Usage:       "Manage plugins for grafana",
		Subcommands: pluginCommands,
	},
	{
		Name:        "admin",
		Usage:       "Grafana admin commands",
		Subcommands: adminCommands,
	},
}
View Source
var ErrMustBeAdmin = fmt.Errorf("reset-admin-password can only be used to reset an admin user account")

Functions

func CLICommand

func CLICommand(version string) *cli.Command

CLICommand is the entrypoint for the grafana-cli command. It returns the exit code for the grafana-cli program.

Types

type ConflictResolver

type ConflictResolver struct {
	Store *sqlstore.SQLStore

	Config          *setting.Cfg
	Users           ConflictingUsers
	ValidUsers      ConflictingUsers
	Blocks          map[string]ConflictingUsers
	DiscardedBlocks map[string]bool
	// contains filtered or unexported fields
}

func (*ConflictResolver) BuildConflictBlocks

func (r *ConflictResolver) BuildConflictBlocks(users ConflictingUsers, f Formatter)

BuildConflictBlocks builds blocks of users where each block is a unique email/login NOTE: currently this function assumes that the users are in order of grouping already

func (*ConflictResolver) MergeConflictingUsers

func (r *ConflictResolver) MergeConflictingUsers(ctx context.Context) error

func (*ConflictResolver) ToStringPresentation

func (r *ConflictResolver) ToStringPresentation() string

only present one conflict per user go through each conflict email/login if any has ids that have already been seen discard that conflict make note to the user to run again after fixing these conflicts

type ConflictingUser

type ConflictingUser struct {
	// direction is the +/- which indicates if we should keep or delete the user
	Direction     string `xorm:"direction"`
	ID            string `xorm:"id"`
	Email         string `xorm:"email"`
	Login         string `xorm:"login"`
	LastSeenAt    string `xorm:"last_seen_at"`
	AuthModule    string `xorm:"auth_module"`
	ConflictEmail string `xorm:"conflict_email"`
	ConflictLogin string `xorm:"conflict_login"`
}

func (*ConflictingUser) Marshal

func (c *ConflictingUser) Marshal(filerow string) error

type ConflictingUsers

type ConflictingUsers []ConflictingUser

func GetUsersWithConflictingEmailsOrLogins

func GetUsersWithConflictingEmailsOrLogins(ctx *cli.Context, s *sqlstore.SQLStore) (ConflictingUsers, error)

type Formatter

type Formatter func(format string, a ...any) string

Formatter make it possible for us to write to terminal and to a file with different formats depending on the usecase

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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