httpcommon

package
v0.0.0-...-ec16f60 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: Apache-2.0 Imports: 8 Imported by: 15

Documentation

Overview

Copyright 2018 StreamSets Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	None      = "NONE"
	Basic     = "BASIC"
	Digest    = "DIGEST"
	Universal = "UNIVERSAL"
	OAuth     = "OAUTH"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfigBean

type ClientConfigBean struct {
	HttpCompression string                 `ConfigDef:"type=STRING,required=true"`
	TlsConfig       TlsConfigBean          `ConfigDefBean:"tlsConfig"`
	AuthType        string                 `ConfigDef:"type=STRING,required=true"`
	Oauth           OAuthConfigBean        `ConfigDefBean:"oauth"`
	BasicAuth       PasswordAuthConfigBean `ConfigDefBean:"basicAuth"`
}

type HttpCommon

type HttpCommon struct {
	HttpClient *http.Client
	// contains filtered or unexported fields
}

func (*HttpCommon) InitializeClient

func (h *HttpCommon) InitializeClient(clientConfig ClientConfigBean) error

InitializeClient configures an http.Client from a config bean

func (*HttpCommon) RoundTrip

func (h *HttpCommon) RoundTrip(req *http.Request) (resp *http.Response, err error)

type OAuthConfigBean

type OAuthConfigBean struct {
	ConsumerKey    string `ConfigDef:"type=STRING,required=true"`
	ConsumerSecret string `ConfigDef:"type=STRING,required=true"`
	Token          string `ConfigDef:"type=STRING,required=true"`
	TokenSecret    string `ConfigDef:"type=STRING,required=true"`
}

type PasswordAuthConfigBean

type PasswordAuthConfigBean struct {
	Username string `ConfigDef:"type=STRING,required=true"`
	Password string `ConfigDef:"type=STRING,required=true"`
}

type TlsConfigBean

type TlsConfigBean struct {
	TlsEnabled         bool   `ConfigDef:"type=BOOLEAN,required=true"`
	TrustStoreFilePath string `ConfigDef:"type=STRING,required=true"`
	TrustStoreType     string `ConfigDef:"type=STRING,required=true"`
	TrustStorePassword string `ConfigDef:"type=STRING,required=true"`
	KeyStoreFilePath   string `ConfigDef:"type=STRING,required=true"`
	KeyStoreType       string `ConfigDef:"type=STRING,required=true"`
	KeyStorePassword   string `ConfigDef:"type=STRING,required=true"`
}

Jump to

Keyboard shortcuts

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