dictionary

package
v0.0.0-...-3615eb4 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(dict *Dictionary) (http.HandlerFunc, error)

Handler make an HTTP handler

func RegisterSources

func RegisterSources(list []Source) (err error)

RegisterSources ...

Types

type Dictionary

type Dictionary struct {
	Source      string   `yaml:"source"`
	Table       string   `yaml:"table"`
	Columns     []string `yaml:"columns"`
	Where       string   `yaml:"where"`
	UpdateField string   `yaml:"update_field"`
}

type Format

type Format interface {
	Write(values []interface{}) error
	Flush()
}

Format output

func FormatFactory

func FormatFactory(format string, columns []string, w io.Writer) Format

FormatFactory ...

type JSONEachRow

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

JSONEachRow output

func (JSONEachRow) Flush

func (JSONEachRow) Flush()

Flush ...

func (*JSONEachRow) Write

func (json *JSONEachRow) Write(values []interface{}) error

Write row to the output

type Source

type Source struct {
	Source          string        `yaml:"source"`
	DSN             string        `yaml:"dsn"`
	Name            string        `yaml:"name"`
	MaxOpenConns    int           `yaml:"max_open_conns"`
	MaxIdleConns    int           `yaml:"max_idle_conns"`
	ConnMaxLifetime time.Duration `yaml:"conn_max_lifetime"`
}

Source is a credentials for the source database

type TabSeparated

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

TabSeparated output

func (*TabSeparated) Flush

func (tab *TabSeparated) Flush()

Flush writes

func (*TabSeparated) Write

func (tab *TabSeparated) Write(values []interface{}) error

Write row to the output

Jump to

Keyboard shortcuts

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