Documentation
¶
Index ¶
- type AlreadyConnected
- type Local
- type LocalOption
- type Remote
- type RemoteOption
- type SSH
- type SSHAuthMethods
- type SSHOption
- func UseKeyFile(filename string) SSHOption
- func UseKnownHostsFile(filename string) SSHOption
- func UseSSHPassword(password string) SSHOption
- func UseSSHPort(port string) SSHOption
- func UseSSHUsername(username string) SSHOption
- func WithAcceptUnknownHostKey() SSHOption
- func WithInsecureIgnoreHostKey() SSHOption
- func WithRemoteSocket(socket string) SSHOption
- func WithSSHAuthMethods(methods *SSHAuthMethods) SSHOption
- func WithSystemSSHDefaults(currentUser *user.User) SSHOption
- type TLS
- type TLSOption
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.
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.
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.
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.
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 UseKnownHostsFile ¶
UseKnownHostsFile uses a custom known_hosts file
func UseSSHPassword ¶
UseSSHPassword uses the given password for the ssh connection.
func UseSSHPort ¶
UseSSHPort uses the given port for the ssh connection.
func UseSSHUsername ¶
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 ¶
WithRemoteSocket uses a custom remote socket
func WithSSHAuthMethods ¶
func WithSSHAuthMethods(methods *SSHAuthMethods) SSHOption
WithSSHAuthMethods uses the specified auth methods in priority order.
func WithSystemSSHDefaults ¶
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
type TLSOption ¶
type TLSOption func(*TLS)
TLSOption is a function for setting remote dialer options.
func UsePKIPath ¶
UsePKIPath sets the search path for TLS certificate files.
func UseTLSPort ¶
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.