Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataDir

func DataDir() (string, error)

DataDir returns the base data directory for SSHThing. Respects SSHTHING_DATA_DIR env var for testing/custom setups.

func Path

func Path() (string, error)

func Save

func Save(c Config) error

Types

type Config

type Config struct {
	Version int `json:"version"`

	UI struct {
		VimMode   bool `json:"vim_mode"`
		ShowIcons bool `json:"show_icons"`
	} `json:"ui"`

	SSH struct {
		HostKeyPolicy       HostKeyPolicy       `json:"host_key_policy"`
		KeepAliveSeconds    int                 `json:"keepalive_seconds"`
		TermMode            TermMode            `json:"term_mode"`
		TermCustom          string              `json:"term_custom"`
		PasswordAutoLogin   bool                `json:"password_auto_login"`
		PasswordBackendUnix PasswordBackendUnix `json:"password_backend_unix"`
	} `json:"ssh"`

	Mount struct {
		Enabled           bool              `json:"enabled"`
		DefaultRemotePath string            `json:"default_remote_path"`
		QuitBehavior      MountQuitBehavior `json:"quit_behavior"`
	} `json:"mount"`

	Sync struct {
		Enabled    bool           `json:"enabled"`
		RepoURL    string         `json:"repo_url"`
		AuthMethod SyncAuthMethod `json:"auth_method"`
		SSHKeyPath string         `json:"ssh_key_path"`
		Branch     string         `json:"branch"`
		LocalPath  string         `json:"local_path"`
	} `json:"sync"`

	Updates struct {
		LastCheckedAt   string `json:"last_checked_at,omitempty"`
		LastSeenVersion string `json:"last_seen_version,omitempty"`
		LastSeenTag     string `json:"last_seen_tag,omitempty"`
		ETagLatest      string `json:"etag_latest,omitempty"`
	} `json:"updates"`

	Automation struct {
		SyncTokenDefinitions bool `json:"sync_token_definitions"`
		SessionTTLSeconds    int  `json:"session_ttl_seconds"`
	} `json:"automation"`
}

func Default

func Default() Config

func Load

func Load() (Config, error)

func (*Config) SyncPath

func (c *Config) SyncPath() (string, error)

SyncPath returns the path to the sync repository directory. If LocalPath is set, it returns that; otherwise returns the default path.

type HostKeyPolicy

type HostKeyPolicy string
const (
	HostKeyAcceptNew HostKeyPolicy = "accept-new"
	HostKeyStrict    HostKeyPolicy = "strict"
	HostKeyOff       HostKeyPolicy = "off"
)

type MountQuitBehavior

type MountQuitBehavior string
const (
	MountQuitPrompt        MountQuitBehavior = "prompt"
	MountQuitAlwaysUnmount MountQuitBehavior = "always_unmount"
	MountQuitLeaveMounted  MountQuitBehavior = "leave_mounted"
)

type PasswordBackendUnix added in v1.0.3

type PasswordBackendUnix string
const (
	PasswordBackendSSHPassFirst PasswordBackendUnix = "sshpass_first"
	PasswordBackendAskpassFirst PasswordBackendUnix = "askpass_first"
)

type SyncAuthMethod

type SyncAuthMethod string

SyncAuthMethod represents the authentication method for Git sync

const (
	SyncAuthSSHKey SyncAuthMethod = "ssh_key"
	SyncAuthNone   SyncAuthMethod = "none"
)

type TermMode

type TermMode string
const (
	TermAuto   TermMode = "auto"
	TermXterm  TermMode = "xterm-256color"
	TermCustom TermMode = "custom"
)

Jump to

Keyboard shortcuts

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