This is an (unofficial) Go wrapper for working with the Picnic WebAPI.
To install the library:
go get github.com/simonmartyr/picnic-api
To create a client & authenticate you and choose to provide a valid access token or credentials to manually authenticate with.
//authentication with a token
package main
import picnic "github.com/simonmartyr/picnic-api"
func main() {
client := picnic.New(&http.Client{},
picnic.WithToken("your accessToken"),
)
}
or
//authentication using auth credentials
package main
import picnic "github.com/simonmartyr/picnic-api"
func main() {
client := picnic.New(&http.Client{},
picnic.WithUserName("[email protected]"),
picnic.WithHashedPassword("hashedPassword"),
)
err := client.Authenticate()
if err != nil {
panic(err.Error())
}
}
For a complete example of the API being used, checkout picnic-tui
Thanks to the efforts of MRVDH which documented the API.