nowsecure-go

module
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2018 License: MIT

README

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)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL