Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

Commit

Permalink
Additional documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
JensRantil committed Nov 24, 2013
1 parent fdd1851 commit 3bbf4cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ type event struct {
//
//------------------------------------------------------------------------------

// Creates a new server with a log at the given path.
// Creates a new server with a log at the given path. transporter must
// not be nil. stateMachine can be nil if snapshotting and log
// compaction is to be disabled. context can be anything (including nil)
// and is not used by the raft package except returned by
// Server.Context(). connectionString can be anything.
func NewServer(name string, path string, transporter Transporter, stateMachine StateMachine, context interface{}, connectionString string) (Server, error) {
if name == "" {
return nil, errors.New("raft.Server: Name cannot be blank")
Expand Down
3 changes: 2 additions & 1 deletion statemachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ package raft
//------------------------------------------------------------------------------

// StateMachine is the interface for allowing the host application to save and
// recovery the state machine
// recovery the state machine. This makes it possible to make snapshots
// and compact the log.
type StateMachine interface {
Save() ([]byte, error)
Recovery([]byte) error
Expand Down

0 comments on commit 3bbf4cb

Please sign in to comment.