authclient

package
v0.0.0-...-1e2dbfa Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthRoundTripper

type AuthRoundTripper struct {
	Token     string
	Dump      bool
	Transport http.RoundTripper
}

AuthRoundTripper to override default roundtripper https://github.com/golang/go/blob/master/src/net/http/client.go#L62

func (AuthRoundTripper) RoundTrip

func (a AuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip overrides the default RoundTrip https://github.com/golang/go/blob/master/src/net/http/client.go#L142

type Client

type Client struct {
	*http.Client
	Host string
}

Client for authing

func NewClient

func NewClient(apiToken string, host string, debug bool) *Client

NewClient with our roundtripper

func (*Client) RevokeToken

func (c *Client) RevokeToken() (*http.Response, error)

RevokeToken of the client https://buildkite.com/docs/rest-api/access-token

func (*Client) TokenScopes

func (c *Client) TokenScopes() (*TokenResponse, error)

TokenScopes of the client https://buildkite.com/docs/rest-api/access-token

type TokenResponse

type TokenResponse struct {
	UUID    string   `json:"uuid,omitempty"`
	Scopes  []string `json:"scopes,omitempty"`
	Message string   `json:"message,omitempty"`
}

TokenResponse from API

Jump to

Keyboard shortcuts

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