wire

package
v0.0.0-...-90a1d44 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppendEntriesRequest

type AppendEntriesRequest struct {
	raft.AppendEntriesRequest
}

func (AppendEntriesRequest) Client

func (AppendEntriesRequest) Client()

func (*AppendEntriesRequest) Decode

func (i *AppendEntriesRequest) Decode(src []byte) error

func (*AppendEntriesRequest) Encode

func (i *AppendEntriesRequest) Encode() []byte

func (AppendEntriesRequest) Raft

func (AppendEntriesRequest) Raft()

type AppendEntriesResponse

type AppendEntriesResponse struct {
	raft.AppendEntriesResponse
	Error error
}

func (*AppendEntriesResponse) Decode

func (i *AppendEntriesResponse) Decode(src []byte) error

func (*AppendEntriesResponse) Encode

func (i *AppendEntriesResponse) Encode() []byte

func (AppendEntriesResponse) Raft

func (AppendEntriesResponse) Raft()

func (AppendEntriesResponse) Server

func (AppendEntriesResponse) Server()

type ApplyTransactionRequest

type ApplyTransactionRequest struct {
	NodeID      raft.ServerID
	Transaction *storage.Transaction
}

func (ApplyTransactionRequest) Client

func (ApplyTransactionRequest) Client()

func (*ApplyTransactionRequest) Decode

func (i *ApplyTransactionRequest) Decode(src []byte) error

func (*ApplyTransactionRequest) Encode

func (i *ApplyTransactionRequest) Encode() []byte

func (ApplyTransactionRequest) RPC

type ApplyTransactionResponse

type ApplyTransactionResponse struct{}

func (ApplyTransactionResponse) Decode

func (ApplyTransactionResponse) Decode(src []byte) error

func (ApplyTransactionResponse) Encode

func (ApplyTransactionResponse) Encode() []byte

func (ApplyTransactionResponse) RPC

func (ApplyTransactionResponse) Server

func (ApplyTransactionResponse) Server()

type ClientMessage

type ClientMessage interface {
	Message
	Client()
}

type ClientWire

type ClientWire interface {
	Send(msg ClientMessage) error
	Receive() (ServerMessage, error)
	HandshakeRaft() error
	HandshakeRpc() error
}

func NewClientWire

func NewClientWire(r io.ReadCloser, w io.WriteCloser) ClientWire

type DiscoveryRequest

type DiscoveryRequest struct {
	NodeID raft.ServerID
}

func (DiscoveryRequest) Client

func (DiscoveryRequest) Client()

func (*DiscoveryRequest) Decode

func (i *DiscoveryRequest) Decode(src []byte) error

func (*DiscoveryRequest) Encode

func (i *DiscoveryRequest) Encode() []byte

func (DiscoveryRequest) RPC

func (DiscoveryRequest) RPC()

type DiscoveryResponse

type DiscoveryResponse struct {
	NodeID    raft.ServerID
	IsNewNode bool
	Peers     []raft.ServerAddress
	Leader    raft.ServerAddress
}

func (*DiscoveryResponse) Decode

func (i *DiscoveryResponse) Decode(src []byte) error

func (*DiscoveryResponse) Encode

func (i *DiscoveryResponse) Encode() []byte

func (DiscoveryResponse) RPC

func (DiscoveryResponse) RPC()

func (DiscoveryResponse) Server

func (DiscoveryResponse) Server()

type ErrorResponse

type ErrorResponse struct {
	Error error
}

func (*ErrorResponse) Decode

func (i *ErrorResponse) Decode(src []byte) error

func (*ErrorResponse) Encode

func (i *ErrorResponse) Encode() []byte

func (ErrorResponse) RPC

func (ErrorResponse) RPC()

func (ErrorResponse) Raft

func (ErrorResponse) Raft()

func (ErrorResponse) Server

func (ErrorResponse) Server()

type HandshakeIntention

type HandshakeIntention = int32
const (
	RaftIntention HandshakeIntention = 1 << iota
	RpcIntention
)

type HandshakeRequest

type HandshakeRequest struct {
	Intention HandshakeIntention
}

func (HandshakeRequest) Client

func (HandshakeRequest) Client()

func (*HandshakeRequest) Decode

func (i *HandshakeRequest) Decode(src []byte) error

func (*HandshakeRequest) Encode

func (i *HandshakeRequest) Encode() []byte

type HandshakeResponse

type HandshakeResponse struct{}

func (HandshakeResponse) Decode

func (HandshakeResponse) Decode(src []byte) error

func (HandshakeResponse) Encode

func (HandshakeResponse) Encode() []byte

func (HandshakeResponse) Server

func (HandshakeResponse) Server()

type InstallSnapshotRequest

type InstallSnapshotRequest struct {
	raft.InstallSnapshotRequest
	Snapshot []byte
}

func (InstallSnapshotRequest) Client

