Home

Awesome

go-digits Build Status GoDoc

<img align="right" src="https://storage.googleapis.com/dghubble/digits-gopher.png">

go-digits is a Go client library for the Digits API. Check the usage section or the examples to learn how to access the Digits API.

Features

Install

go get github.com/dghubble/go-digits/digits

Docs

Read GoDoc

Usage

The digits package provides a Client for accessing the Digits API. Here is an example request for a Digit user's Account.

import (
    "github.com/dghubble/go-digits/digits"
    "github.com/dghubble/oauth1"
)

config := oauth1.NewConfig("consumerKey", "consumerSecret")
token := oauth1.NewToken("accessToken", "accessSecret")
// OAuth1 http.Client will automatically authorize Requests
httpClient := config.Client(oauth1.NoContext, token)

// Digits client
client := digits.NewClient(httpClient)
// get current user's Digits Account
account, resp, err := client.Accounts.Account()

Authentication

The API client accepts any http.Client capable of signing OAuth1 requests to handle authorization. See the OAuth1 package dghubble/oauth1 for details and examples.

To implement Login with Digits for web or mobile, see the gologin package and examples.

Contributing

See the Contributing Guide.

License

MIT License