utils

package
v0.0.0-...-a795153 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Prompt_confirmation = *&survey.Select{
	Message: "Add RSA key?",
	Options: []string{"Yes", "No"},
}
View Source
var SimpleConnection = []*survey.Question{
	{
		Name:      "key",
		Prompt:    &survey.Input{Message: "What is the public key?"},
		Validate:  survey.Required,
		Transform: survey.Title,
	},
	{
		Name:   "ip",
		Prompt: &survey.Input{Message: "What is the server IP?"},
		Validate: survey.ComposeValidators(survey.Required, func(ans interface{}) error {
			if err := CheckIPAddress(ans.(string)); err != nil {
				return err
			}
			return nil
		}),
		Transform: survey.Title,
	},
}

Functions

func CallClear

func CallClear()

func CheckIPAddress

func CheckIPAddress(ip string) error

func GetAWSInstance

func GetAWSInstance(profile, region, instance string) string

func PrintKeyandIP

func PrintKeyandIP(k, v string)

func PrintKeyandUser

func PrintKeyandUser(k, v string)

func RemoveKeyFromLocalDB

func RemoveKeyFromLocalDB(db *bolt.DB, user, key string)

func SaveKeyInLocalDB

func SaveKeyInLocalDB(db *bolt.DB, user, key, ip string)

func SearchUserInLocalDB

func SearchUserInLocalDB(db *bolt.DB, user string) string

func SetupLocalDB

func SetupLocalDB() *bolt.DB

Types

This section is empty.

Jump to

Keyboard shortcuts

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