config

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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

type Matchers map[string]string

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 Spec

type Spec struct {
	Matchers
	Tables
}

Spec represents the global app configuration.

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
	// Anonymise anonymise 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 (Tables) FindByName

func (t Tables) FindByName(name string) (*Table, error)

FindByName find a table by its name.

Jump to

Keyboard shortcuts

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