Documentation ¶
Overview ¶
Package datastore contains configuration options, and functions to create a books' database before running the server.
Index ¶
Constants ¶
const Columns = 10
Columns is number of dataset's columns.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a new datastore to be used by the server. The datastore is created at the path specified by config (Dir + Name). overwriteIfExists specifies what to do if a datastore with the same path exists. The datastore is created using dataset at the specified path. Dataset should be a csv file with the following columns (id, title, authors, averageRating, isbn, isbn13, languageCode, pages, ratingsCount, textReviewsCount) in this order. The dataset is processed line by line and corrupt lines (wrong data types, incorrect number of columns, extra commas, etc..) are skipped (and logged). See https://www.kaggle.com/jealousleopard/goodreadsbooks