Giter Club home page Giter Club logo

dexcom-go's Introduction

dexcom-go

This package serves as an SDK that makes it easy to interact with the Dexcom API. We make use of a simple design, exposing the most critical data in structs that are easy to consume.

Supported Methods:

  • Calibrations
  • Data Range
  • Devices
  • Estimated Glucose Values
  • Events
  • Statistics

Please feel free to make a pull request to support more methods!

Example

c := dexcom.New("<your-access-token>")
egvs, err := c.GetEGVs(time.Now().Add(-1 * time.Hour), time.Now())
if err != nil {
	panic(err)
}

fmt.Println(egvs)

Obviously, you should not panic in a real-life scenario. This example will return all of your estimated glucose values for the past hour.

Sandbox Mode

To test with Sandbox data, simply overwrite the Endpoint field on the Client. An example:

c := dexcom.New("<your-access-token>")
c.Endpoint = "https://sandbox-api.dexcom.com"

Debugging

Sometimes, it is desirable to have logs for each request, and logs detailing errors when they happen. To log information from this package, implement the Logger, and overwrite the Logger field on the Client. An example:

c := dexcom.New("<your-access-token>")
c.Logger = myBeautifulLogger{}

Contributing

  • Better error handling (status code checks, logging, etc)

Testing

We use an environment variable TEST_ACCESS_TOKEN to run our integration tests. To run the test suite, this variable must be set. To run the tests:

go test -v github.com/t1labs/dexcom-go

License

Copyright © 2019 t1labs

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

dexcom-go's People

Contributors

huttotw avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dexcom-go's Issues

Dumb question

Hi,

I have been playing around with the dexcom-go code. Firstly, it is just great. Thanks for writing this!

I have a newbie dumb question. Is there anyway to automate the "collection" or Dexcom OAuth "AccessCode". My understanding is that you first need the "AccessCode" before you can get the "AccessToken". And getting AccessCode requires handling the URL redirects. That is where I am stuck.

Thanks.

Jag

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.