2015-05-31 16:58:14 +02:00
|
|
|
package packet
|
|
|
|
|
|
|
|
import (
|
2015-10-22 20:03:25 +02:00
|
|
|
"github.com/hashicorp/go-cleanhttp"
|
2015-05-31 16:58:14 +02:00
|
|
|
"github.com/packethost/packngo"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
consumerToken = "aZ9GmqHTPtxevvFq9SK3Pi2yr9YCbRzduCSXF2SNem5sjB91mDq7Th3ZwTtRqMWZ"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Config struct {
|
|
|
|
AuthToken string
|
|
|
|
}
|
|
|
|
|
2016-01-14 16:50:15 +01:00
|
|
|
// Client() returns a new client for accessing Packet's API.
|
2015-05-31 16:58:14 +02:00
|
|
|
func (c *Config) Client() *packngo.Client {
|
2015-10-22 20:03:25 +02:00
|
|
|
return packngo.NewClient(consumerToken, c.AuthToken, cleanhttp.DefaultClient())
|
2015-05-31 16:58:14 +02:00
|
|
|
}
|