viewer

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMultipleInputs = errors.New("multiple input arguments provided")

ErrMultipleInputs is returned when more than one input is provided.

Functions

func Run

func Run(input InputSpec) error

Types

type InputKind

type InputKind string

InputKind identifies the source type for viewer content resolution.

const (
	InputStdin  InputKind = "stdin"
	InputFile   InputKind = "file"
	InputURL    InputKind = "url"
	InputGitHub InputKind = "github"
	InputGitLab InputKind = "gitlab"
)

type InputSpec

type InputSpec struct {
	Kind        InputKind
	Raw         string
	Candidates  []string
	SearchRoots []string
}

InputSpec carries the resolved input plus candidate URLs/paths to try.

func ParseViewerInput

func ParseViewerInput(args []string, reservedCommands map[string]struct{}) (InputSpec, bool, error)

ParseViewerInput resolves a single input to decide if viewer mode should run.

Jump to

Keyboard shortcuts

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