network

package
v0.0.0-...-8cbd207 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HEARTBEAT             = "HEARTBEAT"
	VOTE_REQUEST_RECEIVED = "VOTE_REQUEST_RECEIVED"
	VOTE_RECEIVED         = "VOTE_RECEIVED"
	LOG_ENTRY_REPLICATED  = "LOG_ENTRY_REPLICATED"
	LOG_ENTRY_COMMITTED   = "LOG_ENTRY_COMMITTED"
	LEADER_SUSPECTED      = "LEADER_SUSPECTED"
	FOLLOWER_SUSPECTED    = "FOLLOWER_SUSPECTED"
)

Variables

This section is empty.

Functions

func CastMessage

func CastMessage[TargetMessageType protocol.Message](message *anypb.Any) (TargetMessageType, error)

Types

type Message

type Message struct {
	*protocol.Message
	// contains filtered or unexported fields
}

func (*Message) FreeMessage

func (message *Message) FreeMessage()

func (*Message) GetResponse

func (message *Message) GetResponse() *protocol.Message

func (*Message) ResetConn

func (message *Message) ResetConn()

func (*Message) Respond

func (message *Message) Respond()

type MessageType

type MessageType int

type NetworkLayer

type NetworkLayer struct {
	*net.UnixConn
	// contains filtered or unexported fields
}

func NewNetworkLayer

func NewNetworkLayer(handleChan chan<- Message, respChan <-chan Message, localAddr *net.UnixAddr, unixSocketPath string) (*NetworkLayer, error)

func (*NetworkLayer) Close

func (networkLayer *NetworkLayer) Close() error

func (*NetworkLayer) ResetConn

func (networkLayer *NetworkLayer) ResetConn()

func (*NetworkLayer) RunAsync

func (networkLayer *NetworkLayer) RunAsync(ctx context.Context)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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