connect

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Timeout = 0

	EnableMod = 1
	ICRNLMod  = 1
	INLCRMod  = 1
	ISIGMod   = 1

	ISPEED = 115200
	OSPEED = 115200

	TypeTerm       = "xterm-256color"
	HeightTerminal = 80
	WidthTerminal  = 40
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Connect

type Connect struct {
	// Alias is a user-defined name for the connection
	Alias     string `json:"alias"`
	Login     string `json:"login"`
	Address   string `json:"address"`
	Password  string `json:"password"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`

	// Type specifies the connection protocol (e.g., "ssh")
	Type ConnectionType `json:"type"`

	// SshOptions contains SSH-specific configuration options
	SshOptions *SshOptions `json:"ssh_options,omitempty"`
}

Connect represents a single connection configuration

func (*Connect) Validate added in v1.0.5

func (c *Connect) Validate() error

type ConnectionType

type ConnectionType string
const TypeSSH ConnectionType = "ssh"

TypeSSH type for ssh connection

type Connections

type Connections struct {
	Connects []Connect `json:"connects"`
}

type Sftp added in v1.2.0

type Sftp struct {
	Connection *Connect
}

func (Sftp) Client added in v1.2.2

func (s Sftp) Client(opts ...sftp.ClientOption) (*sftp.Client, error)

type Ssh

type Ssh struct {
	Connection *Connect
}

func (*Ssh) Auth added in v1.2.2

func (s *Ssh) Auth() ([]ssh.AuthMethod, error)

Auth automate defines method auth from Connect

func (*Ssh) Client added in v1.2.0

func (s *Ssh) Client() (*ssh.Client, error)

Client create ssh client from config and Auth

func (*Ssh) Connect

func (s *Ssh) Connect(session *ssh.Session) error

Connect starts an interactive shell session using the established SSH connection

func (*Ssh) Session

func (s *Ssh) Session() (*ssh.Session, error)

Session establishes a new SSH session with the remote server

type SshOptions

type SshOptions struct {
	// Port specifies the SSH port (default is 22 if not specified)
	Port int `json:"port"`

	// PrivateKey contains the PEM-encoded private key for authentication
	PrivateKey string `json:"private_key"`

	// Passphrase pass for private key
	Passphrase string `json:"passphrase"`
}

SshOptions contains configuration options specific to SSH connections

Jump to

Keyboard shortcuts

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