Documentation ¶
Index ¶
- Constants
- Variables
- func GetExtraHTTPHeaders(logger logrus.FieldLogger) (map[string]string, error)
- func GetHTTPTransport(logger logrus.FieldLogger) *http.Transport
- func GetProxyFunc(logger logrus.FieldLogger) func(*http.Request) (*url.URL, error)
- func GetRegionId(logger logrus.FieldLogger) (string, error)
- func GetRootCAs(logger logrus.FieldLogger) *x509.CertPool
- func GetServerDomain(logger logrus.FieldLogger) (string, error)
- func PeekHTTPTransport(logger logrus.FieldLogger) *http.Transport
- func PeekRefreshedRootCAs(logger logrus.FieldLogger) *x509.CertPool
- func RefreshHTTPCas(logger logrus.FieldLogger, certPool *x509.CertPool)
- func SetAPIServerProviders(providers []APIServerProvider)
- func SetRegionIdProviders(providers []RegionIdProvider)
- func SetRootCAProviders(providers []CACertificateProvider)
- func UpdateRootCAs(logger logrus.FieldLogger, certPool *x509.CertPool)
- type APIServerProvider
- type CACertificateProvider
- type HttpErrorCode
- type RegionIdProvider
Constants ¶
View Source
const (
UserAgentHeader = "User-Agent"
)
Variables ¶
View Source
var (
ErrNotProvided = errors.New("not provided")
)
View Source
var (
UserAgentValue string = fmt.Sprintf("%s_%s/%s", runtime.GOOS, runtime.GOARCH, version.AssistVersion)
)
Functions ¶
func GetExtraHTTPHeaders ¶
func GetExtraHTTPHeaders(logger logrus.FieldLogger) (map[string]string, error)
GetExtraHTTPHeaders would provide effective extra HTTP headers only when API server is determined
func GetHTTPTransport ¶
func GetHTTPTransport(logger logrus.FieldLogger) *http.Transport
func GetProxyFunc ¶
func GetRegionId ¶
func GetRegionId(logger logrus.FieldLogger) (string, error)
func GetRootCAs ¶
func GetRootCAs(logger logrus.FieldLogger) *x509.CertPool
func GetServerDomain ¶
func GetServerDomain(logger logrus.FieldLogger) (string, error)
func PeekHTTPTransport ¶
func PeekHTTPTransport(logger logrus.FieldLogger) *http.Transport
PeekHTTPTransport: return a deep copy of _httpTransport. PeekHTTPTransport must be called after GetHTTPTransport
func PeekRefreshedRootCAs ¶
func PeekRefreshedRootCAs(logger logrus.FieldLogger) *x509.CertPool
PeekRefreshedRootCAs returns refreshed certs instead cached, and won't modify the certs cache
func RefreshHTTPCas ¶
func RefreshHTTPCas(logger logrus.FieldLogger, certPool *x509.CertPool)
func SetAPIServerProviders ¶
func SetAPIServerProviders(providers []APIServerProvider)
func SetRegionIdProviders ¶
func SetRegionIdProviders(providers []RegionIdProvider)
func SetRootCAProviders ¶
func SetRootCAProviders(providers []CACertificateProvider)
func UpdateRootCAs ¶
func UpdateRootCAs(logger logrus.FieldLogger, certPool *x509.CertPool)
Types ¶
type APIServerProvider ¶
type APIServerProvider interface { Name() string ServerDomain(logger logrus.FieldLogger) (string, error) ExtraHTTPHeaders(logger logrus.FieldLogger) (map[string]string, error) }
type CACertificateProvider ¶
type HttpErrorCode ¶
type HttpErrorCode struct {
// contains filtered or unexported fields
}
func NewHttpErrorCode ¶
func NewHttpErrorCode(code int) *HttpErrorCode
func (*HttpErrorCode) Error ¶
func (e *HttpErrorCode) Error() string
func (*HttpErrorCode) GetCode ¶
func (e *HttpErrorCode) GetCode() int
type RegionIdProvider ¶
type RegionIdProvider interface { Name() string RegionId(logger logrus.FieldLogger) (string, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.