Documentation ¶
Index ¶
Constants ¶
const DatabaseEndpoint = "/internal/database"
DatabaseEndpoint specifies the API endpoint path that gets routed to a dqlite server handler for performing SQL queries against the dqlite server running on this node.
const Interval = 4
Interval represents the number of seconds to wait between to heartbeat rounds.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertConfig ¶
type CertConfig interface { // Read returns a TLS configuration suitable for establishing inter-node // network connections using the cluster certificate. Read(*cert.Info) (*tls.Config, error) }
CertConfig manages reading a certificate information and convert it into a tls.Config.
type Cluster ¶
type Cluster interface { db.ClusterTransactioner }
Cluster mediates access to data stored in the cluster dqlite database.
type Gateway ¶
type Gateway interface { // RaftNodes returns information about the nodes that a currently part of // the raft cluster, as configured in the raft log. It returns an error if this // node is not the leader. RaftNodes() ([]db.RaftNode, error) // DB returns the database node of the cluster DB() Node // Cert returns the gateway certificate information Cert() *cert.Info // Clustered returns if the Gateway is a raft node or is not clustered Clustered() bool }
Gateway mediates access to the dqlite cluster using a gRPC SQL client, and possibly runs a dqlite replica on this node (if we're configured to do so).
type Heartbeat ¶
type Heartbeat struct {
// contains filtered or unexported fields
}
Heartbeat performs leader-initiated heartbeat checks against all nodes in the cluster.
type Node ¶
type Node interface { db.NodeTransactioner }
Node mediates access to the data stored in the node-local SQLite database.
type Option ¶
type Option func(*options)
Option to be passed to Connect to customize the resulting instance.
func WithLogger ¶
WithLogger sets the logger on the option