cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
	Commit  = "none"
	Date    = "unknown"
)

build-time vars (injected via -ldflags)

Functions

func Root

func Root() *cobra.Command

Root builds the root command tree.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App holds global state shared by every command.

func (*App) Client

func (a *App) Client() *bili.Client

Client lazily builds the bili client from resolved config.

type Format

type Format string

Format is an output encoding.

const (
	FormatAuto  Format = "auto"
	FormatTable Format = "table"
	FormatJSON  Format = "json"
	FormatJSONL Format = "jsonl"
	FormatCSV   Format = "csv"
	FormatTSV   Format = "tsv"
	FormatYAML  Format = "yaml"
	FormatURL   Format = "url"
	FormatRaw   Format = "raw"
)

type Output

type Output struct {
	// contains filtered or unexported fields
}

Output renders records in a chosen format. It streams where the format allows.

func NewOutput

func NewOutput(w io.Writer, format Format, fields []string, noHeader bool, tmpl string) (*Output, error)

NewOutput builds an Output. format "auto" should already be resolved by caller.

func (*Output) Close

func (o *Output) Close() error

Close flushes any buffered output.

func (*Output) Emit

func (o *Output) Emit(v any) error

Emit renders one record.

Jump to

Keyboard shortcuts

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