server

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHostToKnownHosts

func AddHostToKnownHosts(ip string, knownHostsPath string) error

func GenerateVPSResourceView

func GenerateVPSResourceView(appCfg *config.AppConfig, resMap VPSResourceMap) (string, error)

GenerateVPSResourceView creates a premium HTML report of the provisioned resources.

Types

type SSHClient

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

type ServerOption

type ServerOption func(*ServerStruct) error

func WithConfig

func WithConfig() ServerOption

func WithDaemon

func WithDaemon() ServerOption

func WithSSH

func WithSSH() ServerOption

type ServerStruct

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

func New

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

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) ServerHost added in v0.16.0

func (s *ServerStruct) ServerHost(name string) (string, error)

ServerHost returns the network address configured for the named server.

GetDeploymentServer deliberately returns the server's NAME — that is the key sshClients is indexed by, so every Execute/Upload call needs it. But a name is a nickname ("production"), not something a DNS A record can point at. Anything user-facing that means "the address of the box" has to resolve it through here; passing the name straight through is how dns.md ended up instructing operators to point their domain at the string "production".

func (*ServerStruct) UploadFile

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

type VPSResourceMap

type VPSResourceMap struct {
	AppName        string
	Environment    string
	ServerIP       string
	CustomDomain   string
	Port           int
	DeploymentTime time.Time
	DNSProvider    string // "namecheap", "cloudflare", "godaddy", "route53", "other"
}

VPSResourceMap holds the metadata for the visual report.

Jump to

Keyboard shortcuts

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