OKay so a lot of commits, but most should not be hard to review/were already reviewed in the previous PR:
commit 1:
Move the parser logic to pga/parser.go
Rename the parser methods
Move the formatting logic to pga/format.go
Add float handling
commit 2
Remove all of the dataset specific logic
Create Repository interface: used to store and access data from rows of the CSV, as well as go back to CSV representation
Create Filter type: no more FilterIndex bs, just a function takin a Repository and returning a boolean.
Create Dataset interface: used to read header of the CSV, and apply given function on each row. Incorporates most of the logic from the old Index, but will allow handling of dataset specificity via it's methods, and CSV specificity via it's attribute (e.g. legacy handling)
Create Datasets slice storing know datasets
Create header errors
commit 3
All the logic from pga.go specific to the siva dataset is contained here.
Types for the interfaces: SivaRepository, SivaDataset with appropriate function
Helper SivaRepositoryFromCSV used only in the ForEach method. I kept it separated because it's prettier this way.
commit 4
Repository is an interface now, nothing new from the old PR
commit 5
Dataset args handling, nothing new from the old PR
commit 6
Move the setupContext function to cmd/context.go, because it is used in both list and get command, but was in the cmd/get.go file for I guess legacy reasons.
commit 7
Add datasetName to getIndex, nothing new from the old PR
commit 8
Add .index to indexName, fix typo, remove unused flag, nothing new from the old PR
commit 9
Update the list command, basically just using the new interfaces.
commit 10
Update the get command, basically just using the new interfaces.
OKay so a lot of commits, but most should not be hard to review/were already reviewed in the previous PR:
commit 1:
pga/parser.go
pga/format.go
commit 2
Repository
interface: used to store and access data from rows of the CSV, as well as go back to CSV representationFilter
type: no moreFilterIndex
bs, just a function takin aRepository
and returning a boolean.Dataset
interface: used to read header of the CSV, and apply given function on each row. Incorporates most of the logic from the old Index, but will allow handling of dataset specificity via it's methods, and CSV specificity via it's attribute (e.g. legacy handling)Datasets
slice storing know datasetscommit 3
pga.go
specific to thesiva
dataset is contained here.SivaRepository
,SivaDataset
with appropriate functionSivaRepositoryFromCSV
used only in theForEach
method. I kept it separated because it's prettier this way.commit 4
commit 5
commit 6
setupContext
function tocmd/context.go
, because it is used in bothlist
andget
command, but was in thecmd/get.go
file for I guess legacy reasons.commit 7
datasetName
togetIndex
, nothing new from the old PRcommit 8
.index
toindexName
, fix typo, remove unused flag, nothing new from the old PRcommit 9
list
command, basically just using the new interfaces.commit 10
get
command, basically just using the new interfaces.commit 11
siva
commandelse
beforereturn
commit 12
commit 13
chegaa/pb
for less dependencies and LoC