driver

package
v0.0.0-...-0629660 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package driver provides an external entry point to the vyx driver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Vyx

func Vyx(o *Options) error

Vyx ...

Types

type Options

type Options struct {
	Writer Writer
	UI     UI
}

Options groups all the optional plugins into vyx.

type UI

type UI interface {
	// ReadLine returns a line of text (a command) read from the user.
	// prompt is printed before reading the command.
	ReadLine(prompt string) (string, error)

	// Print shows a message to the user.
	// It formats the text as fmt.Print would and
	// adds a final \n if not already present.
	// For line-based UI, Print writes to STDERR.
	Print(...any)

	// PrintErr shows a message to the user.
	// It formats the text as fmt.Print would and
	// adds a final \n if not already present.
	// For line-based UI, Print writes to STDERR.
	PrintErr(...any)
}

A UI manages user interactions.

type Writer

type Writer interface {
	Open(name string) (io.WriteCloser, error)
}

Writer provides a mechanism to write data under a certain name, typically a file name.

Jump to

Keyboard shortcuts

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