sender

package
v1.22.21 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: BSD-3-Clause Imports: 4 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

	// SendRequest sends a warp request
	SendRequest(context.Context, set.Set[ids.NodeID], uint32, []byte) error

	// SendResponse sends a warp response
	SendResponse(context.Context, ids.NodeID, uint32, []byte) error

	// SendGossip sends warp gossip
	SendGossip(context.Context, warp.SendConfig, []byte) error
}

Sender sends messages

Directories

Path Synopsis
Package sendermock provides mock implementations for message sending
Package sendermock provides mock implementations for message sending
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