Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultConfigFileName = ".klepto.toml"
)
Config-related defaults
Variables ¶
This section is empty.
Functions ¶
func WriteSample ¶ added in v0.2.0
WriteSample generates and writes sample config to a writer
Types ¶
type Filter ¶
type Filter struct { // Match is a condition field to dump only certain amount data. Match string // Limit defines a limit of results to be fetched. Limit uint64 // Sorts is the sort condition for the table. Sorts map[string]string }
Filter represents the way you want to filter the results.
type Matchers ¶ added in v0.0.8
Matchers are variables to store filter data, you can declare a filter once and reuse it among tables.
type Relationship ¶
type Relationship struct { // Table is the table name. Table string // ForeignKey is the table name foreign key. ForeignKey string // ReferencedTable is the referenced table name. ReferencedTable string // ReferencedKey is the referenced table primary key name. ReferencedKey string }
Relationship represents the relationship between the table and referenced table.
type Table ¶
type Table struct { // Name is the table name. Name string // IgnoreData if set to true, it will dump the table structure without importing data. IgnoreData bool // Filter represents the way you want to filter the results. Filter Filter // Anonymise anonymises columns. Anonymise map[string]string // Relationship is an collection of relationship definitions. Relationships []*Relationship }
Table represents a klepto table definition.
type Tables ¶
type Tables []*Table
Tables are an array of table definitions.
func LoadFromFile ¶ added in v0.2.0
LoadFromFile loads klepto tables config from file
func (Tables) FindByName ¶
FindByName find a table by its name.
Click to show internal directories.
Click to hide internal directories.