dialers

package
v0.0.0-...-df736b2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 15 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlreadyConnected

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

AlreadyConnected implements a dialer interface for a connection that was established prior to initializing the socket object. This exists solely for backwards compatability with the previous implementation of Libvirt that took an already established connection.

func NewAlreadyConnected

func NewAlreadyConnected(c net.Conn) AlreadyConnected

NewAlreadyConnected is a noop dialer to simply use a connection previously established. This means any re-dial attempts simply won't work.

func (AlreadyConnected) Dial

func (a AlreadyConnected) Dial() (net.Conn, error)

Dial just returns the connection previously established. If at some point it is disconnected by the client, this obviously does *not* re-dial and will simply return the already closed connection.

type Local

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

Local implements connecting to a local libvirtd over the unix socket.

func NewLocal

func NewLocal(opts ...LocalOption) *Local

NewLocal is a default dialer to simply connect to a locally running libvirt's socket.

func (*Local) Dial

func (l *Local) Dial() (net.Conn, error)

Dial connects to a local socket

type LocalOption

type LocalOption func(*Local)

LocalOption is a function for setting local socket options.

func WithLocalTimeout

func WithLocalTimeout(timeout time.Duration) LocalOption

WithLocalTimeout sets the dial timeout.

func WithSocket

func WithSocket(socket string) LocalOption

WithSocket sets the path to the local libvirt socket.

type Remote

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

Remote implements connecting to a remote server's libvirt using tcp

func NewRemote

func NewRemote(hostAddr string, opts ...RemoteOption) *Remote

NewRemote is a dialer for connecting to libvirt running on another server.

func (*Remote) Dial

func (r *Remote) Dial() (net.Conn, error)

Dial connects to libvirt running on another server.

type RemoteOption

type RemoteOption func(*Remote)

RemoteOption is a function for setting remote dialer options.

func UsePort

func UsePort(port string) RemoteOption

UsePort sets the port to dial for libirt on the target host server.

func WithRemoteTimeout

func WithRemoteTimeout(timeout time.Duration) RemoteOption

WithRemoteTimeout sets the dial timeout.

type SSH

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

SSH implements connecting to a remote server's libvirt using ssh.

func NewSSH

func NewSSH(hostAddr string, opts ...SSHOption) *SSH

NewSSH returns an ssh dialer for connecting to libvirt running on another server.

func (*SSH) Dial

func (s *SSH) Dial() (net.Conn, error)

Dial connects to libvirt running on another server over ssh.

type SSHAuthMethods

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

SSHAuthMethods maintains a priority list of allowed ssh auth methods.

func (*SSHAuthMethods) Agent

func (am *SSHAuthMethods) Agent() *SSHAuthMethods

Agent adds the ssh agent auth method to the allowed list.

func (*SSHAuthMethods) KeyboardInteractive

func (am *SSHAuthMethods) KeyboardInteractive() *SSHAuthMethods

KeyboardInteractive adds the keyboard-interactive auth method to the allowed list (currently unimplemented).

func (*SSHAuthMethods) Password

func (am *SSHAuthMethods) Password() *SSHAuthMethods

Password adds the password auth method to the allowed list.

func (*SSHAuthMethods) PrivKey

func (am *SSHAuthMethods) PrivKey() *SSHAuthMethods

PrivKey adds the Private Key auth method to the allowed list.

type SSHOption

type SSHOption func(*SSH)

SSHOption is a function for setting ssh dialer options.

func UseKeyFile

func UseKeyFile(filename string) SSHOption

UseKeyFile uses a custom key file

func UseKnownHostsFile

func UseKnownHostsFile(filename string) SSHOption

UseKnownHostsFile uses a custom known_hosts file

func UseSSHPassword

func UseSSHPassword(password string) SSHOption

UseSSHPassword uses the given password for the ssh connection.

func UseSSHPort

func UseSSHPort(port string) SSHOption

UseSSHPort uses the given port for the ssh connection.

func UseSSHUsername

func UseSSHUsername(username string) SSHOption

UseSSHUsername uses the given username for the ssh connection.

func WithAcceptUnknownHostKey

func WithAcceptUnknownHostKey() SSHOption

WithAcceptUnknownHostKey ignores the validity of the host certificate.

func WithInsecureIgnoreHostKey

func WithInsecureIgnoreHostKey() SSHOption

WithInsecureIgnoreHostKey ignores the validity of the host certificate.

func WithRemoteSocket

func WithRemoteSocket(socket string) SSHOption

WithRemoteSocket uses a custom remote socket

func WithSSHAuthMethods

func WithSSHAuthMethods(methods *SSHAuthMethods) SSHOption

WithSSHAuthMethods uses the specified auth methods in priority order.

func WithSystemSSHDefaults

func WithSystemSSHDefaults(currentUser *user.User) SSHOption

WithSystemSSHDefaults uses default values for the system ssh client, rather than the defaults that libvirtclient uses with libssh.

type TLS

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

TLS implements connecting to a remote server's libvirt using tls

func NewTLS

func NewTLS(hostAddr string, opts ...TLSOption) *TLS

NewTLS is a dialer for connecting to libvirt running on another server.

func (*TLS) Dial

func (r *TLS) Dial() (net.Conn, error)

Dial connects to libvirt running on another server.

type TLSOption

type TLSOption func(*TLS)

TLSOption is a function for setting remote dialer options.

func UsePKIPath

func UsePKIPath(pkiPath string) TLSOption

UsePKIPath sets the search path for TLS certificate files.

func UseTLSPort

func UseTLSPort(port string) TLSOption

UseTLSPort sets the port to dial for libirt on the target host server.

func WithInsecureNoVerify

func WithInsecureNoVerify() TLSOption

WithInsecureNoVerify ignores the validity of the server certificate.

Jump to

Keyboard shortcuts

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