connmanager

package
v1.2.12 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package connmanager tracks open connections maping storage proposal CID -> StorageDealStream

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnManager

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

ConnManager is a simple threadsafe map of proposal CID -> network deal stream

func NewConnManager

func NewConnManager() *ConnManager

NewConnManager returns a new conn manager

func (*ConnManager) AddStream

func (c *ConnManager) AddStream(proposalCid cid.Cid, s network.StorageDealStream) error

AddStream adds the given stream to the conn manager, and errors if one already exists for the given proposal CID

func (*ConnManager) DealStream

func (c *ConnManager) DealStream(proposalCid cid.Cid) (network.StorageDealStream, error)

DealStream returns the deal stream for the given proposal, or an error if not present

func (*ConnManager) Disconnect

func (c *ConnManager) Disconnect(proposalCid cid.Cid) error

Disconnect removes the given connection from the conn manager and closes the stream. It errors if an error occurs closing the stream

Jump to

Keyboard shortcuts

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