sender

package
v1.22.65 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: BSD-3-Clause Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	NodeIDs   set.Set[ids.NodeID]
	RequestID uint32
	Op        Op
	Bytes     []byte
}

Message represents a message to send

type Op

type Op byte

Op represents an operation

const (
	// GetAcceptedFrontier gets accepted frontier
	GetAcceptedFrontier Op = iota
	// AcceptedFrontier is accepted frontier response
	AcceptedFrontier
	// GetAccepted gets accepted
	GetAccepted
	// Accepted is accepted response
	Accepted
	// Get gets an item
	Get
	// Put puts an item
	Put
	// PushQuery pushes a query
	PushQuery
	// PullQuery pulls a query
	PullQuery
	// Chits is chits response
	Chits
)

type Sender

type Sender interface {
	// Send sends a message
	Send(context.Context, Message) error

	// SendAppRequest sends an app request
	SendAppRequest(context.Context, set.Set[ids.NodeID], uint32, []byte) error

	// SendAppResponse sends an app response
	SendAppResponse(context.Context, ids.NodeID, uint32, []byte) error

	// SendAppGossip sends app gossip
	SendAppGossip(context.Context, set.Set[ids.NodeID], []byte) error
}

Sender sends messages

Directories

Path Synopsis
Package sendertest provides test utilities for message sending
Package sendertest provides test utilities for message sending

Jump to

Keyboard shortcuts

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