Documentation ¶
Index ¶
- func SaveRack(configuration *Configuration, rack Rack) error
- func SaveShelf(configuration *Configuration, shelf Shelf) error
- func SaveWarehouse(configuration *Configuration, warehouse Warehouse) error
- func WriteShelf(warehouse Warehouse, shelf Shelf, box Box) error
- type Box
- type Configuration
- type Rack
- type Shelf
- type Warehouse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveRack ¶ added in v0.3.0
func SaveRack(configuration *Configuration, rack Rack) error
SaveRack writes the current Rack's data to the config file. If a Rack with the same label already exists, it will overwrite that entry.
func SaveShelf ¶ added in v0.3.0
func SaveShelf(configuration *Configuration, shelf Shelf) error
SaveShelf writes the current Schema's data to the config file.
func SaveWarehouse ¶ added in v0.3.0
func SaveWarehouse(configuration *Configuration, warehouse Warehouse) error
SaveWarehouse writes the Warehouse metadata to the config file. If a schema with the same ID already exists, it will overwrite that entry.
Types ¶
type Box ¶
type Box struct { Label string Flag string Headers []utils.Header Data *[][]interface{} TableCreationQuery string InsertionQueries []string }
Box represents all the pieces of a digested data set needed for writing to a database.
type Configuration ¶
type Configuration struct { Path string `yaml:"path"` Warehouses []Warehouse `yaml:"warehouses"` Racks []Rack `yaml:"racks"` Shelves []Shelf `yaml:"shelves"` }
Configuration is a structure that represents a Syllogi config.
func NewConfiguration ¶ added in v0.2.4
func NewConfiguration(path *string) (*Configuration, error)
NewConfiguration checks the filesystem for a valid configuration file, creates it if there isn't one, and loads that configuration into memory.
Takes a reference to a string representing a desired path, which is in a sense optional. If nil is passed in place of that path, it will default to ~/.syllogi. This amendment was added to support custom use and testing.
func (*Configuration) Read ¶
func (configuration *Configuration) Read() error
func (*Configuration) Write ¶
func (configuration *Configuration) Write() error
type Rack ¶
type Rack struct { Warehouse string `yaml:"warehouse"` ID string `yaml:"id"` Label string `yaml:"label"` }
Rack represents a schema metadata abstraction.
func GetRack ¶ added in v0.3.0
func GetRack(configuration *Configuration, label string) *Rack
GetRack reads the Rack data from the config file by the given label and loads it into the current instance.
type Shelf ¶
type Shelf struct { Rack string `yaml:"rack"` ID string `yaml:"id"` Label string `yaml:"label"` Date string `yaml:"date"` }
Shelf represents a table metadata abstraction.
func GetShelf ¶ added in v0.3.0
func GetShelf(configuration *Configuration, label string) *Shelf
GetShelf reads the Shelf data from the config file by the given label and loads it into the current instance.
type Warehouse ¶
Warehouse abstracts a database entity.
func GetWarehouse ¶ added in v0.3.0
func GetWarehouse(configuration *Configuration, name string) *Warehouse
GetWarehouse reads the Warehouse metadata from the config file by the given name and loads it into the current instance.
func NewWarehouse ¶ added in v0.2.4
func NewWarehouse(configuration *Configuration, name string, url string) (*Warehouse, error)
NewWarehouse creates a new Warehouse instance from the given parameters and writes it to the configuration file.