restclient

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package restclient contains functions to add and retrieve rest client from context

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetErrorFromResponse

func GetErrorFromResponse(resp *resty.Response, err error) error

GetErrorFromResponse returns an error based on the response. Will do the best effort to convert error responses into apimachinery errors

func RESTClient

func RESTClient(ctx context.Context) *resty.Client

RESTClient returns a client.Client in a given context. Returns nil if not found

func WithRESTClient

func WithRESTClient(ctx context.Context, clt *resty.Client) context.Context

WithRESTClient sets a client instance into a context

Types

This section is empty.

Jump to

Keyboard shortcuts

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