common

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*rest.Client
}

Client implements helper functionality for Prerecorded API

func New

func New(apiKey string, options *interfaces.ClientOptions) *Client

func (*Client) HandleResponse

func (c *Client) HandleResponse(res *http.Response, keys []string, resBody interface{}) (map[string]string, error)

HandleResponse processes the HTTP response for both streaming and URL-based API requests.

func (*Client) ProcessRequest

func (c *Client) ProcessRequest(ctx context.Context, req *http.Request, result interface{}) error

ProcessRequest sends the HTTP request and processes the response.

func (*Client) SetupRequest

func (c *Client) SetupRequest(ctx context.Context, method, uri string, body io.Reader) (*http.Request, error)

SetupRequest prepares and returns a new HTTP request with common headers set.

Jump to

Keyboard shortcuts

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