Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DbStateMachine ¶
type DbStateMachine struct {
// contains filtered or unexported fields
}
DbStateMachine contains the DB path.
func NewDbStateMachine ¶
func NewDbStateMachine(path string) *DbStateMachine
NewDbStateMachine returns a StateMachine for capturing and restoring the state of an sqlite database.
func (*DbStateMachine) Recovery ¶
func (d *DbStateMachine) Recovery(b []byte) error
Recovery restores the state of the database using the given data.
func (*DbStateMachine) Save ¶
func (d *DbStateMachine) Save() ([]byte, error)
Save captures the state of the database. The caller must ensure that no transaction is taking place during this call.
http://sqlite.org/howtocorrupt.html states it is safe to do this as long as no transaction is in progress.
type Diagnostics ¶
type Diagnostics struct {
// contains filtered or unexported fields
}
Diagnostics contains a start time of the server.
func NewDiagnostics ¶
func NewDiagnostics() *Diagnostics
NewDiagnostics creates a new Diagnostics object.
type FailedSqlStmt ¶
FailedSqlStmt contains a SQL query and an error.
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics are the server metrics user for statistics.
type QueryResponse ¶
type QueryResponse struct { Time string `json:"time,omitempty"` Failures []FailedSqlStmt `json:"failures"` Rows db.RowResults `json:"rows"` }
QueryResponse contains the response to a query.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is is a combination of the Raft server and an HTTP server which acts as the transport.
func (*Server) GetStatistics ¶
GetStatistics returns an object storing statistics, which supports JSON marshalling.
func (*Server) HandleFunc ¶
HandleFunc is a hack around Gorilla mux not providing the correct net/http HandleFunc() interface.
func (*Server) ListenAndServe ¶
ListenAndServe starts the server.
type SnapshotConf ¶
type SnapshotConf struct {
// contains filtered or unexported fields
}
SnapshotConf contains the index when the last snapshot happened and a threshold for index entries since the last snapshot.
type StmtResponse ¶
type StmtResponse struct { Time string `json:"time,omitempty"` Failures []FailedSqlStmt `json:"failures"` }
StmtResponse contains a date and a list of failed SQL statements.