server

package
v0.0.0-...-f3dc6f7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2015 License: MIT Imports: 20 Imported by: 0

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
}

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 FailedSqlStmt

type FailedSqlStmt struct {
	Sql   string `json:"sql"`
	Error string `json:"error"`
}

type QueryResponse

type QueryResponse struct {
	Time     string          `json:"time"`
	Failures []FailedSqlStmt `json:"failures"`
	Rows     db.RowResults   `json:"rows"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(dataDir string, dbfile string, snapAfter int, host string, port int) *Server

NewServer creates a new server.

func (*Server) GetStatistics

func (s *Server) GetStatistics() (metrics.Registry, error)

GetStatistics returns an object storing statistics, which supports JSON marshalling.

func (*Server) HandleFunc

func (s *Server) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))

This is a hack around Gorilla mux not providing the correct net/http HandleFunc() interface.

func (*Server) Join

func (s *Server) Join(leader string) error

Joins to the leader of an existing cluster.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(leader string) error

ListenAndServe starts the server.

type ServerDiagnostics

type ServerDiagnostics struct {
	// contains filtered or unexported fields
}

func NewServerDiagnostics

func NewServerDiagnostics() *ServerDiagnostics

NewServerDiagnostics creates a new ServerDiagnostics object.

type ServerMetrics

type ServerMetrics struct {
	// contains filtered or unexported fields
}

func NewServerMetrics

func NewServerMetrics() *ServerMetrics

NewServerMetrics creates a new ServerMetrics object.

type SnapshotConf

type SnapshotConf struct {
	// contains filtered or unexported fields
}

type StmtResponse

type StmtResponse struct {
	Time     string          `json:"time"`
	Failures []FailedSqlStmt `json:"failures"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL