Documentation ¶
Overview ¶
Package system supports running end-to-end type testing of rqlite
Index ¶
- Constants
- Variables
- func PostExecuteStmt(apiAddr string, stmt string) (string, error)
- func PostExecuteStmtMulti(apiAddr string, stmts []string) (string, error)
- func Remove(n *Node, addr string) error
- type Cluster
- type Node
- func (n *Node) Backup(filename string, compress bool) error
- func (n *Node) Boot(filename string) (string, error)
- func (n *Node) Close(graceful bool) error
- func (n *Node) ConfirmRedirect(host string) bool
- func (n *Node) Deprovision()
- func (n *Node) EnableTLSClient()
- func (n *Node) Execute(stmt string) (string, error)
- func (n *Node) ExecuteMulti(stmts []string) (string, error)
- func (n *Node) ExecuteParameterized(stmt []interface{}) (string, error)
- func (n *Node) ExecuteQueued(stmt string, wait bool) (string, error)
- func (n *Node) ExecuteQueuedMulti(stmts []string, wait bool) (string, error)
- func (n *Node) Expvar() (string, error)
- func (n *Node) ExpvarKey(k string) (string, error)
- func (n *Node) IsVoter() (bool, error)
- func (n *Node) Join(leader *Node) error
- func (n *Node) JoinAsNonVoter(leader *Node) error
- func (n *Node) Liveness() (bool, error)
- func (n *Node) Load(filename string) (string, error)
- func (n *Node) Nodes(includeNonVoters bool) (httpd.Nodes, error)
- func (n *Node) Noop(id string) error
- func (n *Node) Notify(id, raftAddr string) error
- func (n *Node) Query(stmt string) (string, error)
- func (n *Node) QueryMulti(stmts []string) (string, error)
- func (n *Node) QueryNoneConsistency(stmt string) (string, error)
- func (n *Node) QueryParameterized(stmt []interface{}) (string, error)
- func (n *Node) QueryStrongConsistency(stmt string) (string, error)
- func (n *Node) QueryWithBlobArray(stmt string) (string, error)
- func (n *Node) QueryWithTimeout(stmt string, timeout time.Duration) (string, error)
- func (n *Node) Ready() (bool, error)
- func (n *Node) Request(stmt string) (string, error)
- func (n *Node) RequestMulti(stmts []string) (string, error)
- func (n *Node) RequestMultiParameterized(stmt []interface{}) (string, error)
- func (n *Node) SameAs(o *Node) bool
- func (n *Node) Status() (string, error)
- func (n *Node) WaitForLeader() (string, error)
Constants ¶
const ( // SnapshotInterval is the period between snapshot checks SnapshotInterval = time.Second // SnapshotThreshold is the number of outstanding log entries before a snapshot is triggered SnapshotThreshold = 100 // ElectionTimeout is the period between elections. It's longer than // the default to allow for slow CI systems. ElectionTimeout = 2 * time.Second NoQueryTimeout = 0 )
Variables ¶
var ( // QueuedResponseRegex is the regex for matching Queued Write responses QueuedResponseRegex = regexp.MustCompile(`^{"results":\[\],"sequence_number":\d+}$`) )
Functions ¶
func PostExecuteStmt ¶
PostExecuteStmt performs a HTTP execute request
func PostExecuteStmtMulti ¶
PostExecuteStmtMulti performs a HTTP batch execute request
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 ¶
FindNodeByRaftAddr returns the node with the given Raft address.
func (Cluster) RemoveNode ¶
RemoveNode removes the given node from the list of nodes representing a cluster.
type Node ¶
type Node struct { APIAddr string RaftAddr string ID string Dir string NodeCertPath string NodeKeyPath string HTTPCertPath string HTTPKeyPath string TLSConfig *tls.Config PeersPath string Store *store.Store Service *httpd.Service Cluster *cluster.Service Client *cluster.Client }
Node represents a node under test.
func (*Node) ConfirmRedirect ¶
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) EnableTLSClient ¶
func (n *Node) EnableTLSClient()
EnableTLSClient enables TLS support for the node's cluster client.
func (*Node) ExecuteMulti ¶
ExecuteMulti executes multiple statements against the node.
func (*Node) ExecuteParameterized ¶
ExecuteParameterized executes a single parameterized query against the node
func (*Node) ExecuteQueued ¶
ExecuteQueued sends a single statement to the node's Execute queue
func (*Node) ExecuteQueuedMulti ¶
ExecuteQueuedMulti sends multiple statements to the node's Execute queue
func (*Node) JoinAsNonVoter ¶
JoinAsNonVoter instructs this node to join the leader, but as a non-voting node.
func (*Node) Liveness ¶
Liveness returns the liveness status for the node, primarily for use by Kubernetes.
func (*Node) QueryMulti ¶
QueryMulti runs multiple queries against the node.
func (*Node) QueryNoneConsistency ¶
QueryNoneConsistency runs a single query against the node, with no read consistency.
func (*Node) QueryParameterized ¶
QueryParameterized run a single parameterized query against the node
func (*Node) QueryStrongConsistency ¶
QueryStrongConsistency runs a single query against the node, with Strong read consistency.
func (*Node) QueryWithBlobArray ¶ added in v8.22.0
QueryWithBlobArray runs a single query against the node, with BLOB byte array support.
func (*Node) QueryWithTimeout ¶ added in v8.19.0
QueryWithTimeout runs a single query against the node, with a timeout.
func (*Node) RequestMulti ¶
RequestMulti runs multiple statements in a single request against the node.
func (*Node) RequestMultiParameterized ¶
RequestMultiParameterized runs a single parameterized request against the node
func (*Node) WaitForLeader ¶
WaitForLeader blocks for up to 10 seconds until the node detects a leader.