core

package
v0.0.0-...-6d74526 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2017 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfigFile

func LoadConfigFile(cfg *Config, path string) error

LoadConfigFile loads configurations at `cfg.Section` section into `cfg` from `path`. If `path` is empty, `$HOME/.athenai/config` is used.

Types

type Athenai

type Athenai struct {
	// contains filtered or unexported fields
}

Athenai is a main struct to run this app.

func New

func New(client athenaiface.AthenaAPI, cfg *Config, out io.Writer) *Athenai

New creates a new Athena.

func (*Athenai) RunQuery

func (a *Athenai) RunQuery(queries ...string)

RunQuery runs the given queries. It splits each statement by semicolons and run them concurrently. It skips empty statements.

func (*Athenai) RunREPL

func (a *Athenai) RunREPL() error

RunREPL runs REPL mode (interactive mode).

func (*Athenai) ShowResults

func (a *Athenai) ShowResults()

ShowResults shows results of completed query executions.

func (*Athenai) WithStderr

func (a *Athenai) WithStderr(stderr io.Writer) *Athenai

WithStderr sets stderr to a.

func (*Athenai) WithWaitInterval

func (a *Athenai) WithWaitInterval(interval time.Duration) *Athenai

WithWaitInterval sets wait interval to a.

type Config

type Config struct {
	Debug      bool   `ini:"debug"`
	Silent     bool   `ini:"silent"`
	Output     string `ini:"output"`
	Section    string `ini:"-"`
	Profile    string `ini:"profile"`
	Region     string `ini:"region"`
	Database   string `ini:"database"`
	Location   string `ini:"location"`
	Encrypt    string `ini:"encrypt"`
	KMS        string `ini:"kms"`
	Format     string `ini:"format"`
	Count      uint   `ini:"count"`
	Concurrent uint   `ini:"concurrent"`
	// contains filtered or unexported fields
}

Config is a configuration information.

func (*Config) QueryConfig

func (c *Config) QueryConfig() *exec.QueryConfig

QueryConfig creates an exec.QueryConfig struct based on c.

type Either

type Either struct {
	Left  interface{}
	Right error
}

Either represents a value of one of two possible types (a disjoint union).

type SectionError

type SectionError struct {
	Path    string
	Section string
	Cause   error // Do not implement Cause() for pkg/errors
}

SectionError represents an error about section in config file.

func (*SectionError) Error

func (se *SectionError) Error() string

Jump to

Keyboard shortcuts

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