cliutil

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAborted = errors.New("aborted by user")
View Source
var ErrNoEditor = fmt.Errorf("no available editor; please set the EDITOR environment variable and try again")

Functions

func AddSubcommands

func AddSubcommands(cmd *cobra.Command, subcommands ...*cobra.Command)

func BasePostRunE

func BasePostRunE(p *cobra.Command, args []string) error

func BasePreRunE

func BasePreRunE(cmd *cobra.Command, args []string) error

func EditInteractive

func EditInteractive[T proto.Message](spec T, comments ...string) (T, error)

func JoinKeyValuePairs

func JoinKeyValuePairs(pairs map[string]string) []string

func LoadConfigObjectsOrDie

func LoadConfigObjectsOrDie(
	configLocation string,
	lg *slog.Logger,
) meta.ObjectList

func LoadFromFile

func LoadFromFile[T proto.Message](spec T, path string) error

func ParseKeyValuePairs

func ParseKeyValuePairs(pairs []string) (map[string]string, error)

Parses strings of the form "key=value" into a map[string]string.

func RenderAccessMatrix

func RenderAccessMatrix(am AccessMatrix) string

func RenderBootstrapToken

func RenderBootstrapToken(token *corev1.BootstrapToken) string

func RenderBootstrapTokenList

func RenderBootstrapTokenList(list *corev1.BootstrapTokenList) string

func RenderCapabilityList

func RenderCapabilityList(list *managementv1.CapabilityList) string

func RenderCertInfoChain

func RenderCertInfoChain(chain []*corev1.CertInfo) string

func RenderClusterDetails

func RenderClusterDetails(cluster *corev1.Cluster) string

func RenderClusterList

func RenderClusterList(list *corev1.ClusterList, status []*corev1.HealthStatus) string

func RenderClusterListWithStats

func RenderClusterListWithStats(list *corev1.ClusterList, status []*corev1.HealthStatus, stats *cortexadmin.UserIDStatsList) string

func RenderCortexClusterStatus

func RenderCortexClusterStatus(status *cortexadmin.CortexStatus) string

func RenderCortexRules

func RenderCortexRules(resp *cortexadmin.ListRulesResponse) string

func RenderDefaultNodeConfig

func RenderDefaultNodeConfig(defaultConfig *node.MetricsCapabilitySpec) string

func RenderDiscoveryEntries

func RenderDiscoveryEntries(entries []*remoteread.DiscoveryEntry) string

func RenderMetricSamples

func RenderMetricSamples(samples []*model.Sample) string

func RenderMetricsNodeConfigs

func RenderMetricsNodeConfigs(nodes []MetricsNodeConfigInfo, defaultConfig *node.MetricsCapabilitySpec) string

func RenderRole

func RenderRole(role *corev1.Role) string

func RenderRoleBinding

func RenderRoleBinding(binding *corev1.RoleBinding) string

func RenderRoleBindingList

func RenderRoleBindingList(list *corev1.RoleBindingList) string

func RenderRoleList

func RenderRoleList(list *corev1.RoleList) string

func RenderTargetList

func RenderTargetList(list *remoteread.TargetList) string

Types

type AccessMatrix

type AccessMatrix struct {
	// List of users (in the order they will appear in the table)
	Users []string
	// Set of known clusters (rules referencing nonexistent clusters are marked)
	KnownClusters map[string]struct{}
	// Map of tenant IDs to a set of users that have access to the tenant
	ClustersToUsers map[string]map[string]struct{}
}

type MetricsNodeConfigInfo

type MetricsNodeConfigInfo struct {
	Id            string
	HasCapability bool
	Spec          *node.MetricsCapabilitySpec
	IsDefault     bool
}

Jump to

Keyboard shortcuts

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