util

package
v3.1.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: MIT Imports: 8 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 {
	// the address of zookeeper address, comma separated.
	ZkAddr string
	// 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
}

type Headers

type Headers struct {
	Language string `HTTP_BLUEKING_LANGUAGE`
	User     string `BK_User`
	OwnerID  string `HTTP_BLUEKING_SUPPLIER_ID`
}

Attention: all the fields must be string, or the ToHeader method will be panic. the struct filed tag is the key of header, and the header's value is the struct filed value.

func (Headers) ToHeader

func (h Headers) ToHeader() http.Header

type HttpClient

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

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
}

Jump to

Keyboard shortcuts

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