model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrReservedName = fmt.Errorf("name is a reserved command")

ErrReservedName is returned when a connection name conflicts with a CLI command.

View Source
var ReservedNames = map[string]bool{
	"add":    true,
	"rm":     true,
	"list":   true,
	"ls":     true,
	"new":    true,
	"create": true,
	"edit":   true,
	"delete": true,
	"reset":  true,
	"help":   true,
}

ReservedNames are CLI subcommand names that cannot be used as connection names.

Functions

func ValidateName

func ValidateName(name string) error

ValidateName checks whether a connection name conflicts with a CLI command.

Types

type AuthType

type AuthType string

AuthType represents the SSH authentication method.

const (
	AuthKey      AuthType = "key"
	AuthPassword AuthType = "password"
)

type Connection

type Connection struct {
	ID            int64
	Name          string
	User          string
	Host          string
	Port          int
	Directory     string
	AuthType      AuthType
	IdentityFile  string
	EncryptedPass []byte
	PassNonce     []byte
	CreatedAt     string
	UpdatedAt     string
}

Connection represents a saved SSH connection.

func (Connection) DisplayLabel

func (c Connection) DisplayLabel() string

DisplayLabel returns a formatted label for TUI display.

func (Connection) SSHTarget

func (c Connection) SSHTarget() string

SSHTarget returns user@host.

Jump to

Keyboard shortcuts

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