cli

package
v3.32.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0, Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package cli contains a FeatureBase command line interface.

Index

Constants

This section is empty.

Variables

View Source
var (
	Stdin  io.ReadCloser = os.Stdin
	Stdout io.Writer     = os.Stdout
	Stderr io.Writer     = os.Stderr
)

Functions

This section is empty.

Types

type CLICommand

type CLICommand struct {
	Host        string `json:"host"`
	Port        string `json:"port"`
	HistoryPath string `json:"history-path"`

	// Cloud Auth
	ClientID string `json:"client-id"`
	Region   string `json:"region"`
	Email    string `json:"email"`
	Password string `json:"password"`

	OrganizationID string `json:"org-id"`
	Database       string `json:"db"`

	Queryer Queryer `json:"-"`

	Stdin  io.ReadCloser `json:"-"`
	Stdout io.Writer     `json:"-"`
	Stderr io.Writer     `json:"-"`
	// contains filtered or unexported fields
}

func NewCLICommand

func NewCLICommand(logdest logger.Logger) *CLICommand

func (*CLICommand) Errorf added in v3.32.0

func (cmd *CLICommand) Errorf(format string, a ...any)

Errorf is a helper method which sends the given payload to stderr.

func (*CLICommand) Outputf added in v3.32.0

func (cmd *CLICommand) Outputf(format string, a ...any)

Outputf is a helper method which sends the given payload to output.

func (*CLICommand) Printf

func (cmd *CLICommand) Printf(format string, a ...any)

Printf is a helper method which sends the given payload to stdout.

func (*CLICommand) Run

func (cmd *CLICommand) Run(ctx context.Context) error

Run is the main entry-point to the CLI. Currently it handles the interaction with a user, as opposed to calling `featurebase cli` in a script.

type Queryer

type Queryer interface {
	Query(org string, db string, sql io.Reader) (*featurebase.WireQueryResponse, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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