client

package
v2.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 23 Imported by: 2

Documentation

Overview

********************************************************************

  • Copyright (c) Intel Corporation 2024
  • SPDX-License-Identifier: Apache-2.0 *********************************************************************

Index

Constants

View Source
const (
	ContentType           = "application/soap+xml; charset=utf-8"
	NSWSMAN               = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"
	NSWSMID               = "http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd"
	TLSPort               = "16993"
	NonTLSPort            = "16992"
	RedirectionTLSPort    = "16995"
	RedirectionNonTLSPort = "16994"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthChallenge added in v2.2.0

type AuthChallenge struct {
	Username   string
	Password   string
	Realm      string
	CSRFToken  string
	Domain     string
	Nonce      string
	Opaque     string
	Stale      string
	Algorithm  string
	Qop        string
	CNonce     string
	NonceCount int
}

func (*AuthChallenge) ComputeDigestHash added in v2.4.0

func (c *AuthChallenge) ComputeDigestHash(method, uri, nonceData string) string

func (*AuthChallenge) GetFormattedNonceData added in v2.4.0

func (c *AuthChallenge) GetFormattedNonceData(nonceData string) string

func (*AuthChallenge) HashCredentials added in v2.2.0

func (c *AuthChallenge) HashCredentials() string

type Message

type Message struct {
	XMLInput  string
	XMLOutput string
}

type Parameters

type Parameters struct {
	Target            string
	Username          string
	Password          string
	UseDigest         bool
	UseTLS            bool
	SelfSignedAllowed bool
	LogAMTMessages    bool
	Transport         http.RoundTripper
	IsRedirection     bool
	PinnedCert        string
}

Parameters struct defines the connection settings for wsman client.

type Target

type Target struct {
	http.Client

	UseTLS             bool
	InsecureSkipVerify bool
	PinnedCert         string
	// contains filtered or unexported fields
}

Target is a thin wrapper around http.Target.

func NewWsman

func NewWsman(cp Parameters) *Target

func NewWsmanTCP added in v2.4.0

func NewWsmanTCP(cp Parameters) *Target

func (*Target) CloseConnection added in v2.4.0

func (t *Target) CloseConnection() error

CloseConnection cleanly closes the TCP connection.

func (*Target) Connect added in v2.4.0

func (t *Target) Connect() error

Connect establishes a TCP connection to the endpoint specified in the Target struct.

func (*Target) GetServerCertificate added in v2.13.0

func (t *Target) GetServerCertificate() (*tls.Certificate, error)

func (*Target) IsAuthenticated added in v2.11.0

func (t *Target) IsAuthenticated() bool

func (*Target) Post

func (t *Target) Post(msg string) (response []byte, err error)

Post overrides http.Client's Post method.

func (*Target) ProxyURL added in v2.5.2

func (t *Target) ProxyURL(proxyStr string) (err error)

ProxyURL sets proxy address for the underlying Transport if supported.

func (*Target) Receive added in v2.4.0

func (t *Target) Receive() ([]byte, error)

Receive reads data from the connected TCP endpoint in the Target struct.

func (*Target) Send added in v2.4.0

func (t *Target) Send(data []byte) error

Send sends data to the connected TCP endpoint in the Target struct.

type WSMan

type WSMan interface {
	// HTTP Methods
	Post(msg string) (response []byte, err error)
	// TCP Methods
	Connect() error
	Send(data []byte) error
	Receive() ([]byte, error)
	CloseConnection() error
	IsAuthenticated() bool
	GetServerCertificate() (*tls.Certificate, error)
}

WSMan is an interface for the wsman.Client.

type WsTransport

type WsTransport struct {
	// contains filtered or unexported fields
}

WsTransport is an implementation of http.Transport which uses websocket relay.

func NewWsTransport

func NewWsTransport(wsurl string, protocol int, host, username, password string, port int, tls, tls1only bool, token string, tlsconfig *tls.Config) *WsTransport

NewTransport creates a new Websocket RoundTripper.

func (*WsTransport) RoundTrip

func (t *WsTransport) RoundTrip(r *http.Request) (resp *http.Response, err error)

RoundTrip makes a low level text exchange over websocket. This is supposed to be used by high level round tripper.

Jump to

Keyboard shortcuts

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