rpctrans

package module
v0.0.0-...-36943d7 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: MIT Imports: 12 Imported by: 0

README

RpcTrans

GoDoc Widget Go Report Card Widget

Introduction

RpcTrans implementation raft transport

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InstallSnapshotRequest

type InstallSnapshotRequest struct {
	*raft.InstallSnapshotRequest
	Data json.RawMessage
}

merge data to InstallSnapshotRequest

type Service

type Service Transport

func NewService

func NewService(ctx context.Context, id string, addr string) *Service

func (*Service) AppendEntries

func (*Service) InstallSnapshot

func (*Service) RequestVote

func (*Service) TimeoutNow

type Transport

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

func (*Transport) AppendEntries

func (*Transport) AppendEntriesPipeline

func (t *Transport) AppendEntriesPipeline(id raft.ServerID, addr raft.ServerAddress) (raft.AppendPipeline, error)

func (*Transport) Consumer

func (t *Transport) Consumer() <-chan raft.RPC

func (*Transport) DecodePeer

func (t *Transport) DecodePeer(data []byte) raft.ServerAddress

func (*Transport) EncodePeer

func (t *Transport) EncodePeer(id raft.ServerID, addr raft.ServerAddress) []byte

func (*Transport) GetClient

func (t *Transport) GetClient(id raft.ServerID, addr raft.ServerAddress) (*rpc.Client, error)

func (*Transport) InstallSnapshot

func (*Transport) LocalAddr

func (t *Transport) LocalAddr() raft.ServerAddress

func (*Transport) RequestVote

func (*Transport) SetHeartbeatHandler

func (t *Transport) SetHeartbeatHandler(cb func(rpc raft.RPC))

func (*Transport) TimeoutNow

Jump to

Keyboard shortcuts

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