阶段性提交

This commit is contained in:
GoEdgeLab
2020-09-13 20:37:28 +08:00
parent 84868c1a0b
commit dc79c661d7
89 changed files with 1364 additions and 12899 deletions

View File

@@ -1,15 +1,18 @@
package installers
import "errors"
import (
"errors"
"strings"
)
type NodeParams struct {
Endpoint string
NodeId string
Secret string
Endpoints []string
NodeId string
Secret string
}
func (this *NodeParams) Validate() error {
if len(this.Endpoint) == 0 {
if len(this.Endpoints) == 0 {
return errors.New("'endpoint' should not be empty")
}
if len(this.NodeId) == 0 {
@@ -20,3 +23,10 @@ func (this *NodeParams) Validate() error {
}
return nil
}
func (this *NodeParams) QuoteEndpoints() string {
if len(this.Endpoints) == 0 {
return ""
}
return "\"" + strings.Join(this.Endpoints, "\", \"") + "\""
}