httpclient

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpTransportAuthProvider

type HttpTransportAuthProvider interface {
	AddAuthHeaders(req *http.Request)
}

type HttpTransportClient

type HttpTransportClient struct {
	Client *http.Client
	Config *HttpTransportClientConfig
}

func (*HttpTransportClient) AddAuthHeaders

func (t *HttpTransportClient) AddAuthHeaders(req *http.Request)

func (*HttpTransportClient) AddCommonHeaders

func (t *HttpTransportClient) AddCommonHeaders(req *http.Request)

func (*HttpTransportClient) GetJSON

func (t *HttpTransportClient) GetJSON(path string, out any, params ...HttpTransportClientParams) error

func (*HttpTransportClient) ParseParams added in v0.1.6

func (t *HttpTransportClient) ParseParams(req *http.Request, params ...HttpTransportClientParams)

func (*HttpTransportClient) PostJSON

func (t *HttpTransportClient) PostJSON(path string, in any, out any, params ...HttpTransportClientParams) error

func (*HttpTransportClient) PutJSON

func (t *HttpTransportClient) PutJSON(path string, in any, out any, params ...HttpTransportClientParams) error

type HttpTransportClientConfig

type HttpTransportClientConfig struct {
	BaseURL      string
	AuthProvider HttpTransportAuthProvider
	Role         string
	Version      rorversion.RorVersion
}

type HttpTransportClientOpts added in v0.1.6

type HttpTransportClientOpts string
const (
	HttpTransportClientOptsNoAuth  HttpTransportClientOpts = "NOAUTH"
	HttpTransportClientOptsHeaders HttpTransportClientOpts = "HEADERS"
	HttpTransportClientOptsQuery   HttpTransportClientOpts = "QUERY"
)

type HttpTransportClientParams

type HttpTransportClientParams struct {
	Key   HttpTransportClientOpts
	Value any
}

Jump to

Keyboard shortcuts

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