buildkite

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrHavingStatus

func IsErrHavingStatus(err error, code int) bool

Types

type BuildkiteOIDCProvider

type BuildkiteOIDCProvider struct {
}

func NewBuildkiteOIDCProvider

func NewBuildkiteOIDCProvider() *BuildkiteOIDCProvider

func (*BuildkiteOIDCProvider) Name

func (p *BuildkiteOIDCProvider) Name() string

func (*BuildkiteOIDCProvider) RetrieveToken

func (p *BuildkiteOIDCProvider) RetrieveToken(ctx context.Context) (string, error)

type Client

type Client struct {
	// contains filtered or unexported fields
}

A Client manages communication with the Buildkite Agent API.

func NewClient

func NewClient(conf Config) *Client

NewClient returns a new Buildkite Agent API Client.

func (*Client) Config

func (c *Client) Config() Config

Config returns the internal configuration for the Client

func (*Client) OIDCToken

func (c *Client) OIDCToken(ctx context.Context, methodReq *OIDCTokenRequest) (*OIDCToken, *Response, error)

type Config

type Config struct {
	// Endpoint for API requests. Defaults to the public Buildkite Agent API.
	// The URL should always be specified with a trailing slash.
	Endpoint string

	// The authentication token to use, either a registration or access token
	Token string

	// User agent used when communicating with the Buildkite Agent API.
	UserAgent string

	// If true, only HTTP2 is disabled
	DisableHTTP2 bool

	// If true, requests and responses will be dumped and set to the logger
	DebugHTTP bool

	// The http client used, leave nil for the default
	HTTPClient *http.Client
}

Config is configuration for the API Client

type ErrorResponse

type ErrorResponse struct {
	Response *http.Response // HTTP response that caused this error
	Message  string         `json:"message"` // error message
}

ErrorResponse provides a message.

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string
type Header struct {
	Name  string
	Value string
}

type OIDCToken

type OIDCToken struct {
	Token string `json:"token"`
}

type OIDCTokenRequest

type OIDCTokenRequest struct {
	Job      string
	Audience string
	Lifetime int
	Claims   []string
}

type Response

type Response struct {
	*http.Response
}

Response is a Buildkite Agent API response. This wraps the standard http.Response.

Jump to

Keyboard shortcuts

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