msg

package
v0.0.0-...-e3d0b79 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2017 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgTypeNoOp                 = iota
	MsgTypeEpochSetupReq        // 1
	MsgTypeEpochSetupResp       // 2
	MsgTypeEpochOpenReq         // 3
	MsgTypeEpochOpenResp        // 4
	MsgTypeEpochCloseReq        // 5
	MsgTypeEpochCloseResp       // 6
	MsgTypeEpochRevokeReq       // 7
	MsgTypeEpochRevokeResp      // 8
	MsgTypeLeasePrepareReq      // 9
	MsgTypeLeasePrepareResp     // 10
	MsgTypeLeaseProposeReq      // 11
	MsgTypeLeaseProposeResp     // 12
	MsgTypeReplicaCreateReq     // 13
	MsgTypeReplicaCreateResp    // 14
	MsgTypeReplicaSetInSyncReq  // 15
	MsgTypeReplicaSetInSyncResp // 16
)

The list of available message types.

Variables

This section is empty.

Functions

func ToBytes

func ToBytes(msg Msg) ([]byte, error)

ToBytes returns a byte slice that encodes the message.

Types

type Common

type Common struct {
	// Type is the type of message
	Type MsgType
	// Dest is the server IP and port for the destination.
	Dest api.Endpoint
	// DestID is the server ID for the destination.
	DestID uuid.UUID
	// SrcID is the server ID for the source.
	SrcID uuid.UUID
	// ReplicaID is replica context for the message.
	ReplicaID uuid.UUID
	// EpochID identifies the epoch context for the message.
	EpochID uuid.UUID
}

Common provides common attributes for all messages.

type Msg

type Msg interface {
	GetCommon() *Common
}

func FromBytes

func FromBytes(in []byte) (Msg, error)

FromBytes returns message decoded from a byte slice.

func NewMsgByType

func NewMsgByType(myType MsgType) Msg

type MsgEpochCloseReq

type MsgEpochCloseReq struct {
	Common
}

func (*MsgEpochCloseReq) GetCommon

func (m *MsgEpochCloseReq) GetCommon() *Common

type MsgEpochCloseResp

type MsgEpochCloseResp struct {
	Common
}

func (*MsgEpochCloseResp) GetCommon

func (m *MsgEpochCloseResp) GetCommon() *Common

type MsgEpochOpenReq

type MsgEpochOpenReq struct {
	Common
}

func (*MsgEpochOpenReq) GetCommon

func (m *MsgEpochOpenReq) GetCommon() *Common

type MsgEpochOpenResp

type MsgEpochOpenResp struct {
	Common
}

func (*MsgEpochOpenResp) GetCommon

func (m *MsgEpochOpenResp) GetCommon() *Common

type MsgEpochRevokeReq

type MsgEpochRevokeReq struct {
	Common
	SuccessorEpochID uuid.UUID
}

func (*MsgEpochRevokeReq) GetCommon

func (m *MsgEpochRevokeReq) GetCommon() *Common

type MsgEpochRevokeResp

type MsgEpochRevokeResp struct {
	Common
}

func (*MsgEpochRevokeResp) GetCommon

func (m *MsgEpochRevokeResp) GetCommon() *Common

type MsgEpochSetupReq

type MsgEpochSetupReq struct {
	Common
}

func (*MsgEpochSetupReq) GetCommon

func (m *MsgEpochSetupReq) GetCommon() *Common

type MsgEpochSetupResp

type MsgEpochSetupResp struct {
	Common
}

func (*MsgEpochSetupResp) GetCommon

func (m *MsgEpochSetupResp) GetCommon() *Common

type MsgLeasePrepareReq

type MsgLeasePrepareReq struct {
	Common
	BallotNumber     api.BallotNumber
	SuccessorEpochID *uuid.UUID
}

func (*MsgLeasePrepareReq) GetCommon

func (m *MsgLeasePrepareReq) GetCommon() *Common

type MsgLeasePrepareResp

type MsgLeasePrepareResp struct {
	Common
	BallotNumber      api.BallotNumber
	HighestPromised   api.BallotNumber
	ProposalOwnerID   *uuid.UUID
	SuccessorMismatch bool
}

func (*MsgLeasePrepareResp) GetCommon

func (m *MsgLeasePrepareResp) GetCommon() *Common

type MsgLeaseProposeReq

type MsgLeaseProposeReq struct {
	Common
	BallotNumber    api.BallotNumber
	ProposedTimeout uint16
}

func (*MsgLeaseProposeReq) GetCommon

func (m *MsgLeaseProposeReq) GetCommon() *Common

type MsgLeaseProposeResp

type MsgLeaseProposeResp struct {
	Common
	BallotNumber        api.BallotNumber
	HasAcceptedProposal bool
	ProposalOwnerID     uuid.UUID
	EpochState          api.State
}

func (*MsgLeaseProposeResp) GetCommon

func (m *MsgLeaseProposeResp) GetCommon() *Common

type MsgList

type MsgList []Msg

type MsgReplicaCreateReq

type MsgReplicaCreateReq struct {
	Common
	Replica api.Replica
}

func (*MsgReplicaCreateReq) GetCommon

func (m *MsgReplicaCreateReq) GetCommon() *Common

type MsgReplicaCreateResp

type MsgReplicaCreateResp struct {
	Common
}

func (*MsgReplicaCreateResp) GetCommon

func (m *MsgReplicaCreateResp) GetCommon() *Common

type MsgType

type MsgType byte

MsgType is an integer ID of a type of message that can be received on network channels from other members.

Jump to

Keyboard shortcuts

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