cli

package
v1.0.0-cli.0...-421df98 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: AGPL-3.0 Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ColorReset  = "\033[0m"
	ColorRed    = "\033[31m"
	ColorGreen  = "\033[32m"
	ColorYellow = "\033[33m"
	ColorCyan   = "\033[36m"
)

Functions

func Find

func Find[T any](s []*T, filter func(i *T) bool) *T

func Prompt

func Prompt(label string) bool

func ReadYAMLFile

func ReadYAMLFile[T any](path string) (T, error)

func RequireAccessToken

func RequireAccessToken(
	ctx context.Context,
	cliCtx Context,
	fn func(context.Context, Context) *cobra.Command,
) *cobra.Command

func Section

func Section() table.Table

Section is a table with no column headers. the main purpose of this is to align values when printing, so they are on the same level. here's an example: what we don't want:

ID: 0198fb5f-e59e-7794-87f9-e34bd32a0e1b
Name: TestChunk
Description: this is a description
Tags: tag1,tag2

what we want:

ID:            0198fb5f-e59e-7794-87f9-e34bd32a0e1b
Name:          TestChunk
Description:   this is a description
Tags:          tag1,tag2

func WriteYAMLFile

func WriteYAMLFile[T any](content T, path string) error

Types

type Context

type Context struct {
	Logger         *slog.Logger
	Config         state.Config
	State          state.Data
	Client         chunkv1alpha1.ChunkServiceClient
	InstanceClient instancev1alpha1.InstanceServiceClient
	UserClient     userv1alpha1.UserServiceClient
	Auth           auth.Service
}

Jump to

Keyboard shortcuts

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