remote

package
v2.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEtcdClient

func CreateEtcdClient(configFile string) (*etcd.BytesConnectionEtcd, error)

CreateEtcdClient uses environment variable ETCD_CONFIG or ETCD config file to establish connection

Types

type HTTPClient

type HTTPClient struct {
	// Config for this client
	Config *HTTPClientConfig
	// contains filtered or unexported fields
}

HTTPClient wraps http.Client with configured authorization and url base

func CreateHTTPClient

func CreateHTTPClient(configFile string) (*HTTPClient, error)

CreateHTTPClient uses environment variable HTTP_CONFIG or HTTP config file to establish connection

func (*HTTPClient) Crawl

func (client *HTTPClient) Crawl(base string, cmd string, suffix string) []string

Crawl extracts all http** links from a given webpage (suffix default is

func (*HTTPClient) Get

func (client *HTTPClient) Get(base string, cmd string) (*http.Response, error)

Get creates http get request prefixing cmd with base if needed and using correct authentication

func (*HTTPClient) Post

func (client *HTTPClient) Post(base string, cmd string, body string) (*http.Response, error)

Post creates http post request prefixing cmd with base if needed and using correct authentication

type HTTPClientConfig

type HTTPClientConfig struct {
	// Port on what targets are listening on
	Port string `json:"port"`
	// Basic authorization for client
	BasicAuth string `json:"basic-auth"`
	// If https or http should be used
	UseHTTPS bool `json:"use-https"`
	// Defines whether server cert should be verified.
	// Set to false in case of self-signed certificates.
	VerifyServerCert bool `json:"verify-server-cert"`
}

HTTPClientConfig is configuration for http client

Jump to

Keyboard shortcuts

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