Golang Wrapper for the nowsecure api
Usage
import "github.com/mediatestdigital/nowsecure-go"
Construct a new Nowsecure client, then use the various services on the client to access different parts ot the Nowsecure API. For example:
client := nowsecure.NewClient(nil)
report, err := client.Reports.Get("platform", "identifier", "buildVersion")
Authentication
The libary itself doesn't handle authentication with the nowsecure API. Instead, when creating a new client, pass a http.Client that can handle authentication for you. I recommend using the oauth2 library
import (
"golang.org/c/oauth2"
"github.com/mediatestdigital/nowsecure-go"
)
func main() {
ctx := context.Background()
ts := oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: "your access token"},
)
tc := oauth2.NewClient(ctx, ts)
client := nowsecure.NewClient(tc)
}