Documentation
¶
Overview ¶
Package testnet helps to manage and control current testnets
Index ¶
- type TestNet
- func (tn *TestNet) AddDetails(dd db.DeploymentDetails) error
- func (tn *TestNet) AddNode(node db.Node) int
- func (tn *TestNet) Destroy() error
- func (tn *TestNet) FinishedBuilding()
- func (tn *TestNet) GetFlatClients() []*ssh.Client
- func (tn *TestNet) GetLastestDeploymentDetails() *db.DeploymentDetails
- func (tn *TestNet) GetServer(id int) *db.Server
- func (tn *TestNet) PreOrderNewNodes() map[int][]db.Node
- func (tn *TestNet) PreOrderNodes() map[int][]db.Node
- func (tn *TestNet) Store()
- func (tn *TestNet) StoreNodes(labels []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestNet ¶
type TestNet struct {
TestNetID string
//Servers contains the servers on which the testnet resides
Servers []db.Server
//Nodes contains the active nodes in the network, including the newly built nodes
Nodes []db.Node
//NewlyBuiltNodes contains only the nodes created in the last/in progress build event
NewlyBuiltNodes []db.Node
//Clients is a map of server ids to ssh clients
Clients map[int]*ssh.Client
//BuildState is the build state for the test net
BuildState *state.BuildState
//Details contains all of the past deployments to tn test net
Details []db.DeploymentDetails
//CombinedDetails contains all of the deployments merged into one
CombinedDetails db.DeploymentDetails
//LDD is a pointer to latest deployment details
LDD *db.DeploymentDetails
// contains filtered or unexported fields
}
TestNet represents a testnet and some state on that testnet. Should also contain the details needed to rebuild tn testnet.
func NewTestNet ¶
func NewTestNet(details db.DeploymentDetails, buildID string) (*TestNet, error)
NewTestNet creates a new TestNet
func RestoreTestNet ¶
RestoreTestNet fetches a testnet which already exists.
func (*TestNet) AddDetails ¶
func (tn *TestNet) AddDetails(dd db.DeploymentDetails) error
AddDetails adds the details of a new deployment to the TestNet
func (*TestNet) AddNode ¶
AddNode adds a node to the testnet and returns the new nodes absolute number
func (*TestNet) FinishedBuilding ¶
func (tn *TestNet) FinishedBuilding()
FinishedBuilding empties the NewlyBuiltNodes, signals DoneBuilding on the BuildState, and stores the current data of tn testnet
func (*TestNet) GetFlatClients ¶
GetFlatClients takes the clients map and turns it into an array for easy iterator
func (*TestNet) GetLastestDeploymentDetails ¶
func (tn *TestNet) GetLastestDeploymentDetails() *db.DeploymentDetails
GetLastestDeploymentDetails gets a pointer to the latest deployment details
func (*TestNet) PreOrderNewNodes ¶
PreOrderNewNodes sorts the newly built nodes into buckets by server id
func (*TestNet) PreOrderNodes ¶
PreOrderNodes sorts the nodes into buckets by server id
func (*TestNet) Store ¶
func (tn *TestNet) Store()
Store stores the TestNets data for later retrieval
func (*TestNet) StoreNodes ¶
StoreNodes stores the newly built nodes into the database with their labels.