Documentation ¶
Index ¶
- func GetMultiPartBodyAndHeaders(filename string) (*bytes.Buffer, string, error)
- func ProcessResponse(logger logr.Logger, resp *http.Response) ([]byte, error)
- func SetupRequest(authConfig *AuthConfig, contentType, method, uri string, body *bytes.Buffer) (*http.Request, error)
- func Upload(authConfig *AuthConfig, contentType, method, uri string, body *bytes.Buffer) (string, metav1.Time, error)
- type AuthConfig
- type HTTPClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMultiPartBodyAndHeaders ¶
GetMultiPartBodyAndHeaders Get multi-part body and headers for upload
func ProcessResponse ¶
ProcessResponse Log response for request and return valid
func SetupRequest ¶
func SetupRequest(authConfig *AuthConfig, contentType, method, uri string, body *bytes.Buffer) (*http.Request, error)
SetupRequest creates a new request, adds headers to request object for communication to cloud.redhat.com, and returns the request
Types ¶
type AuthConfig ¶
type AuthConfig struct { Client client.Client ClusterID string Authentication kokumetricscfgv1alpha1.AuthenticationType BearerTokenString string BasicAuthUser string BasicAuthPassword string ValidateCert bool OperatorCommit string Log logr.Logger }
AuthConfig provides the data for reconciling the CR with defaults
type HTTPClient ¶
HTTPClient gives us a testable interface
var Client HTTPClient
Client is an http.Client
func GetClient ¶
func GetClient(authConfig *AuthConfig) HTTPClient
GetClient Return client with certificate handling based on configuration
Click to show internal directories.
Click to hide internal directories.