http

package
v0.0.0-...-58c3220 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseAPIClient

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

func NewBaseAPIClient

func NewBaseAPIClient(
	apiURL string, token string, clientID string,
	clientSecret string, tokenURL string, apiVersion string) BaseAPIClient

func (*BaseAPIClient) Do

func (bec *BaseAPIClient) Do(req *http.Request) (*http.Response, error)

func (*BaseAPIClient) DoRequest

func (bec *BaseAPIClient) DoRequest(httpMethod, path string, body interface{}) (*http.Response, error)

DoRequest makes HTTP request with some pre- and post- processing body will be encoded to json if not nil response will be checked on status code > 2xx. If so error will be returned with func Temporary() bool interface in mind So that caller can assert mentioned interface to make decision to retry later

func (*BaseAPIClient) DoRequestGetBody

func (bec *BaseAPIClient) DoRequestGetBody(httpMethod, path string, body interface{}) ([]byte, error)

func (*BaseAPIClient) Login

func (bec *BaseAPIClient) Login() error

type OAuthTokenResponse

type OAuthTokenResponse struct {
	IDToken string `json:"id_token"`
}

Jump to

Keyboard shortcuts

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