Documentation ¶
Index ¶
- Constants
- Variables
- func IsGrantError(err error) bool
- type BaseInstaller
- type Credentials
- type DeployFile
- type DeployManager
- func (this *DeployManager) FindNSNodeFile(os string, arch string) *DeployFile
- func (this *DeployManager) FindNodeFile(os string, arch string) *DeployFile
- func (this *DeployManager) LoadNSNodeFiles() []*DeployFile
- func (this *DeployManager) LoadNodeFiles() []*DeployFile
- func (this *DeployManager) Reload()
- type Env
- type GrantError
- type InstallerInterface
- type NodeInstaller
- type NodeParams
- type NodeQueue
- type SSHClient
- func (this *SSHClient) Chmod(path string, mode os.FileMode) error
- func (this *SSHClient) Close() error
- func (this *SSHClient) Copy(localPath string, remotePath string, mode os.FileMode) error
- func (this *SSHClient) Dial(network string, addr string) (net.Conn, error)
- func (this *SSHClient) Exec(cmd string) (stdout string, stderr string, err error)
- func (this *SSHClient) Listen(network string, addr string) (net.Listener, error)
- func (this *SSHClient) Mkdir(path string) error
- func (this *SSHClient) MkdirAll(path string) error
- func (this *SSHClient) NewSession() (*ssh.Session, error)
- func (this *SSHClient) OpenFile(path string, flags int) (*sftp.File, error)
- func (this *SSHClient) ReadFile(path string) ([]byte, error)
- func (this *SSHClient) Remove(path string) error
- func (this *SSHClient) Stat(path string) (os.FileInfo, error)
- func (this *SSHClient) Sudo(password string)
- func (this *SSHClient) User() string
- func (this *SSHClient) UserHome() string
- func (this *SSHClient) WriteFile(path string, data []byte) (n int, err error)
- type UpgradeLimiter
Constants ¶
View Source
const ( UpgradeLimiterDuration = 10 // node key expire time, by seconds UpgradeLimiterConcurrent = 10 // 10 nodes UpgradeLimiterMaxBytesPerSecond = 5 * sizes.M // max bytes per second )
Variables ¶
Functions ¶
func IsGrantError ¶ added in v0.5.3
Types ¶
type BaseInstaller ¶
type BaseInstaller struct {
// contains filtered or unexported fields
}
func (*BaseInstaller) InstallHelper ¶
func (this *BaseInstaller) InstallHelper(targetDir string, role nodeconfigs.NodeRole) (env *Env, err error)
InstallHelper 上传安装助手
func (*BaseInstaller) Login ¶
func (this *BaseInstaller) Login(credentials *Credentials) error
Login 登录SSH服务
func (*BaseInstaller) LookupLatestInstaller ¶
func (this *BaseInstaller) LookupLatestInstaller(filePrefix string) (string, error)
LookupLatestInstaller 查找最新的版本的文件
type Credentials ¶
type DeployFile ¶
DeployFile 部署文件描述
type DeployManager ¶
type DeployManager struct {
// contains filtered or unexported fields
}
DeployManager 节点部署文件管理器 如果节点部署文件有变化,需要重启API节点以便于生效
func (*DeployManager) FindNSNodeFile ¶
func (this *DeployManager) FindNSNodeFile(os string, arch string) *DeployFile
FindNSNodeFile 查找特别平台的NS节点安装文件
func (*DeployManager) FindNodeFile ¶
func (this *DeployManager) FindNodeFile(os string, arch string) *DeployFile
FindNodeFile 查找特别平台的节点文件
func (*DeployManager) LoadNSNodeFiles ¶
func (this *DeployManager) LoadNSNodeFiles() []*DeployFile
LoadNSNodeFiles 加载所有NS节点安装文件
func (*DeployManager) LoadNodeFiles ¶
func (this *DeployManager) LoadNodeFiles() []*DeployFile
LoadNodeFiles 加载所有边缘节点文件
type GrantError ¶ added in v0.5.3
type GrantError struct {
// contains filtered or unexported fields
}
func (*GrantError) Error ¶ added in v0.5.3
func (this *GrantError) Error() string
func (*GrantError) String ¶ added in v0.5.3
func (this *GrantError) String() string
type InstallerInterface ¶
type InstallerInterface interface { // 登录SSH服务 Login(credentials *Credentials) error // 安装 Install(dir string, params interface{}, installStatus *models.NodeInstallStatus) error // 关闭连接的SSH服务 Close() error }
type NodeInstaller ¶
type NodeInstaller struct {
BaseInstaller
}
func (*NodeInstaller) Install ¶
func (this *NodeInstaller) Install(dir string, params interface{}, installStatus *models.NodeInstallStatus) error
type NodeParams ¶
func (*NodeParams) QuoteEndpoints ¶
func (this *NodeParams) QuoteEndpoints() string
func (*NodeParams) Validate ¶
func (this *NodeParams) Validate() error
type NodeQueue ¶
type NodeQueue struct { }
func NewNodeQueue ¶
func NewNodeQueue() *NodeQueue
func SharedNodeQueue ¶
func SharedNodeQueue() *NodeQueue
func (*NodeQueue) InstallNode ¶
func (this *NodeQueue) InstallNode(nodeId int64, installStatus *models.NodeInstallStatus, isUpgrading bool) error
InstallNode 安装边缘节点
func (*NodeQueue) InstallNodeProcess ¶
InstallNodeProcess 安装边缘节点流程控制
type SSHClient ¶
type SSHClient struct {
// contains filtered or unexported fields
}
func (*SSHClient) NewSession ¶
NewSession 获取新Session
type UpgradeLimiter ¶ added in v0.4.9
type UpgradeLimiter struct {
// contains filtered or unexported fields
}
UpgradeLimiter 升级流量管理器
func NewUpgradeLimiter ¶ added in v0.4.9
func NewUpgradeLimiter() *UpgradeLimiter
func (*UpgradeLimiter) CanUpgrade ¶ added in v0.4.9
func (this *UpgradeLimiter) CanUpgrade() bool
CanUpgrade 检查是否有新的升级
func (*UpgradeLimiter) UpdateNodeBytes ¶ added in v0.4.9
func (this *UpgradeLimiter) UpdateNodeBytes(nodeType nodeconfigs.NodeRole, nodeId int64, bytes int64)
UpdateNodeBytes 添加正在下载的节点流量
Source Files ¶
Click to show internal directories.
Click to hide internal directories.