clients

package
v0.0.0-...-8c21ddd Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

FIXME: golangci-lint nolint:revive

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBasicCredentialsHeader

func AddBasicCredentialsHeader(_ context.Context, req *http.Request)

func AddOAuth2IdentityHeader

func AddOAuth2IdentityHeader(ctx context.Context, req *http.Request, issuerURL, clientID, clientSecret string) error

func AddServiceMockIdentityHeader

func AddServiceMockIdentityHeader(_ context.Context, req *http.Request) error

func ConfigureClientWithTLS

func ConfigureClientWithTLS(client *http.Client) *http.Client

ConfigureClientWithTLS return https client in case there is TLS CA path, otherwise return the original unmodified client and logs an error

func GetOutgoingHeaders

func GetOutgoingHeaders(ctx context.Context) map[string]string

GetOutgoingHeaders returns Red Hat Insights headers from our request to use it in other request that will be used when communicating in Red Hat Insights services

Types

type DoerErr

type DoerErr struct {
	Err error
}

DoerErr is a simple wrapped error without any message. Additional message would stack for each request as multiple doers are called leading to:

"error in doer1: error in doer2: error in doer3: something happened"

func NewDoerErr

func NewDoerErr(err error) *DoerErr

func (*DoerErr) Error

func (e *DoerErr) Error() string

func (*DoerErr) Unwrap

func (e *DoerErr) Unwrap() error

type HTTPRequestDoer

type HTTPRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPRequestDoer is an interface for HTTP request doer. This interface is missing in the standard library and is used to abstract HTTP client creation.

func NewPlatformClient

func NewPlatformClient(ctx context.Context, proxy string) HTTPRequestDoer

NewPlatformClient returns new HTTP client (doer) with optional proxy support and additional logging or tracing. Tracing is only available in local setup (when LOCAL environment variable is set to true).

type LoggingDoer

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

LoggingDoer is a simple HTTP doer that logs request and response data. It is only used in TRACE level mode.

func (*LoggingDoer) Do

func (d *LoggingDoer) Do(req *http.Request) (*http.Response, error)

type MetricsDoer

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

func (*MetricsDoer) Do

func (d *MetricsDoer) Do(req *http.Request) (*http.Response, error)

Directories

Path Synopsis
Package imagebuilder provides Image Builder API client functions FIXME: golangci-lint nolint:errcheck,govet,revive
Package imagebuilder provides Image Builder API client functions FIXME: golangci-lint nolint:errcheck,govet,revive
mock_imagebuilder
Package mock_imagebuilder is a generated GoMock package.
Package mock_imagebuilder is a generated GoMock package.
FIXME: golangci-lint nolint:errcheck,gocritic,gosimple,govet,revive
FIXME: golangci-lint nolint:errcheck,gocritic,gosimple,govet,revive
mock_inventory
Package mock_inventory is a generated GoMock package.
Package mock_inventory is a generated GoMock package.
mock_inventorygroups
Package mock_inventorygroups is a generated GoMock package.
Package mock_inventorygroups is a generated GoMock package.
FIXME: golangci-lint nolint:errcheck,govet,revive
FIXME: golangci-lint nolint:errcheck,govet,revive
mock_playbookdispatcher
Package mock_playbookdispatcher is a generated GoMock package.
Package mock_playbookdispatcher is a generated GoMock package.
Package pulp provides primitives to interact with the openapi HTTP API.
Package pulp provides primitives to interact with the openapi HTTP API.
mock_rbac
Package mock_rbac is a generated GoMock package.
Package mock_rbac is a generated GoMock package.
mock_repositories
Package mock_repositories is a generated GoMock package.
Package mock_repositories is a generated GoMock package.

Jump to

Keyboard shortcuts

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