client

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(opts *Options) error

Types

type Logger

type Logger interface {
	RequestPrintf(format string, args ...interface{})
	ResponsePrintf(format string, args ...interface{})
}

Logger is an interface representing the Logger struct

type Options added in v0.1.1

type Options struct {
	Server       string
	Username     string
	Password     string
	SessionID    string
	CACert       string
	Cert         string
	Key          string
	CloseSession bool
	Debug        bool
	Sel          bool
	Version      bool
	ProfileIndex int
}

type RoundTripper

type RoundTripper struct {
	// Default http.RoundTripper
	Rt http.RoundTripper
	// If Logger is not nil, then RoundTrip method will debug the JSON
	// requests and responses
	Logger Logger
}

RoundTripper satisfies the http.RoundTripper interface and is used to customize the default http client RoundTripper

func (*RoundTripper) RoundTrip

func (rt *RoundTripper) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip performs a round-trip HTTP request and logs relevant information about it.

Jump to

Keyboard shortcuts

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