config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// root
	Verbosity int

	// init
	Databases       []string
	Conn            string
	SourcesDatabase string
	Engine          string
	Indexes         []string

	// search
	Query        string
	OutputFormat string
	Columns      []string

	// import
	FilesOrFolders []string
	LineParser     string
	Database       string
	Compress       bool
	BatchSize      int
	FilePrefix     string
}

Config contains the configuration options for DumpDB

func (*Config) SetBatchSize

func (c *Config) SetBatchSize(size int) error

SetBatchSize sets the number of records that are imported to the database together

func (*Config) SetColumns

func (c *Config) SetColumns(cols []string) error

SetColumns sets the columns to output when searching

func (*Config) SetCompress

func (c *Config) SetCompress(compress bool) error

SetCompress sets whether or not to compress the database after importing

func (*Config) SetConn

func (c *Config) SetConn(s string) error

SetConn sets the database connection string, in the format `user:pass@tcp(127.0.0.1:3306)`

func (*Config) SetDatabase

func (c *Config) SetDatabase(s string) error

SetDatabase sets the 'main' database name, SetConn must be called first

func (*Config) SetDatabases

func (c *Config) SetDatabases(dbs []string) error

SetDatabases sets the databases to use, SetConn must be called first

func (*Config) SetEngine

func (c *Config) SetEngine(e string) error

SetEngine sets the database storage engine

func (*Config) SetFilePrefix

func (c *Config) SetFilePrefix(prefix string) error

SetFilePrefix sets the number of records that are imported to the database together

func (*Config) SetFilesOrFolders

func (c *Config) SetFilesOrFolders(paths []string) error

SetFilesOrFolders sets the files or folders to import

func (*Config) SetIndexes

func (c *Config) SetIndexes(indexes []string) error

SetIndexes sets the 'main' table indexes

func (*Config) SetLineParser

func (c *Config) SetLineParser(p string) error

SetLineParser sets the function to parse lines when importing

func (*Config) SetOutputFormat

func (c *Config) SetOutputFormat(o string) error

SetOutputFormat sets the search output format

func (*Config) SetQuery

func (c *Config) SetQuery(q string) error

SetQuery sets the WHERE ... clause of the SQL query

func (*Config) SetSourcesDatabase

func (c *Config) SetSourcesDatabase(s string) error

SetSourcesDatabase sets the sources database name, SetConn must be called first

func (*Config) SetVerbosity

func (c *Config) SetVerbosity(v int) error

SetVerbosity sets the Config verbosity

Jump to

Keyboard shortcuts

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