Proto commits in nats-io/graft

These 5 commits are when the Protocol Buffers files have changed:

Commit:348798a
Author:Derek Collison

Updates for protobufs, nats client, staticcheck fixes. Resolves #22 Signed-off-by: Derek Collison <derek@nats.io>

The documentation is generated from this commit.

Commit:811c6fb
Author:Derek Collison

Update license to Apache 2

Commit:6692c9d
Author:Tyler Treat

Rename LogPositionHandler to StateMachineHandler

Commit:191f6be
Author:Tyler Treat

Add external state support Add support for external state (log) to influence leader voting. This, in effect, implements lastLogIndex and lastLogTerm sent on RequestVote RPCs from the Raft paper. This works by exposing two callbacks: one that calls into the user on RequestVote to get the candidate's state and one that calls into the user upon receiving a RequestVote to determine if a vote should be granted based on comparing the logs. From Raft: 1. Reply false if term < currentTerm (§5.1) 2. If votedFor is null or candidateId, and candidate’s log is at least as up-to-date as receiver’s log, grant vote (§5.2, §5.4)

Commit:1a9273a
Author:Ivan Kozlovic
Committer:Ivan Kozlovic

[UPDATED] Use Protobuf instead of JSON Use Protobuf for VoteRequest, VoteResponse and HearBeat. In this PR the state is not yet using Protobuf. Resolves #9