Commit Graph

23 Commits

Author SHA1 Message Date
Thomas Bennett 38718dc289 fixed broken structs 2016-05-16 16:40:29 -07:00
Thomas Bennett f7ac04ea6a fixed string conversion to Itoa 2016-05-15 11:47:50 -07:00
Thomas Bennett d4eba2ba44 updated regex to be more concise 2016-05-15 11:47:27 -07:00
Thomas Bennett b296f56e2a Merge pull request #5 from dmmcquay/structs
Structs
2016-05-11 14:58:21 -07:00
Derek McQuay 017d100810 Restructured code to pass up and handle errors
Pretty big change.  Things now pass up errors that can be handled by the
caller.  This brought about a lot of change.  Errors attempt to be
descriptive of where they came from and notify user of the api what
potentailly caused the error.  Also renamed go-halo5-api.go to a more
suitable name, http.go.  This might change in the future if we implement
the http.Client interface
2016-05-11 14:52:37 -07:00
Derek McQuay 4550ba9d30 moved main.go in to a seperate cmd dir 2016-05-11 10:48:44 -07:00
Derek McQuay 914869dfed updating profile.go to use methods
also changed some things in go-halo5-api.go.  Still need to rethink how
we are passing up errors and failures of trying to get the results
2016-05-11 10:48:00 -07:00
Thomas Bennett 76531a8dcb finished converting functions to methods in the stats file 2016-05-11 09:31:42 -07:00
Thomas Bennett 5400089684 updated EventsForMatch and MatchesForPlayer to use the new methods 2016-05-10 21:30:19 -07:00
Thomas Bennett 736272dfea Fixed typo in requisition-packs function 2016-05-10 21:30:19 -07:00
Derek McQuay 1c339ec1a0 code reorg to leverage methods instead of function
moved all metadata.go function calls into method calls for the Halo
struct.  This will make it easier to encapsulate baseurl, apikey, blah
blah, and also makes the code a little bit more readable.  Stats.go and
profile.go are to follow.

Still need to implement http.Client interface and look over the code in
go-halo5-api.go.  Most likely needs to break out and be cleaned up
2016-05-10 21:30:18 -07:00
Derek McQuay b558a172fd adding api structs
possible errors, will need further testing
2016-05-10 21:30:09 -07:00
Derek McQuay 38f040a6ea updated gitignore 2016-05-10 21:29:56 -07:00
Thomas Bennett a6028a69aa Started work on returning structs instead of json strings
Lots of tests have been added to the main.go file.  Several of the functions return structs now instead of json strings.  I've added the initial structs for the remaining functions.
2016-05-10 13:31:32 -07:00
Thomas Bennett 136d0df4c9 Added Match/Season/Playlist ID verification. 2016-05-06 12:33:47 -07:00
Thomas Bennett 1a1b7af289 Fixed bug where SpartanImage and EmblemImage were not returning
Fixed formatting in the main.go file, and updated the SpartanImage and EmblemImage functions to return the URL of the image rather than the byte code.  All the other functions now return byte code which is cast to a string in the main.go file.
2016-05-05 16:41:09 -07:00
Thomas Bennett 0f96521408 Added examples and package import sections 2016-05-05 15:11:26 -07:00
Thomas Bennett a48929d939 added API key check and removed duplicate lines 2016-05-05 15:00:13 -07:00
Thomas Bennett 6d4ae9303c Merge pull request #4 from dmmcquay/master
Created halo pkg and fixed naming of funcs
2016-05-05 14:50:17 -07:00
Derek McQuay 5fbb161f36 created halo pkg and renamed functions
haven't changed any of the code, per se.  Moved the halo pkg code and
created main.go file.  Should create tests for all of the functionality.
2016-05-05 14:45:52 -07:00
Derek McQuay a92e282634 adding gitignore file 2016-05-05 14:44:07 -07:00
Thomas Bennett 5f0288e32c Added ability to import HALO_API_KEY environment variable.
The secret API key is now imported from the environment instead of being hard coded into the package.  The gamertag variable has been renamed to sampleGamertag.
2016-05-05 13:17:12 -07:00
Thomas Bennett 205714cad4 Initial commit with most functionality working 2016-05-05 11:13:28 -07:00