remote

package
v3.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: Apache-2.0 Imports: 11 Imported by: 4

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