Initial commit (code only without large binaries)

This commit is contained in:
robin
2026-02-15 18:58:44 +08:00
commit 35df75498f
9442 changed files with 1495866 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package installers
import (
"errors"
"strings"
)
type NodeParams struct {
Endpoints []string
NodeId string
Secret string
IsUpgrading bool // 是否为升级
}
func (this *NodeParams) Validate() error {
if len(this.Endpoints) == 0 {
return errors.New("'endpoint' should not be empty")
}
if len(this.NodeId) == 0 {
return errors.New("'nodeId' should not be empty")
}
if len(this.Secret) == 0 {
return errors.New("'secret' should not be empty")
}
return nil
}
func (this *NodeParams) QuoteEndpoints() string {
if len(this.Endpoints) == 0 {
return ""
}
return "\"" + strings.Join(this.Endpoints, "\", \"") + "\""
}