collection

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	// ShellCollection is a reference to a Collection's store of SSH configuration map.
	ShellCollection ShellCollection

	// FileName is a reference to the name of the file which serves as the source-of-truth for all SSH configurations
	FileName string
	// contains filtered or unexported fields
}

Collection is a general object that stores a collection of shells and the source-of-truth file for the SSH configurations.

func InitCollection

func InitCollection() Collection

InitCollection initializes an existing or new collection with a stored file and an up-to-date collection of SSH sessions.

func (*Collection) AddShell

func (c *Collection) AddShell(ssh shell.SSH)

AddShell takes some credentials and adds them to the existing collection of SSH configurations. Credentials consist of a username, password, and a hostname. The password is encoded.

func (Collection) DisplayShellAndOptions

func (c Collection) DisplayShellAndOptions()

DisplayShellAndOptions is the main user interface where the user can select various inputs to perform actions. The options include connecting to a previously stored session, connecting to a new SSH session, and exiting.

func (*Collection) RetrieveOrCreateFile

func (c *Collection) RetrieveOrCreateFile(path string) error

RetrieveOrCreateFile looks to see if the file already exists. If it does not, it creates it as an empty file. The file is returned.

type ShellCollection

type ShellCollection struct {
	// Shells is a map containing previously stored SSH credentials.
	Shells map[string]map[string]string `json:"shells"`
}

ShellCollection is a stored collection of shell configurations.

Jump to

Keyboard shortcuts

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