httputil

package
v0.0.0-...-4f5eb69 Latest Latest
Warning

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

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

Documentation

Overview

Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureTLS

func ConfigureTLS(client Client, certificates []tls.Certificate, caCertificate []byte, trustAll bool)

ConfigureTLS configures the given client with given certificates and caCertificate. If trustAll is true, the client will skip verification of the certificate chain.

func ForceHTTP2

func ForceHTTP2(client Client, certificates []tls.Certificate, caCertificate []byte, trustAll bool)

ForceHTTP2 configures the given client exclusively with a HTTP/2 transport. The other options are passed to ConfigureTLS. If certificates is nil, the client will be configured with H2C (HTTP/2 over clear-text).

Types

type Client

type Client interface {
	Do(request *http.Request, timeout time.Duration) (response *http.Response, error error)
}

Client represents a HTTP client usable by the Vespa CLI.

func NewClient

func NewClient(timeout time.Duration) Client

NewClients creates a new HTTP client the given default timeout.

Jump to

Keyboard shortcuts

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