kernel

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = log.New(os.Stderr).WithColor().WithDebug()

Logger our global logger

Functions

func RegisterImporter

func RegisterImporter(driverName string, driver Importer) error

RegisterImporter registers the given importer into the global imports registry

Types

type Config

type Config struct {
	DataDir      string   `hcl:"data_dir"`
	Tables       []*Table `hcl:"table,block"`
	Debug        bool     `hcl:"debug"`
	WorkersCount int      `hcl:"workers_count"`
}

func LoadConfigFromFile

func LoadConfigFromFile(filename string) (*Config, error)

type Env

type Env struct {
	Config *Config
	Tables map[string]*Table
	DBConn *sqlx.DB
}

type Importer

type Importer interface {
	Open(dsn string) error
	Import(loader string) (<-chan map[string]interface{}, <-chan error, <-chan bool)
}

Importer is a contract for all drivers that imports data into xyr internal storage

func OpenImporter

func OpenImporter(driverName, dsn string) (Importer, error)

OpenImporter opens the specified importer via its dsn

type Table

type Table struct {
	Name         string   `hcl:"name,label"`
	ImporterName string   `hcl:"driver"`
	DSN          string   `hcl:"source"`
	Filter       string   `hcl:"filter"`
	Columns      []string `hcl:"columns"`

	ImporterInstance Importer
}

Table represents a single internal storage table

Jump to

Keyboard shortcuts

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