Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster interface { db.ClusterTransactioner // EnterExclusive acquires a lock on the cluster db, so any successive call to // Transaction will block until ExitExclusive has been called. EnterExclusive() error // ExitExclusive runs the given transaction and then releases the lock acquired // with EnterExclusive. ExitExclusive(func(*db.ClusterTx) error) error // NodeID sets the the node NodeID associated with this cluster instance. It's used for // backward-compatibility of all db-related APIs that were written before // clustering and don't accept a node NodeID, so in those cases we automatically // use this value as implicit node NodeID. NodeID(int64) }
Cluster mediates access to data stored in the cluster dqlite database.
type Node ¶
type Node interface { db.NodeTransactioner }
Node mediates access to the data stored in the node-local SQLite database.
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier is a function that invokes the given function against each node in the cluster excluding the invoking one.
type Option ¶
type Option func(*options)
Option to be passed to Connect to customize the resulting instance.
func WithHTTPClient ¶
WithHTTPClient sets the httpClient on the option
func WithLogger ¶
WithLogger sets the logger on the option
type Policy ¶
type Policy int
Policy can be used to tweak the behavior of NewNotifier in case of some nodes are down.
type State ¶
type State interface { // Node returns the underlying Node Node() Node // Cluster returns the underlying Cluster Cluster() Cluster }
State is a gateway to the two main stateful components, the database and the operating system. It's typically used by model entities in order to perform changes.