utils

package
v0.0.0-...-ec047a8 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(err error)

Check Create panic if there is any error

func Commando

func Commando(pemFileName string, serverIP string, user string)

Commando executes shell session

func Login

func Login(pemKey string, user string, server string, port string)

Login creates psedo terminal for ssh, and can handle event. this will allow us to add more functionality over ssh. but currently as it Login does not have terminal feature, it is not used for ssh session

func PublicKeyFile

func PublicKeyFile(file string) (ssh.AuthMethod, error)

PublicKeyFile reads pem file for ssh

Types

type Filter

type Filter func(string) (error, string)

Filter defines function for running filter on the data

type Query

type Query struct {
	Name         string
	Question     string
	DefaultValue string
	AnswerType   string
	Answer       string
}

Query struct type to handle user input and Question

func (*Query) Filter

func (q *Query) Filter(fn Filter) error

Filter hanlde filteration on user data

func (*Query) InType

func (q *Query) InType() interface{}

InType Convert user Input into the format user wants

func (*Query) Prompt

func (q *Query) Prompt()

Prompt triggers event to Ask Question to users

func (Query) Validate

func (q Query) Validate(fn Validation) error

Validate Handle user input validation

type ServerList

type ServerList struct {
	Name     string
	PublicIP string
	PemKey   string
}

ServerList contains requires ec2 instance details

func GetServersList

func GetServersList(config aws.Config, tag string, value string) []ServerList

GetServersList provides list of aws server based on the filter params

type Validation

type Validation func(string) error

Validation defines validation function to be passed in struct for user input validation

Jump to

Keyboard shortcuts

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