channels

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channels

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

Channels is a thread safe list of channels

func New

func New() *Channels

New returns a new thread safe list of channels

func (*Channels) CreateNew

func (c *Channels) CreateNew(tid datatransfer.TransferID, baseCid cid.Cid, selector ipld.Node, voucher datatransfer.Voucher, initiator, dataSender, dataReceiver peer.ID) (datatransfer.ChannelID, error)

CreateNew creates a new channel id and channel state and saves to channels. returns error if the channel exists already.

func (*Channels) GetByIDAndSender

func (c *Channels) GetByIDAndSender(chid datatransfer.ChannelID, sender peer.ID) datatransfer.ChannelState

GetByIDAndSender searches for a channel in the slice of channels with id `chid`, with the given sender. Returns datatransfer.EmptyChannelState if there is no channel with that id

func (*Channels) InProgress

InProgress returns a list of in progress channels

Jump to

Keyboard shortcuts

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