rpc

package
v0.0.0-...-bccea44 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2017 License: MIT Imports: 0 Imported by: 6

Documentation

Overview

rpc defines all the RPC interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupService

type BackupService interface {
	Prepare(args *PrepareArgs, resp *PrepareOk) error
}

type Commit

type Commit struct {
	ViewNum   int
	CommitNum int
}

Commit is sent by primary if no new Prepare message is being sent

type DoViewChangeArgs

type DoViewChangeArgs struct {
	ViewNum             int
	Log                 []OpRequest
	LatestNormalViewNum int
	OpNum               int
	CommitNum           int
	Id                  int
}

DoViewChangeArgs is the arguments to tell the new primary to start a new view.

type DoViewChangeResp

type DoViewChangeResp struct {
}

DoViewChangeResp is the response to a DoViewChange message.

type OpRequest

type OpRequest struct {
	Request Request
	OpNum   int
}

OpRequest represents an operation record that has a Request and a operation number.

type Operation

type Operation struct {
	Message string
}

Operation is the user operation.

type OperationResult

type OperationResult struct {
	Message string
}

OperationResult is the result of the user operation.

type PrepareArgs

type PrepareArgs struct {
	ViewNum   int
	Request   Request
	OpNum     int
	CommitNum int
}

Prepare is the input argument type to Echo.

type PrepareOk

type PrepareOk struct {
	ViewNum int
	OpNum   int
	Id      int
}

PrepareOk is the output type of Prepare.

type RecoveryRequest

type RecoveryRequest struct {
	Id    int
	Nonce int
}

RecoveryRequest is the request to start a recovery.

type RecoveryResponse

type RecoveryResponse struct {
	ViewNum   int
	Nonce     int
	Log       []OpRequest
	OpNum     int
	CommitNum int
	Id        int
	Mode      string
}

RecoveryRequest is the response to a recovery request.

type RecoveryService

type RecoveryService interface {
	Recover(request *RecoveryRequest, response *RecoveryResponse) error
}

RecoveryService is the RPC to perform a recovery.

type Request

type Request struct {
	Op         Operation
	ClientId   int
	RequestNum int
}

Request is the input argument type to RequestRPC.

type Response

type Response struct {
	ViewNum    int
	RequestNum int
	OpResult   OperationResult
	Err        string
}

Response is the output type of RequestRPC.

type StartViewArgs

type StartViewArgs struct {
	ViewNum   int
	Log       []OpRequest
	OpNum     int
	CommitNum int
}

StartViewArgs is the arguments for the primary to start a new view.

type StartViewChangeArgs

type StartViewChangeArgs struct {
	ViewNum int
	Id      int
}

StartViewChangeArgs is the arguments to start a view change.

type StartViewChangeResp

type StartViewChangeResp struct {
}

StartViewChangeResp is the response to a StartViewChange message.

type StartViewResp

type StartViewResp struct {
}

StartViewResp is the response to a StartView message.

type ViewService

type ViewService interface {
	// StartViewChange initiates a view change.
	StartViewChange(*StartViewChangeArgs, *StartViewChangeResp) error
	// DoViewChange tells the new primary to start a new view.
	DoViewChange(*DoViewChangeArgs, *DoViewChangeResp) error
	// StartView tells the backups to transition to a new view.
	StartView(*StartViewArgs, *StartViewResp) error
}

ViewService is the RPC to perform a view change.

type VrgoService

type VrgoService interface {
	Execute(*Request, *Response) error
}

VrgoService defines the APIs Vrgo exposes to users.

Jump to

Keyboard shortcuts

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