Documentation ¶
Index ¶
- Variables
- func IsHttpError(err error) bool
- func LimitReader(r io.Reader, n int64) io.Reader
- type Authorizer
- type Client
- func (c *Client) GetClusterVersion() (*configv1.ClusterVersion, error)
- func (c *Client) GetWithPathParams(ctx context.Context, endpoint, requestID string) (*http.Response, error)
- func (c *Client) IncrementRecvReportMetric(statusCode int)
- func (c *Client) RecvClusterTransfer(endpoint string) ([]byte, error)
- func (c *Client) RecvGatheringRules(ctx context.Context, endpoint string) ([]byte, error)
- func (c *Client) RecvReport(ctx context.Context, endpoint string) (*http.Response, error)
- func (c *Client) RecvSCACerts(_ context.Context, endpoint string) ([]byte, error)
- func (c *Client) Send(ctx context.Context, endpoint string, source Source) error
- func (c *Client) SendAndGetID(ctx context.Context, endpoint string, source Source) (string, int, error)
- type HttpError
- type LimitedReader
- type Source
Constants ¶
This section is empty.
Variables ¶
var ErrTooLong = fmt.Errorf("the incoming sample data is too long")
var ErrWaitingForVersion = fmt.Errorf("waiting for the cluster version to be loaded")
Functions ¶
func IsHttpError ¶
Types ¶
type Authorizer ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(client *http.Client, maxBytes int64, metricsName string, authorizer Authorizer, configClient *configv1client.Clientset) *Client
New creates a Client
func (*Client) GetClusterVersion ¶
func (c *Client) GetClusterVersion() (*configv1.ClusterVersion, error)
func (*Client) GetWithPathParams ¶
func (c *Client) GetWithPathParams(ctx context.Context, endpoint, requestID string) (*http.Response, error)
GetWithPathParams makes an HTTP GET request to the specified endpoint using the specified "requestID" as a part of the endpoint path
func (*Client) IncrementRecvReportMetric ¶
IncrementRecvReportMetric increments the "insightsclient_request_recvreport_total" metric for the given HTTP status code
func (*Client) RecvClusterTransfer ¶
RecvClusterTransfer performs a request to the OCM cluster transfer API. It is an HTTP GET request with the `search` query parameter limiting the result only for the one cluster and only for the `accepted` cluster transfers.
func (*Client) RecvGatheringRules ¶
RecvGatheringRules performs a request to Insights Operator Gathering Conditions Service https://github.com/RedHatInsights/insights-operator-gathering-conditions-service and returns the response body or an error
func (*Client) RecvReport ¶
RecvReport performs a request to Insights Results Smart Proxy endpoint
func (*Client) RecvSCACerts ¶
type LimitedReader ¶
A LimitedReader reads from R but limits the amount of data returned to just N bytes. Each call to Read updates N to reflect the new amount remaining. Read returns ErrTooLong when N <= 0 or when the underlying R returns EOF.