Documentation
¶
Index ¶
- Variables
- func IsDaemonDown(err error) bool
- func WithAuthorization(s string) funcopt.O
- func WithBearer(s string) funcopt.O
- func WithCertificate(s string) funcopt.O
- func WithInsecureSkipVerify(v bool) funcopt.O
- func WithKey(s string) funcopt.O
- func WithPassword(s string) funcopt.O
- func WithRootCa(s string) funcopt.O
- func WithTimeout(v time.Duration) funcopt.O
- func WithURL(url string) funcopt.O
- func WithUsername(s string) funcopt.O
- type GetInstanceContainerLog
- type T
- func (t *T) Console(ctx context.Context, nodename string, path naming.Path, rid string, ...) (console.Result, error)
- func (t *T) Host() string
- func (t *T) Hostname() string
- func (t *T) NewGetClusterStatus() *api.GetClusterStatus
- func (t *T) NewGetContainerLogs(path naming.Path, nodename, rid string) *GetInstanceContainerLog
- func (t *T) NewGetEvents() *api.GetEvents
- func (t *T) NewGetLogs(nodename string) *api.GetLogs
- func (t *T) TLSConfig() (*tls.Config, error)
- func (t *T) URL() string
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultClientTimeout is the default client timeout value used by New DefaultClientTimeout = 30 * time.Second )
Functions ¶
func IsDaemonDown ¶
IsDaemonDown says err is the unix socket of the local daemon missing or refusing the connection: the daemon is not running on this node.
A daemon that answers, even with an error, is up, and so is one reached over the network, whose failure says nothing of the local node.
func WithAuthorization ¶
WithAuthorization sets the client authorization to use for newRequests
func WithBearer ¶
WithBearer sets the client bearer tokens to use for newRequests
func WithCertificate ¶
WithCertificate sets the x509 client certificate.
func WithInsecureSkipVerify ¶
WithInsecureSkipVerify skips certificate validity checks.
func WithPassword ¶
WithPassword sets the password to use for login.
func WithRootCa ¶
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 ¶
WithTimeout set a timeout on the connection
func WithURL ¶
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 ¶
WithUsername sets the username to use for login.
Types ¶
type GetInstanceContainerLog ¶
type GetInstanceContainerLog struct {
// contains filtered or unexported fields
}
GetInstanceContainerLog is a placeholder for the generated API type This will be replaced by the actual generated type from the API spec
type T ¶
type T struct {
*oapi.ClientWithResponses
// contains filtered or unexported fields
}
T is the agent api client configuration
func New ¶
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) Console ¶
func (t *T) Console(ctx context.Context, nodename string, path naming.Path, rid string, stdin *os.File, stdout io.Writer) (console.Result, error)
Console opens a console session on the resource of the instance, and connects stdin and stdout to it until it ends.
The api is asked for the ticket of the session, and the session is opened beside the api, on the console endpoint.
func (*T) Host ¶
Host returns the host the api is reached on, and "" when it is reached through the unix socket of the local node.
func (*T) NewGetClusterStatus ¶
func (t *T) NewGetClusterStatus() *api.GetClusterStatus
func (*T) NewGetContainerLogs ¶
func (t *T) NewGetContainerLogs(path naming.Path, nodename, rid string) *GetInstanceContainerLog