diff --git a/cmd/misha/README.md b/cmd/misha/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/internal/component/create/create.go b/internal/component/create/create.go index de369c3..200948a 100644 --- a/internal/component/create/create.go +++ b/internal/component/create/create.go @@ -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 diff --git a/internal/component/create/fields.go b/internal/component/create/fields.go index aca16e0..24be5ce 100644 --- a/internal/component/create/fields.go +++ b/internal/component/create/fields.go @@ -1,5 +1,6 @@ package create +// Fields A struct that stores SSH connection details type Fields struct { Alias string Login string diff --git a/internal/component/create/validate.go b/internal/component/create/validate.go index 9a1bfb9..1872817 100644 --- a/internal/component/create/validate.go +++ b/internal/component/create/validate.go @@ -27,6 +27,7 @@ var ( errPreloadedConnections error ) +// init Loads existing SSH connections at startup func init() { connections, err := kernel.List() if err != nil { @@ -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 @@ -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 { @@ -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 diff --git a/internal/component/list/list.go b/internal/component/list/list.go index 873190b..0edcb78 100644 --- a/internal/component/list/list.go +++ b/internal/component/list/list.go @@ -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 diff --git a/internal/component/output/error.go b/internal/component/output/error.go index f42163a..e1e25c8 100644 --- a/internal/component/output/error.go +++ b/internal/component/output/error.go @@ -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)) diff --git a/internal/component/output/success.go b/internal/component/output/success.go index d44fe18..0206170 100644 --- a/internal/component/output/success.go +++ b/internal/component/output/success.go @@ -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)) diff --git a/internal/component/update/fields.go b/internal/component/update/fields.go index 963defb..3abea67 100644 --- a/internal/component/update/fields.go +++ b/internal/component/update/fields.go @@ -1,5 +1,6 @@ package update +// Fields A struct that update SSH connection details type Fields struct { Alias string Login string diff --git a/internal/component/update/update.go b/internal/component/update/update.go index b746849..61dd317 100644 --- a/internal/component/update/update.go +++ b/internal/component/update/update.go @@ -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 diff --git a/internal/component/update/validate.go b/internal/component/update/validate.go index 211e8aa..803b438 100644 --- a/internal/component/update/validate.go +++ b/internal/component/update/validate.go @@ -27,6 +27,7 @@ var ( errPreloadedConnections error ) +// init Loads existing SSH connections at startup func init() { connections, err := kernel.List() if err != nil { @@ -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 @@ -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 { @@ -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 diff --git a/internal/version/version.go b/internal/version/version.go index 479064b..23c0dc5 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -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