client

package
v0.60.6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultDaemonAddr is the default address for the NetBird daemon
	DefaultDaemonAddr = "unix:///var/run/netbird.sock"
	// DefaultDaemonAddrWindows is the default address for the NetBird daemon on Windows
	DefaultDaemonAddrWindows = "tcp://127.0.0.1:41731"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps crypto/ssh Client for simplified SSH operations

func Dial

func Dial(ctx context.Context, addr, user string, opts DialOptions) (*Client, error)

Dial connects to the given ssh server with specified options

func (*Client) Close

func (c *Client) Close() error

func (*Client) ExecuteCommand

func (c *Client) ExecuteCommand(ctx context.Context, command string) ([]byte, error)

ExecuteCommand executes a command on the remote host and returns the output

func (*Client) ExecuteCommandWithIO

func (c *Client) ExecuteCommandWithIO(ctx context.Context, command string) error

ExecuteCommandWithIO executes a command with interactive I/O connected to local terminal

func (*Client) ExecuteCommandWithPTY

func (c *Client) ExecuteCommandWithPTY(ctx context.Context, command string) error

ExecuteCommandWithPTY executes a command with a pseudo-terminal for interactive sessions

func (*Client) LocalPortForward

func (c *Client) LocalPortForward(ctx context.Context, localAddr, remoteAddr string) error

LocalPortForward sets up local port forwarding, binding to localAddr and forwarding to remoteAddr

func (*Client) OpenTerminal

func (c *Client) OpenTerminal(ctx context.Context) error

func (*Client) RemotePortForward

func (c *Client) RemotePortForward(ctx context.Context, remoteAddr, localAddr string) error

RemotePortForward sets up remote port forwarding, binding on remote and forwarding to localAddr

type DialOptions

type DialOptions struct {
	KnownHostsFile     string
	IdentityFile       string
	DaemonAddr         string
	SkipCachedToken    bool
	InsecureSkipVerify bool
	NoBrowser          bool
}

DialOptions contains options for SSH connections

Jump to

Keyboard shortcuts

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