Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { NewRequest(ctx context.Context, method, prefix, urlPath string, body interface{}) (*http.Request, error) Do(req *http.Request, obj interface{}) error With(modifiers ...ClientModifierFn) Client }
Client is an HTTP client for communicating with Upbound.
type ClientModifierFn ¶
type ClientModifierFn func(*HTTPClient)
A ClientModifierFn modifies an HTTP client.
type Config ¶
type Config struct { // Client is the underlying client. Client Client // Logger is the interface for structured logging. Logger logging.Logger }
Config represents common configuration for Upbound SDK clients.
func NewConfig ¶
func NewConfig(modifiers ...ConfigModifierFn) *Config
NewConfig builds a new Config for communicating with the Upbound API.
type DefaultErrorHandler ¶
type DefaultErrorHandler struct{}
DefaultErrorHandler is the default operations for handling errors returned by the Upbound API.
type HTTPClient ¶
type HTTPClient struct { // BaseURL is the base Upbound API URL. BaseURL *url.URL // ErrorHandler controls how the client handles errors. ErrorHandler ResponseErrorHandler // HTTP is the underlying HTTP client. HTTP *http.Client // User agent for communicating with the Upbound API. UserAgent string }
HTTPClient implements the Client interface and allows for overriding of base URL, error handling, and user agent.
func NewClient ¶
func NewClient(modifiers ...ClientModifierFn) *HTTPClient
NewClient builds a new default HTTP client for Upbound.
func (*HTTPClient) Do ¶
func (c *HTTPClient) Do(req *http.Request, obj interface{}) error
Do performs an HTTP request and reads the body into the provided interface.
func (*HTTPClient) NewRequest ¶
func (c *HTTPClient) NewRequest(ctx context.Context, method, prefix, urlPath string, body interface{}) (*http.Request, error)
NewRequest builds an HTTP request.
func (*HTTPClient) With ¶ added in v0.3.0
func (c *HTTPClient) With(modifiers ...ClientModifierFn) Client
With returns a new Client after applying given modifiers.
type ResponseErrorHandler ¶
A ResponseErrorHandler handles errors in HTTP responses.
Directories ¶
Path | Synopsis |
---|---|
_examples
|
|
Package apis contains Kubernetes API for the MXE provider.
|
Package apis contains Kubernetes API for the MXE provider. |
common
Package common contains common types for other packages to use.
|
Package common contains common types for other packages to use. |
observability/v1alpha1
Package v1alpha1 contains Observability resources.
|
Package v1alpha1 contains Observability resources. |
policy/v1alpha1
Package v1alpha1 contains Policy resources.
|
Package v1alpha1 contains Policy resources. |
query
Package query contains query.spaces.upbound.io API versions.
|
Package query contains query.spaces.upbound.io API versions. |
query/v1alpha1
Package v1alpha1 contains ControlPlane resources.
|
Package v1alpha1 contains ControlPlane resources. |
query/v1alpha2
Package v1alpha2 contains v1alpha2 of the Query API.
|
Package v1alpha2 contains v1alpha2 of the Query API. |
spaces
Package spaces contains spaces.upbound.io API versions.
|
Package spaces contains spaces.upbound.io API versions. |
spaces/v1alpha1
Package v1alpha1 contains ControlPlane resources.
|
Package v1alpha1 contains ControlPlane resources. |
spaces/v1beta1
Package v1beta1 contains ControlPlane resources.
|
Package v1beta1 contains ControlPlane resources. |
upbound
Package upbound contains upbound.io API versions.
|
Package upbound contains upbound.io API versions. |
upbound/v1alpha1
Package v1alpha1 contains the Cluster resource.
|
Package v1alpha1 contains the Cluster resource. |
service
|
|