cycloidio / raws

[UNMAINTAINED] AWS Reader
MIT License
15 stars 0 forks source link

Billing: create a first draft of all components #6

Closed xlr-8 closed 7 years ago

xlr-8 commented 7 years ago

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

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-3.6%) to 76.777% when pulling 588678ae9f166ea7fe5c8a4ab330e8938082c5fd on billing into f5d0e9618138ae410620fecd238379c7786168c1 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-3.6%) to 76.777% when pulling d05d682fd3600abe0908a39f0323d04388dc5497 on billing into f5d0e9618138ae410620fecd238379c7786168c1 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-3.6%) to 76.777% when pulling b059a98d17f8cc7ddbcaa9d76a14c0dbdbbb7efa on billing into f5d0e9618138ae410620fecd238379c7786168c1 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-3.6%) to 76.777% when pulling f9a39a3295296e364b5f844f72564112d49a2164 on billing into f5d0e9618138ae410620fecd238379c7786168c1 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-3.6%) to 76.777% when pulling 96887f19e2bfdd2bb8320b259ddd19f1cdb00da4 on billing into f5d0e9618138ae410620fecd238379c7786168c1 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-3.6%) to 76.777% when pulling 96887f19e2bfdd2bb8320b259ddd19f1cdb00da4 on billing into f5d0e9618138ae410620fecd238379c7786168c1 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-3.6%) to 76.777% when pulling e33b4571ec9232d52b59ee28d34b4ff73f516372 on billing into f5d0e9618138ae410620fecd238379c7786168c1 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-3.6%) to 76.777% when pulling ecf50c5791382a32643b7d96c9499530c9ee9b88 on billing into f5d0e9618138ae410620fecd238379c7786168c1 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-3.6%) to 76.777% when pulling fa1e212b474e3e59272da08719af582f543c8d55 on billing into f5d0e9618138ae410620fecd238379c7786168c1 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-3.6%) to 76.777% when pulling fa1e212b474e3e59272da08719af582f543c8d55 on billing into f5d0e9618138ae410620fecd238379c7786168c1 on master.

xlr-8 commented 7 years ago

Different points were discussed on this:

xlr-8 commented 7 years ago

Would that do to write a proper README and create an issue for the documentation part? (As it will not remain on this repository)

xlr-8 commented 7 years ago

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"
xescugc commented 7 years ago

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:

xlr-8 commented 7 years ago

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!

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-3.6%) to 76.777% when pulling 4774e54f3227106ff0d2d12c1e96bad2f3dc00ac on billing into f5d0e9618138ae410620fecd238379c7786168c1 on master.

xescugc commented 7 years ago

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.

xlr-8 commented 7 years ago

Project & Issues relative to this PR have been opened here: https://github.com/cycloidio/aws-billing, closing this one.