Documentation
¶
Overview ¶
Package cli contains a FeatureBase command line interface.
Index ¶
- Constants
- Variables
- func NewErrOrganizationRequired() error
- type CloudAuthConfig
- type Command
- func (cmd *Command) Errorf(format string, a ...any)
- func (cmd *Command) Insert(sql string) error
- func (cmd *Command) Outputf(format string, a ...any)
- func (cmd *Command) Printf(format string, a ...any)
- func (cmd *Command) Run(ctx context.Context) error
- func (cmd *Command) SetStderr(w io.Writer)
- func (cmd *Command) SetStdin(rc io.ReadCloser)
- func (cmd *Command) SetStdout(w io.Writer)
- type Config
- type Queryer
Constants ¶
View Source
const (
ErrOrganizationRequired errors.Code = "OrganizationRequired"
)
Variables ¶
Functions ¶
func NewErrOrganizationRequired ¶ added in v3.34.0
func NewErrOrganizationRequired() error
Types ¶
type CloudAuthConfig ¶ added in v3.33.0
type Command ¶ added in v3.33.0
type Command struct {
Queryer Queryer `json:"-"`
Config *Config `json:"config"`
// Commands contains optional commands provided via one or more `-c` (or
// `--command`) flags. If this is non-empty, the cli will run in
// non-interactive mode; i.e. it will quit after the command is complete.
Commands []string `json:"commands"`
// Files contains optional files provided via one or more `-f` (or `--file`)
// flags. If this is non-empty, the cli will run in non-interactive mode;
// i.e. it will quit after the command is complete.
Files []string `json:"files"`
// contains filtered or unexported fields
}
func NewCommand ¶ added in v3.33.0
func (*Command) Errorf ¶ added in v3.33.0
Errorf is a helper method which sends the given payload to stderr.
func (*Command) Outputf ¶ added in v3.33.0
Outputf is a helper method which sends the given payload to output.
func (*Command) Printf ¶ added in v3.33.0
Printf is a helper method which sends the given payload to stdout.
func (*Command) SetStderr ¶ added in v3.34.0
SetStderr sets stderr. This is useful for initial configuration in tests.
func (*Command) SetStdin ¶ added in v3.34.0
func (cmd *Command) SetStdin(rc io.ReadCloser)
SetStdin sets stdin. This is useful for initial configuration in tests.
type Config ¶ added in v3.33.0
type Config struct {
Host string `json:"host"`
Port string `json:"port"`
OrganizationID string `json:"org-id"`
Database string `json:"db"`
// CloudAuth
CloudAuth CloudAuthConfig `json:"cloud-auth"`
// Kafka
KafkaConfig string `json:"kafka-config"`
HistoryPath string `json:"history-path"`
// CSV (Comma-Separated Values) table output mode.
CSV bool `json:"csv"`
// PSet takes one or more pset arguments of the form: `--pset=VAR[=ARG]`.
PSets []string `json:"pset"`
}
Config represents the configuration for the command.
type Queryer ¶
type Queryer interface {
Query(org string, db string, sql io.Reader) (*featurebase.WireQueryResponse, error)
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.