mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-20 13:00:24 +08:00
阶段性提交
This commit is contained in:
@@ -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, "\", \"") + "\""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user