Documentation
¶
Index ¶
Constants ¶
View Source
const AttemptsLimit = 3
AttemptsLimit is the limit value for the number of attempts to obtain user data in terminal mode.
View Source
const CommandQuit = ":q"
CommandQuit is the command for exit from Interactive mode.
View Source
const CommandsResponseSeparator = "--------"
CommandsResponseSeparator is symbols that is written between responses of several commands if more than one command was called. TODO: Add to config.
Variables ¶
View Source
var ( // ErrEmptyAddress is returned when executed command without setting address // in single mode. ErrEmptyAddress = errors.New("address is not set: to set address add -a host:port") // ErrEmptyAddress is returned when executed command without setting password // in single mode. ErrEmptyPassword = errors.New("password is not set: to set password add -p password") // ErrToManyFails is returned in terminal mode when exceeding the limit of // user data retrieval attempts. ErrToManyFails = errors.New("to many fails") // ErrCommandEmpty is returned when executed command length equal 0. ErrCommandEmpty = errors.New("command is not set") )
Errors.
Functions ¶
func CheckCredentials ¶
CheckCredentials sends auth request for remote server. Returns en error if address or password is incorrect.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor is a cli commands execute wrapper.
func NewExecutor ¶
NewExecutor creates a new Executor.
func (*Executor) NewSession ¶
NewSession parses os args and config file for connection details to a remote server. If the address and password flags were received the configuration file is ignored.
Click to show internal directories.
Click to hide internal directories.