messages

package
v0.0.0-...-2a45ea8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package messages defines interface for the protocol messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenBytes

func AuthenBytes(m Message) []byte

AuthenBytes returns serialized representation of message's authenticated content.

func Stringify

func Stringify(msg Message) string

Stringify returns a human-readable string representing the message content that is sufficient for diagnostic output.

Types

type CertifiedMessage

type CertifiedMessage interface {
	ReplicaMessage
	UI() *usig.UI
	SetUI(ui *usig.UI)
}

CertifiedMessage represents a message certified with a UI.

type ClientMessage

type ClientMessage interface {
	Message
	ClientID() uint32
	ImplementsClientMessage()
}

ClientMessage represents a message generated by a client.

type Commit

type Commit interface {
	CertifiedMessage
	Proposal() CertifiedMessage
	ImplementsPeerMessage()
	ImplementsCommit()
}

type Hello

type Hello interface {
	PeerMessage
	ImplementsHello()
}

type Message

type Message interface {
	encoding.BinaryMarshaler
}

type MessageImpl

type MessageImpl interface {
	NewFromBinary(data []byte) (Message, error)
	NewHello(replicaID uint32) Hello
	NewRequest(clientID uint32, sequence uint64, operation []byte) Request
	NewPrepare(replicaID uint32, view uint64, request Request) Prepare
	NewCommit(replicaID uint32, proposal CertifiedMessage) Commit
	NewReply(replicaID, clientID uint32, sequence uint64, result []byte) Reply
	NewReqViewChange(replicaID uint32, newView uint64) ReqViewChange
	NewViewChange(replicaID uint32, newView uint64, log MessageLog, vcCert ViewChangeCert) ViewChange
	NewNewView(replicaID uint32, newView uint64, nvCert NewViewCert) NewView
}

MessageImpl provides an implementation of the message representation.

type MessageLog

type MessageLog []CertifiedMessage

type NewView

type NewView interface {
	CertifiedMessage
	NewView() uint64
	NewViewCert() NewViewCert
	ImplementsPeerMessage()
	ImplementsNewView()
}

type NewViewCert

type NewViewCert []ViewChange

type PeerMessage

type PeerMessage interface {
	ReplicaMessage
	ImplementsPeerMessage()
}

PeerMessage represents a message exchanged between replicas.

type Prepare

type Prepare interface {
	CertifiedMessage
	View() uint64
	Request() Request
	ImplementsPeerMessage()
	ImplementsPrepare()
}

type ReplicaMessage

type ReplicaMessage interface {
	Message
	ReplicaID() uint32
	ImplementsReplicaMessage()
}

ReplicaMessage represents a message generated by a replica.

EmbeddedMessages method returns a sequence of messages embedded into this one.

type Reply

type Reply interface {
	ReplicaMessage
	SignedMessage
	ClientID() uint32
	Sequence() uint64
	Result() []byte
	ImplementsReply()
}

type ReqViewChange

type ReqViewChange interface {
	ReplicaMessage
	SignedMessage
	NewView() uint64
	ImplementsPeerMessage()
	ImplementsReqViewChange()
}

type Request

type Request interface {
	ClientMessage
	SignedMessage
	Sequence() uint64
	Operation() []byte
	ImplementsRequest()
}

type SignedMessage

type SignedMessage interface {
	Signature() []byte
	SetSignature(signature []byte)
}

SignedMessage represents a message signed with a normal signature.

type ViewChange

type ViewChange interface {
	CertifiedMessage
	NewView() uint64
	MessageLog() MessageLog
	ViewChangeCert() ViewChangeCert
	ImplementsPeerMessage()
	ImplementsViewChange()
}

type ViewChangeCert

type ViewChangeCert []ReqViewChange

Directories

Path Synopsis
Package mock_messages is a generated GoMock package.
Package mock_messages is a generated GoMock package.
Package protobuf implements protocol message interface using Protocol Buffers as serialization mechanism.
Package protobuf implements protocol message interface using Protocol Buffers as serialization mechanism.
pb

Jump to

Keyboard shortcuts

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