config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package config persists saved connections and bookmarks to TOML files under ~/.config/sftpcommander/. Both stores share the same load-modify-save pattern.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBookmark

func AddBookmark(b Bookmark) error

func AddConnection

func AddConnection(c Connection) error

func DeleteBookmark

func DeleteBookmark(host, port, user, p string) error

func DeleteConnection

func DeleteConnection(name string) error

func SaveBookmarks

func SaveBookmarks(b []Bookmark) error

func SaveConnections

func SaveConnections(conns []Connection) error

Types

type Bookmark

type Bookmark struct {
	Host  string `toml:"host"`
	Port  string `toml:"port,omitempty"`
	User  string `toml:"user"`
	Path  string `toml:"path"`
	Label string `toml:"label,omitempty"`
}

func BookmarksForHost

func BookmarksForHost(host, port, user string) ([]Bookmark, error)

BookmarksForHost returns bookmarks whose host+port+user match. Empty host/user matches everything (useful before a connection is set up). An empty stored port matches any queried port (legacy entries written before port scoping).

func LoadBookmarks

func LoadBookmarks() ([]Bookmark, error)

type Connection

type Connection struct {
	Name    string `toml:"name"`
	Host    string `toml:"host"`
	Port    string `toml:"port"`
	User    string `toml:"user"`
	KeyPath string `toml:"key_path,omitempty"`
}

func LoadConnections

func LoadConnections() ([]Connection, error)

Jump to

Keyboard shortcuts

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