console

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 26 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 console is a terminal client for the same API used by the web UI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PickTarget

func PickTarget(in io.Reader, out io.Writer, targets []TargetOption) (int64, error)

PickTarget presents a searchable, keyboard-driven target picker. Callers should resolve an explicit name or ID before invoking this for scripts.

func RunDashboard

func RunDashboard(c *Client, in io.Reader, out io.Writer, attach func(string, string) error) error

RunDashboard uses a full-screen renderer that owns raw mode, resizing and the suspend/restore boundary around native tmux/SSH. The line client remains useful for pipes and accessibility via console --plain.

Types

type Client

type Client struct {
	Base, Token string
	HTTP        *http.Client
}

func New

func New(base, token string) *Client

func (*Client) Download

func (c *Client) Download(path, destination string) error

Download streams arbitrary binary files without the JSON response size limit. Existing local files are preserved, including when the transfer fails.

func (*Client) JSON

func (c *Client) JSON(method, path string, body any) ([]byte, error)

func (*Client) Request

func (c *Client) Request(method, path string, body io.Reader, contentType string) ([]byte, error)

func (*Client) Upload

func (c *Client) Upload(kind, id, path string) ([]byte, error)

type HTTPError

type HTTPError struct {
	Status int
	Detail string
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

type TargetOption

type TargetOption struct {
	ID   int64
	Name string
	Kind string
}

TargetOption is the small, display-oriented target shape used by the command-line target picker.

type UI

type UI struct {
	Client *Client
	In     *bufio.Reader
	Out    io.Writer
	Attach func(string, string) error
}

func NewUI

func NewUI(c *Client, in io.Reader, out io.Writer, attach func(string, string) error) *UI

func (*UI) Run

func (u *UI) Run() error

Jump to

Keyboard shortcuts

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