Documentation
¶
Overview ¶
bcnet implements the Blobcache Protocol (BCP).
Index ¶
- type AccessFunc
- type Marshaller
- type Message
- type Node
- func (n *Node) Ask(ctx context.Context, remote blobcache.Endpoint, req Message, resp *Message) error
- func (n *Node) LocalAddr() netip.AddrPort
- func (n *Node) LocalEndpoint() blobcache.Endpoint
- func (n *Node) LocalID() blobcache.PeerID
- func (n *Node) Serve(ctx context.Context, srv Server) error
- func (n *Node) Tell(ctx context.Context, remote blobcache.Endpoint, req bcp.Message) error
- type Server
- type TopicMessage
- type Unmarshaller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessFunc ¶
AccessFun is called to get a service to access
type Marshaller ¶
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) LocalEndpoint ¶
type Server ¶
type Server struct {
Access AccessFunc
Deliver func(ctx context.Context, from blobcache.Endpoint, ttm bcp.TopicTellMsg) error
}
type TopicMessage ¶
type Unmarshaller ¶
Click to show internal directories.
Click to hide internal directories.