bcnet

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

bcnet implements the Blobcache Protocol (BCP).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message = bcp.Message

type Node

type Node struct {
	// contains filtered or unexported fields
}

func New

func New(privateKey ed25519.PrivateKey, pc net.PacketConn) *Node

func (*Node) Ask

func (n *Node) Ask(ctx context.Context, remote blobcache.Endpoint, req Message, resp *Message) error

Ask opens a bidirectional stream to the given peer and sends the given request, then waits for a response.

func (*Node) LocalAddr

func (n *Node) LocalAddr() netip.AddrPort

func (*Node) LocalEndpoint

func (n *Node) LocalEndpoint() blobcache.Endpoint

func (*Node) LocalID

func (n *Node) LocalID() blobcache.PeerID

func (*Node) Serve

func (n *Node) Serve(ctx context.Context, srv bcp.Handler) error

Serve blocks handling all incoming connections, until ctx is cancelled.

func (*Node) Tell

func (n *Node) Tell(ctx context.Context, remote blobcache.Endpoint, req bcp.Message) error

Tell opens a uni-stream to the given peer and sends the given request.

Jump to

Keyboard shortcuts

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