client

package
v0.0.0-...-20c3210 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAuthorization

func WithAuthorization(s string) funcopt.O

WithAuthorization sets the client authorization to use for newRequests

func WithBearer

func WithBearer(s string) funcopt.O

WithBearer sets the client bearer token to use for newRequests

func WithCertificate

func WithCertificate(s string) funcopt.O

WithCertificate sets the x509 client certificate.

func WithInsecureSkipVerify

func WithInsecureSkipVerify(v bool) funcopt.O

WithInsecureSkipVerify skips certificate validity checks.

func WithKey

func WithKey(s string) funcopt.O

WithKey sets the x509 client private key..

func WithPassword

func WithPassword(s string) funcopt.O

WithPassword sets the password to use for login.

func WithRootCa

func WithRootCa(s string) funcopt.O

WithRootCa sets the client RootCA filename, httpclient cache don't cache clients with RootCa because of possible tmp filename conflict signature. The cert from s file is appended to x509.SystemCertPool

func WithTimeout

func WithTimeout(v time.Duration) funcopt.O

WithTimeout set a timeout on the connection

func WithURL

func WithURL(url string) funcopt.O

WithURL is the option pointing the api location and protocol using the [<scheme>://]<addr>[:<port>] format.

Supported schemes:

  • https http/2 with TLS
  • tls http/2 with TLS

If unset, a unix domain socket connection and the http/2 protocol is selected.

If WithURL is a unix domain socket path, use the corresponding protocol.

If scheme is omitted, select the http/2 protocol.

Examples: * /var/lib/opensvc/lsnr/http.sock * https://acme.com:1215

func WithUsername

func WithUsername(s string) funcopt.O

WithUsername sets the username to use for login.

Types

type T

type T struct {
	*oapi.ClientWithResponses
	// contains filtered or unexported fields
}

T is the agent api client configuration

func New

func New(opts ...funcopt.O) (*T, error)

New allocates a new client configuration and returns the reference so users are not tempted to use client.Config{} dereferenced, which would make loadContext useless.

func (*T) Hostname

func (t *T) Hostname() string

func (*T) NewGetDaemonStatus

func (t *T) NewGetDaemonStatus() *api.GetDaemonStatus

func (*T) NewGetEvents

func (t *T) NewGetEvents() *api.GetEvents

func (*T) NewGetLogs

func (t *T) NewGetLogs(nodename string) *api.GetLogs

func (*T) URL

func (t *T) URL() string

Directories

Path Synopsis
requester
h2

Jump to

Keyboard shortcuts

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