Skip to content

Commit bd1894d

Browse files
Merge pull request #186 from misha-ssh/add-doc-block
Add doc block
2 parents 4eecec0 + 19f24a2 commit bd1894d

11 files changed

Lines changed: 16 additions & 0 deletions

File tree

cmd/misha/README.md

Whitespace-only changes.

internal/component/create/create.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ var (
1818
errConvertPort = errors.New(`cannot convert port`)
1919
)
2020

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

internal/component/create/fields.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package create
22

3+
// Fields A struct that stores SSH connection details
34
type Fields struct {
45
Alias string
56
Login string

internal/component/create/validate.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var (
2727
errPreloadedConnections error
2828
)
2929

30+
// init Loads existing SSH connections at startup
3031
func init() {
3132
connections, err := kernel.List()
3233
if err != nil {
@@ -36,6 +37,7 @@ func init() {
3637
preloadedConnections = connections
3738
}
3839

40+
// aliasValidate validate on exists alias
3941
func aliasValidate(alias string) error {
4042
if strings.TrimSpace(alias) == "" || alias == "" {
4143
return errAliasIsNotEmpty
@@ -54,6 +56,7 @@ func aliasValidate(alias string) error {
5456
return nil
5557
}
5658

59+
// portValidate validate on correctly port
5760
func portValidate(s string) error {
5861
port, err := strconv.Atoi(s)
5962
if err != nil {
@@ -67,6 +70,7 @@ func portValidate(s string) error {
6770
return nil
6871
}
6972

73+
// privateKeyValidate validate on exists file
7074
func privateKeyValidate(filename string) error {
7175
if strings.TrimSpace(filename) == "" || filename == "" {
7276
return nil

internal/component/list/list.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var (
1111
errNotFoundConnections = errors.New("not found connections")
1212
)
1313

14+
// Run Get selected connection from list
1415
func Run(connections *connect.Connections) (*connect.Connect, error) {
1516
var aliases []string
1617
var selectedAlias string

internal/component/output/error.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var (
66
ErrorColor = lipgloss.Color("#FF0000")
77
)
88

9+
// Error get message line for erros
910
func Error(s string) {
1011
style := lipgloss.NewStyle().Foreground(ErrorColor)
1112
println(style.Render(s))

internal/component/output/success.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var (
66
successColor = lipgloss.Color("#04B575")
77
)
88

9+
// Success get message lin for success operations
910
func Success(s string) {
1011
style := lipgloss.NewStyle().Foreground(successColor)
1112
println(style.Render(s))

internal/component/update/fields.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package update
22

3+
// Fields A struct that update SSH connection details
34
type Fields struct {
45
Alias string
56
Login string

internal/component/update/update.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ var (
1515
errConvertPort = errors.New(`cannot convert port`)
1616
)
1717

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

internal/component/update/validate.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var (
2727
errPreloadedConnections error
2828
)
2929

30+
// init Loads existing SSH connections at startup
3031
func init() {
3132
connections, err := kernel.List()
3233
if err != nil {
@@ -36,6 +37,7 @@ func init() {
3637
preloadedConnections = connections
3738
}
3839

40+
// aliasValidate validate on exists alias
3941
func aliasValidate(alias string) error {
4042
if strings.TrimSpace(alias) == "" || alias == "" {
4143
return errAliasIsNotEmpty
@@ -54,6 +56,7 @@ func aliasValidate(alias string) error {
5456
return nil
5557
}
5658

59+
// portValidate validate on correctly port
5760
func portValidate(s string) error {
5861
port, err := strconv.Atoi(s)
5962
if err != nil {
@@ -67,6 +70,7 @@ func portValidate(s string) error {
6770
return nil
6871
}
6972

73+
// privateKeyValidate validate on exists file
7074
func privateKeyValidate(filename string) error {
7175
if strings.TrimSpace(filename) == "" || filename == "" {
7276
return nil

0 commit comments

Comments
 (0)