hmc

package module
v0.0.0-...-806df85 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

README

hmc-client-go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes struct {
	XMLns         string `xml:"xmlns,attr"`
	SchemaVersion string `xml:"schemaVersion,attr"`
}

type Authenticator

type Authenticator interface {
	Authenticate(request *http.Request) error
	Validate() error
	GetBaseURL() string
	SetClient(client *http.Client)
}

type BasicAuthenticator

type BasicAuthenticator struct {
	UserName string
	Password string
	BaseURL  string
	Client   *http.Client
}

func (*BasicAuthenticator) Authenticate

func (a *BasicAuthenticator) Authenticate(request *http.Request) error

func (*BasicAuthenticator) GetBaseURL

func (a *BasicAuthenticator) GetBaseURL() string

func (*BasicAuthenticator) SetClient

func (a *BasicAuthenticator) SetClient(client *http.Client)

func (*BasicAuthenticator) Validate

func (a *BasicAuthenticator) Validate() error

type Client

type Client struct {

	// Authenticator for the client
	Authenticator Authenticator

	// No need to set -- for testing only
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Client contains parameters for configuring the SDK.

func NewClient

func NewClient(authenticator Authenticator, param ClientParams) *Client

func (*Client) DELETE

func (c *Client) DELETE() (*Feed, *DetailedResponse, error)

func (*Client) GET

func (c *Client) GET() (*Feed, *DetailedResponse, error)

func (*Client) GetBaseURL

func (c *Client) GetBaseURL() string

func (*Client) ManagedSystems

func (c *Client) ManagedSystems() *ManagedSystems

func (*Client) POST

func (c *Client) POST() (*Feed, *DetailedResponse, error)

func (*Client) PUT

func (c *Client) PUT() (*Feed, *DetailedResponse, error)

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(url string)

type ClientParams

type ClientParams struct {
	LogLevel log.Level
	Insecure bool
}

type Content

type Content struct {
	atom.Text
	ManagedSystem ManagedSystem `xml:"ManagedSystem"`
}

type DetailedResponse

type DetailedResponse struct {

	// The HTTP status code associated with the response.
	StatusCode int

	// The HTTP headers contained in the response.
	Headers http.Header

	// Result - this field will contain the result of the operation (obtained from the response body).
	Result *Feed

	// RawResult field will contain the raw response body.
	RawResult []byte
}

DetailedResponse holds the response information received from the server.

type Entry

type Entry struct {
	*atom.Entry
	Content *Content `xml:"content"`
}

type Feed

type Feed struct {
	*atom.Feed
	Entry []*Entry `xml:"entry"`
}

type ManagedSystem

type ManagedSystem struct {
	ActivatedLevel string `xml:"ActivatedLevel"`
}

type ManagedSystems

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

func (*ManagedSystems) GET

func (m *ManagedSystems) GET() (*Feed, *DetailedResponse, error)

func (*ManagedSystems) UUID

func (m *ManagedSystems) UUID(id string) *ManagedSystems

type Resource

type Resource interface {
	GET() interface{}
	DELETE() error
	POST() interface{}
}

type RoundTripper

type RoundTripper struct {
	Proxied http.RoundTripper
}

func (RoundTripper) RoundTrip

func (rt RoundTripper) RoundTrip(req *http.Request) (res *http.Response, e error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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