Documentation
¶
Overview ¶
Handles functions related to the current state of the network
Index ¶
- func CheckBuildStatus(buildId string) (string, error)
- func FindNodeIndex(status []NodeStatus, name string, serverId int) int
- func GetClient(id int) (*ssh.Client, error)
- func GetClients(servers []int) ([]*ssh.Client, error)
- func GetClientsFromNodes(nodes []db.Node) ([]*ssh.Client, error)
- func GetLatestServers(testnetId string) ([]db.Server, error)
- func GetNextTestNetId() (string, error)
- type BuildStatus
- type Comp
- type NodeStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckBuildStatus ¶
Check the current status of the build
func FindNodeIndex ¶
func FindNodeIndex(status []NodeStatus, name string, serverId int) int
Finds the index of a node by name and server id
func GetClient ¶
GetClient retrieves the ssh client for running a command on a remote server based on server id. It will create one if it does not exist.
func GetClients ¶
GetClients functions similar to GetClient, except that it takes in an array of server ids and outputs an array of clients
func GetLatestServers ¶
Get the servers used in the latest testnet, populated with the ips of all the nodes
func GetNextTestNetId ¶
GetNextTestNetId gets the next testnet id. Used for getting the id of a testnet that is in progress of being built
Types ¶
type BuildStatus ¶
type BuildStatus struct {
Error state.CustomError `json:"error"`
Progress float64 `json:"progress"`
Stage string `json:"stage"`
Frozen bool `json:"frozen"`
}
type Comp ¶
type NodeStatus ¶
type NodeStatus struct {
Name string `json:"name"`
Server int `json:"server"`
Ip string `json:"ip"`
Up bool `json:"up"`
Resources Comp `json:"resourceUse"`
}
Represents the status of the node
func CheckNodeStatus ¶
func CheckNodeStatus(nodes []db.Node) ([]NodeStatus, error)
Checks the status of the nodes in the current testnet