Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed cmd/misha/README.md
Empty file.
1 change: 1 addition & 0 deletions internal/component/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var (
errConvertPort = errors.New(`cannot convert port`)
)

// Run Main function that runs an interactive form to collect SSH connection details
func Run() (*Fields, error) {
var authPassConfirm bool

Expand Down
1 change: 1 addition & 0 deletions internal/component/create/fields.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package create

// Fields A struct that stores SSH connection details
type Fields struct {
Alias string
Login string
Expand Down
4 changes: 4 additions & 0 deletions internal/component/create/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var (
errPreloadedConnections error
)

// init Loads existing SSH connections at startup
func init() {
connections, err := kernel.List()
if err != nil {
Expand All @@ -36,6 +37,7 @@ func init() {
preloadedConnections = connections
}

// aliasValidate validate on exists alias
func aliasValidate(alias string) error {
if strings.TrimSpace(alias) == "" || alias == "" {
return errAliasIsNotEmpty
Expand All @@ -54,6 +56,7 @@ func aliasValidate(alias string) error {
return nil
}

// portValidate validate on correctly port
func portValidate(s string) error {
port, err := strconv.Atoi(s)
if err != nil {
Expand All @@ -67,6 +70,7 @@ func portValidate(s string) error {
return nil
}

// privateKeyValidate validate on exists file
func privateKeyValidate(filename string) error {
if strings.TrimSpace(filename) == "" || filename == "" {
return nil
Expand Down
1 change: 1 addition & 0 deletions internal/component/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var (
errNotFoundConnections = errors.New("not found connections")
)

// Run Get selected connection from list
func Run(connections *connect.Connections) (*connect.Connect, error) {
var aliases []string
var selectedAlias string
Expand Down
1 change: 1 addition & 0 deletions internal/component/output/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var (
ErrorColor = lipgloss.Color("#FF0000")
)

// Error get message line for erros
func Error(s string) {
style := lipgloss.NewStyle().Foreground(ErrorColor)
println(style.Render(s))
Expand Down
1 change: 1 addition & 0 deletions internal/component/output/success.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var (
successColor = lipgloss.Color("#04B575")
)

// Success get message lin for success operations
func Success(s string) {
style := lipgloss.NewStyle().Foreground(successColor)
println(style.Render(s))
Expand Down
1 change: 1 addition & 0 deletions internal/component/update/fields.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package update

// Fields A struct that update SSH connection details
type Fields struct {
Alias string
Login string
Expand Down
1 change: 1 addition & 0 deletions internal/component/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var (
errConvertPort = errors.New(`cannot convert port`)
)

// Run get form for update connect.Connect
func Run(connection *connect.Connect) (*Fields, error) {
var authPassConfirm bool

Expand Down
4 changes: 4 additions & 0 deletions internal/component/update/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var (
errPreloadedConnections error
)

// init Loads existing SSH connections at startup
func init() {
connections, err := kernel.List()
if err != nil {
Expand All @@ -36,6 +37,7 @@ func init() {
preloadedConnections = connections
}

// aliasValidate validate on exists alias
func aliasValidate(alias string) error {
if strings.TrimSpace(alias) == "" || alias == "" {
return errAliasIsNotEmpty
Expand All @@ -54,6 +56,7 @@ func aliasValidate(alias string) error {
return nil
}

// portValidate validate on correctly port
func portValidate(s string) error {
port, err := strconv.Atoi(s)
if err != nil {
Expand All @@ -67,6 +70,7 @@ func portValidate(s string) error {
return nil
}

// privateKeyValidate validate on exists file
func privateKeyValidate(filename string) error {
if strings.TrimSpace(filename) == "" || filename == "" {
return nil
Expand Down
1 change: 1 addition & 0 deletions internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var (
emptyVersion = ""
)

// Get return version from debug main version
func Get() string {
if info, ok := debug.ReadBuildInfo(); ok {
version := info.Main.Version
Expand Down
Loading