As @tredman and I discussed in #38, this PR fixes the issue with pcap_converter outputting the older JSON-based format that the current go-based 'flashback' command did not recognise.
I also planned on adding any missing operations to the parser (it only parsed queries and commands), but I hit a wall with tmc/mongoproto missing functions for opDelete and opUpdate, so I'll come back with a 2nd PR to add deletes and updates. I was able to add 'insert' operations, however.
Summary of changes:
Parsing output file to bson (instead of JSON).
Working operations: query, command (count and findandmodify) and inserts (new).
Output file written from inside program instead of to STDOUT (which was corrupting the BSON). Maybe this can support STDOUT later.
Go structs to maintain bson ordering.
"-debug" flag added.
Updated README.md to mention what's unsupported.
Updated README.md 'tcpdump' command to be TCP-only.
Lastly, I'm a golang noob who would love any pointers on my code. Fire away any suggestions!
Alright @tredman, I'm now using flashback.Op (with added 'omitempty' hints for anything except the required: "ts", "ns" and "op" fields) and plain funcs. I'm much happier with this now :)
As @tredman and I discussed in #38, this PR fixes the issue with pcap_converter outputting the older JSON-based format that the current go-based 'flashback' command did not recognise.
I also planned on adding any missing operations to the parser (it only parsed queries and commands), but I hit a wall with tmc/mongoproto missing functions for opDelete and opUpdate, so I'll come back with a 2nd PR to add deletes and updates. I was able to add 'insert' operations, however.
Summary of changes:
Lastly, I'm a golang noob who would love any pointers on my code. Fire away any suggestions!