system

package
v3.14.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package system supports running end-to-end type testing of rqlite

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoJoinRequest

func DoJoinRequest(nodeAddr, raftAddr string) (*http.Response, error)

DoJoinRequest sends a join request to nodeAddr, for raftAddr.

func Remove

func Remove(n *Node, addr string) error

Remove tells the cluster at n to remove the node at addr. Assumes n is the leader.

Types

type Cluster

type Cluster []*Node

Cluster represents a cluster of nodes.

func (Cluster) Deprovision

func (c Cluster) Deprovision()

Deprovision deprovisions every node in the cluster.

func (Cluster) FindNodeByRaftAddr

func (c Cluster) FindNodeByRaftAddr(addr string) (*Node, error)

FindNodeByRaftAddr returns the node with the given Raft address.

func (Cluster) Followers

func (c Cluster) Followers() ([]*Node, error)

Followers returns the slice of nodes in the cluster that are followers.

func (Cluster) Leader

func (c Cluster) Leader() (*Node, error)

Leader returns the leader node of a cluster.

func (Cluster) RemoveNode

func (c Cluster) RemoveNode(node *Node)

RemoveNode removes the given node from the list of nodes representing a cluster.

func (Cluster) WaitForNewLeader

func (c Cluster) WaitForNewLeader(old *Node) (*Node, error)

WaitForNewLeader waits for the leader to change from the node passed in.

type Node

type Node struct {
	APIAddr  string
	RaftAddr string
	Dir      string
	Store    *store.Store
	Service  *httpd.Service
}

Node represents a node under test.

func (*Node) ConfirmRedirect

func (n *Node) ConfirmRedirect(host string) bool

ConfirmRedirect confirms that the node responds with a redirect to the given host.

func (*Node) Deprovision

func (n *Node) Deprovision()

Deprovision shuts down and removes all resources associated with the node.

func (*Node) Execute

func (n *Node) Execute(stmt string) (string, error)

Execute executes a single statement against the node.

func (*Node) ExecuteMulti

func (n *Node) ExecuteMulti(stmts []string) (string, error)

ExecuteMulti executes multiple statements against the node.

func (*Node) Join

func (n *Node) Join(leader *Node) error

Join instructs this node to join the leader.

func (*Node) Query

func (n *Node) Query(stmt string) (string, error)

Query runs a single query against the node.

func (*Node) SameAs

func (n *Node) SameAs(o *Node) bool

SameAs returns true if this node is the same as node o.

func (*Node) WaitForLeader

func (n *Node) WaitForLeader() (string, error)

WaitForLeader blocks for up to 10 seconds until the node detects a leader.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL