client

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 19 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"
View Source
const NS_WSMAN = "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"
View Source
const NS_WSMID = "http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd"
View Source
const NonTLSPort = "16992"
View Source
const RedirectionNonTLSPort = "16994"
View Source
const RedirectionTLSPort = "16995"
View Source
const TLSPort = "16993"

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
	IsRedirection     bool
}

Parameters struct defines the connection settings for wsman client

type Target

type Target struct {
	http.Client
	// 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) Post

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

Post overrides http.Client's Post method

func (*Target) ProxyUrl

func (c *Target) ProxyUrl(proxy_str 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
}

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