cli

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 22 Imported by: 0 modules, 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

Overview

Package cli holds the dekka commands.

Index

Constants

View Source
const (
	// DefaultAPIURL is the public Dekka API. Every route lives under /v1.
	DefaultAPIURL = "https://api.dekka.cloud"
	// DashboardURL is where API keys are created.
	DashboardURL = "https://dekka.cloud/app"
)

Variables

This section is empty.

Functions

func Main

func Main(version string) int

Main runs the CLI against the process's own terminal and environment.

Types

type APIError

type APIError struct {
	Status    int
	Code      string
	Message   string
	RequestID string
	// Hint is what to do next, when the CLI knows.
	Hint string
}

APIError is an error the API answered with.

func (*APIError) Error

func (e *APIError) Error() string

type App

type App struct {
	In     io.Reader
	Out    io.Writer
	Err    io.Writer
	Getenv func(string) string
	Store  credentials.Store

	// StdinIsTerminal reports whether In is an interactive terminal.
	StdinIsTerminal func() bool
	// ReadSecret reads a line from the terminal without echoing it.
	ReadSecret func() (string, error)
	// OpenBrowser opens a link in the person's browser. It is nil where there
	// is no browser to open, and dekka login then prints the link.
	OpenBrowser func(url string) error
	// Hostname names this machine on the page that approves a sign-in.
	Hostname func() (string, error)

	Version    string
	HTTPClient *http.Client
	// PollInterval, when set, replaces the wait between runtime log polls and
	// between stream reconnects.
	PollInterval time.Duration
	// contains filtered or unexported fields
}

App carries what the commands read and write, so tests can replace it.

func (*App) Root

func (a *App) Root() *cobra.Command

Root builds the command tree.

func (*App) Run

func (a *App) Run(ctx context.Context, args []string) int

Run executes one command line and returns the process exit code.

Jump to

Keyboard shortcuts

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