Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.23 KB

README.md

File metadata and controls

45 lines (31 loc) · 1.23 KB

Go Client for jAccount

Build Status Go Report Card GoDoc License

go-jaccount is a Go Client for jAccount API.

Installation

go get github.com/dyweb/go-jaccount

Example

// OAuth 2.0 configuration
var config = &oauth2.Config{
    ClientID:     os.Getenv("clientid"),
    ClientSecret: os.Getenv("secretkey"),
    Endpoint:     jaccount.Endpoint,
    RedirectURL:  "http://localhost:8000/callback",
    Scopes:       []string{"essential"},
}

var client *jaccount.Client

c := config.Client(oauth2.NoContext, token)

// jAccount API client
client = jaccount.NewClient(c)

// Get the profile of the user
profile, err := client.Profile.Get(context.Background())

References

License

Apache 2.0