-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: richardli1598 <[email protected]>
- Loading branch information
richardli1598
committed
Oct 3, 2023
1 parent
1b1cb19
commit a45adf8
Showing
7 changed files
with
148 additions
and
30 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
File renamed without changes.
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,26 @@ | ||
package remotesteps | ||
|
||
import "fmt" | ||
|
||
type DockerConfigParameterIn struct { | ||
ServerAddr string `json:"serverAddr" description:"the vps address" required:"true"` | ||
ServerPort int `json:"serverPort" description:"the vps port" required:"true"` | ||
ServerUser string `json:"serverUser" description:"the vps user" required:"true"` | ||
ServerPassword string `json:"serverPassword" description:"the vps password" required:"true"` | ||
} | ||
|
||
func (d DockerConfigParameterIn) Validate() error { | ||
if d.ServerAddr == "" { | ||
return fmt.Errorf("serverAddr is required") | ||
} | ||
if d.ServerPort == 0 { | ||
return fmt.Errorf("serverPort is required") | ||
} | ||
if d.ServerUser == "" { | ||
return fmt.Errorf("serverUser is required") | ||
} | ||
if d.ServerPassword == "" { | ||
return fmt.Errorf("serverPassword is required") | ||
} | ||
return nil | ||
} |
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