Documentation ¶
Index ¶
- type DB
- func (db *DB) Accept(conn net.Conn)
- func (db *DB) Bootstrap(extensions extensions.Extensions, project string, addr api.URL, ...) error
- func (db *DB) Cluster(ctx context.Context, client *dqliteClient.Client) ([]dqliteClient.NodeInfo, error)
- func (db *DB) IsOpen() bool
- func (db *DB) Join(extensions extensions.Extensions, project string, addr api.URL, ...) error
- func (db *DB) Leader(ctx context.Context) (*dqliteClient.Client, error)
- func (db *DB) NotifyUpgraded()
- func (db *DB) Open(ext extensions.Extensions, bootstrap bool, project string) error
- func (db *DB) Schema() *update.SchemaUpdate
- func (db *DB) SetSchema(schemaExtensions []schema.Update)
- func (db *DB) StartWithCluster(extensions extensions.Extensions, project string, addr api.URL, ...) error
- func (db *DB) Stop() error
- func (db *DB) Transaction(outerCtx context.Context, f func(context.Context, *sql.Tx) error) error
- func (db *DB) Update() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB holds all information internal to the dqlite database.
func NewDB ¶
func NewDB(ctx context.Context, serverCert *shared.CertInfo, clusterCert func() *shared.CertInfo, os *sys.OS) *DB
NewDB creates an empty db struct with no dqlite connection.
func (*DB) Accept ¶
Accept sends the outbound connection through the acceptCh channel to be received by dqlite.
func (*DB) Bootstrap ¶
func (db *DB) Bootstrap(extensions extensions.Extensions, project string, addr api.URL, clusterRecord cluster.InternalClusterMember) error
Bootstrap dqlite.
func (*DB) Cluster ¶
func (db *DB) Cluster(ctx context.Context, client *dqliteClient.Client) ([]dqliteClient.NodeInfo, error)
Cluster returns information about dqlite cluster members.
func (*DB) Join ¶
func (db *DB) Join(extensions extensions.Extensions, project string, addr api.URL, joinAddresses ...string) error
Join a dqlite cluster with the address of a member.
func (*DB) NotifyUpgraded ¶
func (db *DB) NotifyUpgraded()
NotifyUpgraded sends a notification that we can stop waiting for a cluster member to be upgraded.
func (*DB) Open ¶
func (db *DB) Open(ext extensions.Extensions, bootstrap bool, project string) error
Open opens the dqlite database and loads the schema. Returns true if we need to wait for other nodes to catch up to our version.
func (*DB) Schema ¶
func (db *DB) Schema() *update.SchemaUpdate
func (*DB) StartWithCluster ¶
func (db *DB) StartWithCluster(extensions extensions.Extensions, project string, addr api.URL, clusterMembers map[string]types.AddrPort) error
StartWithCluster starts up dqlite and joins the cluster.
func (*DB) Transaction ¶
Transaction handles performing a transaction on the dqlite database.