util

package
v0.0.0-...-545993c Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Input

func Input(prompt string) string

Input mimics Python's input function, which outputs a prompt and takes bytes from stdin until a newline and returns a string.

func SaveServerDB

func SaveServerDB(s ServerDB) error

SaveServerDB saves the provided ServerDB struct into the appropriate file.

func SecureInput

func SecureInput(prompt string) string

SecureInput requests takes user input, but none of characters typed appear in the terminal window.

Types

type ServerDB

type ServerDB struct {
	DefaultServer string `json:"default"`
	Servers       map[string]struct {
		Username string `json:"username"`
		Password string `json:"password"`
	} `json:"servers"`
}

func NewServerDB

func NewServerDB() ServerDB

func ReadServerDB

func ReadServerDB() (ServerDB, error)

ReadServerDB loads the server database into a ServerDB struct and returns the result.

Jump to

Keyboard shortcuts

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