util

package
v0.0.0-...-cb472e6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(c *TLSClientConfig) (*http.Client, error)

Types

type APIMachineryConfig

type APIMachineryConfig struct {
	// request's qps value
	QPS int64
	// request's burst value
	Burst     int64
	TLSConfig *TLSClientConfig
}

type Capability

type Capability struct {
	Client   HttpClient
	Discover discovery.Interface
	Throttle flowctrl.RateLimiter
	Mock     MockInfo
	Reg      prometheus.Registerer
}

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type MockInfo

type MockInfo struct {
	Mocked      bool
	SetMockData bool
	MockData    interface{}
}

type TLSClientConfig

type TLSClientConfig struct {
	// Server should be accessed without verifying the TLS certificate. For testing only.
	InsecureSkipVerify bool
	// Server requires TLS client certificate authentication
	CertFile string
	// Server requires TLS client certificate authentication
	KeyFile string
	// Trusted root certificates for server
	CAFile string
	// the password to decrypt the certificate
	Password string
}

func NewTLSClientConfigFromConfig

func NewTLSClientConfigFromConfig(prefix string, config map[string]string) (TLSClientConfig, error)

Jump to

Keyboard shortcuts

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