-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create SSHTask type. Load SSHTask objects into Konnect.
- Loading branch information
Sandeep Jadoonanan
committed
Nov 12, 2017
1 parent
b1a7c10
commit ac07067
Showing
7 changed files
with
92 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package task | ||
|
||
import "fmt" | ||
|
||
// type SSHTask string | ||
type SSHTask struct { | ||
Command string | ||
Name string | ||
} | ||
|
||
// String representation of an SSHTask object. | ||
func (t *SSHTask) String() string { | ||
return fmt.Sprintf("<SSHTask %v: %v>", t.Name, t.Command) | ||
} | ||
|
||
// Info - Return info for an SSHTask object. | ||
func (t *SSHTask) Info() string { | ||
return fmt.Sprintf("[%v]\n"+ | ||
" Command: %v\n", | ||
t.Name, t.Command) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package task | ||
|
||
// New - Create a new SSHTask object with given values. | ||
func New(name, command string) *SSHTask { | ||
return &SSHTask{ | ||
Name: name, | ||
Command: command, | ||
} | ||
} |