Closed xlr-8 closed 7 years ago
Different points were discussed on this:
Would that do to write a proper README and create an issue for the documentation part? (As it will not remain on this repository)
Also another idea was to split the interfaces from the code into different package such as 'package X' and 'package XIface', a bit like AWS is doing with:
"github.com/aws/aws-sdk-go/service/dynamodb/"
"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface"
I've reviwed the code and sems correct except some syntax that I don't like, I did not mention it on the code because I think thik it'll be usefull for you to look at them, run a linter to the code and you'll see them, basically are:
var a string = ""
or var a int = 0
As mentioned the documentation would be open as an issue, for the rest many lint errors have been fixed in the last commit - not all of them though - please read the git commit message for more information. Thanks for the review!
Some have not been modified such as some else+return or variable namin- such as the ones containing 'Id' because that is dependant of the CSV file provided by AWS.
Why not the else+return? and the namig of the CSV does not depend on the AWS, you read the data and set it no? you can name it whatever you want hehe but ok.
Project & Issues relative to this PR have been opened here: https://github.com/cycloidio/aws-billing, closing this one.
Currently the backend used is DynamoDB, but it shouldn't be too difficult to replace it in the future, the logic would remain the same.
Checker: The checker is responsible for checking the hash of the S3 file and the value in the dynamoDB. If those values are identical then no import is needed.
Downloader: The downloader is responsible for downloading and unzipping the billing file is the different given paths.
Loader: The loader reads the unzipped file and loads its data into a go struct, in order to be consumed progressively via the 'injector'.
Injector: The injector create the differents entries in dynamoDB for both the report (in order to store the hash) and for the records (all fields are being injected into the database), some extra one are also given such as: a UUID or the name of the report the record comes from.
Manager: The manager is the one calling the different component, it simply takes the 2 AWS accounts (S3 & DynamoDB) as parameters, as well as the 'date' and the 'bucket' it is supposed to import the data from.
Should close: https://github.com/cycloidio/raws/issues/5