func (InstallSnapshotRequest) Client()

func (*InstallSnapshotRequest) Decode

func (i *InstallSnapshotRequest) Decode(src []byte) error

func (*InstallSnapshotRequest) Encode

func (i *InstallSnapshotRequest) Encode() []byte

func (InstallSnapshotRequest) Raft

func (InstallSnapshotRequest) Raft()

func (*InstallSnapshotRequest) Reader

func (i *InstallSnapshotRequest) Reader() io.Reader

type InstallSnapshotResponse

type InstallSnapshotResponse struct {
	raft.InstallSnapshotResponse
	Error error
}

func (*InstallSnapshotResponse) Decode

func (i *InstallSnapshotResponse) Decode(src []byte) error

func (*InstallSnapshotResponse) Encode

func (i *InstallSnapshotResponse) Encode() []byte

func (InstallSnapshotResponse) Raft

func (InstallSnapshotResponse) Raft()

func (InstallSnapshotResponse) Server

func (InstallSnapshotResponse) Server()

type Message

type Message interface {
	Encode() []byte
	Decode(src []byte) error
}

type NextObjectIdRequest

type NextObjectIdRequest struct {
	ObjectPath []byte
}

func (NextObjectIdRequest) Client

func (NextObjectIdRequest) Client()

func (*NextObjectIdRequest) Decode

func (i *NextObjectIdRequest) Decode(src []byte) error

func (*NextObjectIdRequest) Encode

func (i *NextObjectIdRequest) Encode() []byte

func (NextObjectIdRequest) RPC

func (NextObjectIdRequest) RPC()

type NextObjectIdResponse

type NextObjectIdResponse struct {
	Identity uint8
}

func (*NextObjectIdResponse) Decode

func (i *NextObjectIdResponse) Decode(src []byte) error

func (*NextObjectIdResponse) Encode

func (i *NextObjectIdResponse) Encode() []byte

func (NextObjectIdResponse) RPC

func (NextObjectIdResponse) RPC()

func (NextObjectIdResponse) Server

func (NextObjectIdResponse) Server()

type RaftClientMessage

type RaftClientMessage interface {
	ClientMessage
	Raft()
}

type RaftClientWire

type RaftClientWire interface {
	Send(msg RaftClientMessage) error
	Receive() (RaftServerMessage, error)
}

func NewRaftClientWire

func NewRaftClientWire(r io.ReadCloser, w io.WriteCloser) (RaftClientWire, error)

type RaftServerMessage

type RaftServerMessage interface {
	ServerMessage
	Raft()
}

type RaftServerWire

type RaftServerWire interface {
	Send(msg RaftServerMessage) error
	Receive() (RaftClientMessage, error)
}

func NewRaftServerWire

func NewRaftServerWire(r io.ReadCloser, w io.WriteCloser) RaftServerWire

type RequestVoteRequest

type RequestVoteRequest struct {
	raft.RequestVoteRequest
}

func (RequestVoteRequest) Client

func (RequestVoteRequest) Client()

func (*RequestVoteRequest) Decode

func (i *RequestVoteRequest) Decode(src []byte) error

func (*RequestVoteRequest) Encode

func (i *RequestVoteRequest) Encode() []byte

func (RequestVoteRequest) Raft

func (RequestVoteRequest) Raft()

type RequestVoteResponse

type RequestVoteResponse struct {
	raft.RequestVoteResponse
	Error error
}

func (*RequestVoteResponse) Decode

func (i *RequestVoteResponse) Decode(src []byte) error

func (*RequestVoteResponse) Encode

func (i *RequestVoteResponse) Encode() []byte

func (RequestVoteResponse) Raft

func (RequestVoteResponse) Raft()

func (RequestVoteResponse) Server

func (RequestVoteResponse) Server()

type RpcClientMessage

type RpcClientMessage interface {
	ClientMessage
	RPC()
}

type RpcClientWire

type RpcClientWire interface {
	Send(msg RpcClientMessage) error
	Receive() (RpcServerMessage, error)
}

func NewRpcClientWire

func NewRpcClientWire(r io.ReadCloser, w io.WriteCloser) (RpcClientWire, error)

type RpcServerMessage

type RpcServerMessage interface {
	ServerMessage
	RPC()
}

type RpcServerWire

type RpcServerWire interface {
	Send(msg RpcServerMessage) error
	Receive() (RpcClientMessage, error)
}

func NewRpcServerWire

func NewRpcServerWire(r io.ReadCloser, w io.WriteCloser) RpcServerWire

type ServerMessage

type ServerMessage interface {
	Message
	Server()
}

type ServerWire

type ServerWire interface {
	Send(msg ServerMessage) error
	Receive() (ClientMessage, error)
}

func NewServerWire

func NewServerWire(r io.ReadCloser, w io.WriteCloser) ServerWire

Jump to

Keyboard shortcuts

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