transport

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

transport package create a http.Transport configured for communicating with Mia-Platform Console

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDebugRoundTripper added in v0.10.0

func NewDebugRoundTripper(next http.RoundTripper) http.RoundTripper

func NewTransport

func NewTransport(config *Config) (http.RoundTripper, error)

func NewUserAgentRoundTripper

func NewUserAgentRoundTripper(userAgent string, next http.RoundTripper) http.RoundTripper

Types

type AuthorizeWrapperFunc

type AuthorizeWrapperFunc func(rt http.RoundTripper) http.RoundTripper

type Config

type Config struct {
	// UserAgent is an optional field that specifies the caller of this request.
	UserAgent string
	// TLSConfig contains settings to enable transport layer security
	TLSConfig
	// AuthorizeWrapper will add authorization header to the wrapped RoundTripper
	AuthorizeWrapper AuthorizeWrapperFunc
	// Verbose will add logging function to the call via a wrapper RoundTripper
	Verbose bool
}

Config transport layer configurations for setting up http.Transport

func (*Config) HasCA

func (c *Config) HasCA() bool

type TLSConfig

type TLSConfig struct {
	// Server should be accessed without verifying the TLS certificate. For testing only.
	Insecure bool

	// Trusted root certificates for server
	CAFile string
}

TLSConfig contains settings to enable transport layer security

Jump to

Keyboard shortcuts

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