rest

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type A3YClient added in v0.2.0

type A3YClient struct {
}

type APIClient

type APIClient struct {
	versioned.Interface

	BaseURL    string
	BaseHost   string
	APIKey     string
	ProjectID  uuid.UUID
	RESTConfig *rest.Config

	HTTPClient *http.Client
}

APIClient represents the HTTP client with API key, project ID, and base URL configuration.

func NewAPIClient

func NewAPIClient(opts ...Option) (*APIClient, error)

NewAPIClient creates a new instance of the APIClient.

func (*APIClient) SendRequest

func (c *APIClient) SendRequest(method, path string, body []byte) (*http.Response, error)

SendRequest sends an HTTP request with the configured headers.

type Option added in v0.6.0

type Option func(*APIClient)

Option defines a configuration option for the APIClient.

func WithAPIKey added in v0.6.0

func WithAPIKey(apiKey string) Option

WithAPIKey sets the API key for the APIClient.

func WithBaseHost added in v0.6.0

func WithBaseHost(baseHost string) Option

WithBaseHost sets the base host for the APIClient.

func WithBaseURL added in v0.6.0

func WithBaseURL(baseURL string) Option

WithBaseURL sets the base URL for the APIClient.

func WithK8sConfig added in v0.6.0

func WithK8sConfig(cfg *rest.Config) Option

WithK8sConfig sets the Kubernetes configuration for the APIClient. If set, overriedes baseURL, baseHost, APIKey, and ProjectID.

func WithProjectID added in v0.6.0

func WithProjectID(projectID uuid.UUID) Option

WithProjectID sets the project ID for the APIClient.

Jump to

Keyboard shortcuts

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