transport

package
v0.0.0-...-224339a Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 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 {
	// contains filtered or unexported fields
}

Client represents the HTTP client.

func New

func New(cfg Config) (*Client, error)

New creates new transport client. http.DefaultTransport will be used if no transport is passed in the configuration.

func (*Client) Perform

func (c *Client) Perform(req *http.Request) (*http.Response, error)

Perform executes the request and returns a response or error.

type Config

type Config struct {
	// URL is the endpoint of AWS Neptune cluster.
	URL *url.URL

	// Region is the AWS region where AWS Neptune cluster is located in. Required only when Signer is not nil.
	Region string

	// Signer is to sign the request with AWS V4 signature.
	// When it is nil, the request won't be signed.
	Signer *v4.Signer

	// Transport represents the execution of a single HTTP transaction.
	// http.DefaultTransport will be used if not specified.
	Transport http.RoundTripper
}

Config represents the configuration of HTTP client.

type Interface

type Interface interface {
	Perform(*http.Request) (*http.Response, error)
}

Interface defines the interface of HTTP client.

Jump to

Keyboard shortcuts

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