wizard

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package wizard is the rclone-style first-run dialog: pick a backend, get authenticated, write the config. It runs on `webtor config init` and automatically when a command needs configuration, stdin is a TTY, and no config exists yet.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeviceLogin

func DeviceLogin(ctx context.Context, w IO, baseURL string) (string, error)

DeviceLogin runs the device authorization flow and returns the key.

func Run

func Run(ctx context.Context, w IO) error

Run drives the dialog and writes the resulting configuration as the context named "default".

func WebUIAuth

func WebUIAuth(ctx context.Context, w IO, baseURL string) (string, error)

WebUIAuth is the exported entry used by `webtor auth login` on an existing webui context.

Types

type IO

type IO struct {
	In  io.Reader
	Out io.Writer
	// OpenBrowser opens a URL in the person's browser; nil for the default.
	OpenBrowser func(url string) error
}

IO bundles the wizard's streams so tests can script it.

Jump to

Keyboard shortcuts

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