server

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHostToKnownHosts

func AddHostToKnownHosts(ip string, knownHostsPath string) error

Types

type SSHClient

type SSHClient struct {
	Client     *ssh.Client
	Config     *ssh.ClientConfig
	SFTPClient *sftp.Client
	LastUsed   time.Time
	// contains filtered or unexported fields
}

SSHClient wraps SSH client and related configurations

type ServerOption

type ServerOption func(*ServerStruct) error

ServerOption defines the functional option type

func WithConfig

func WithConfig() ServerOption

WithConfig loads and applies the configuration

func WithDaemon

func WithDaemon() ServerOption

func WithSSH

func WithSSH() ServerOption

WithSSH initializes SSH connections for all configured servers

type ServerStruct

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

func New

func New(opts ...ServerOption) (*ServerStruct, error)

New creates a new ServerStruct with provided options

func (*ServerStruct) BasicCaddySetup

func (s *ServerStruct) BasicCaddySetup(ctx context.Context, serverName string, stream io.Writer) error

func (*ServerStruct) CloseSSHConnection

func (s *ServerStruct) CloseSSHConnection() error

func (*ServerStruct) DownloadFile

func (s *ServerStruct) DownloadFile(ctx context.Context, serverName, remotePath, localPath string) error

func (*ServerStruct) ExecuteCommand

func (s *ServerStruct) ExecuteCommand(ctx context.Context, serverName, command string, stream io.Writer) (string, error)

func (*ServerStruct) GetDeploymentServer

func (s *ServerStruct) GetDeploymentServer() (string, error)

func (*ServerStruct) GetServerStatus

func (s *ServerStruct) GetServerStatus(serverName string, stream io.Writer) (string, error)

func (*ServerStruct) ListServers

func (s *ServerStruct) ListServers() []string

func (*ServerStruct) PingServer

func (s *ServerStruct) PingServer(serverName string) error

func (*ServerStruct) Reconnect

func (s *ServerStruct) Reconnect(serverName string) error

func (*ServerStruct) UploadFile

func (s *ServerStruct) UploadFile(ctx context.Context, serverName, localPath, remotePath string) error

Jump to

Keyboard shortcuts

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