Documentation ¶
Index ¶
- Constants
- Variables
- func RandomStreamID() string
- type ChunkHaveMsg
- type ChunkReqAckMsg
- type ChunkReqMsg
- type ChunkSubscriber
- type JoinMsg
- type LivepeerNode
- func (n *LivepeerNode) SendChunkReq(peer ps.PeerInfo, cn, strmID string)
- func (n *LivepeerNode) SendChunkReqAck(peer ps.PeerInfo, cn, strmID string, data []byte)
- func (n *LivepeerNode) SendHaveChunk(name, strmID string)
- func (n *LivepeerNode) SendJoin(pid peer.ID)
- func (n *LivepeerNode) SendJoinAck(pid peer.ID)
- func (n *LivepeerNode) SendSubscribeReq(strmID StreamID)
- type Message
- type StreamID
- type SubReqMsg
- type Transcode
- type WrappedStream
Constants ¶
View Source
const ( JoinMsgID = iota JoinAckID SubReqID ChunkHaveID ChunkReqID ChunkReqAckID TranscodeMsgID HaveMsgID )
Variables ¶
View Source
var LivepeerProtocol = protocol.ID("/livepeer")
var P_LIVEPEER = 422
Functions ¶
func RandomStreamID ¶
func RandomStreamID() string
Types ¶
type ChunkHaveMsg ¶
type ChunkReqAckMsg ¶
type ChunkReqMsg ¶
type ChunkSubscriber ¶
type ChunkSubscriber struct { Buffer *stream.HLSBuffer Node *LivepeerNode }
func NewChunkSubscriber ¶
func NewChunkSubscriber(buf *stream.HLSBuffer, n *LivepeerNode) *ChunkSubscriber
func (*ChunkSubscriber) WriteSegment ¶
type LivepeerNode ¶
type LivepeerNode struct { // Self Identity peer.ID // the local node's identity Peerstore ps.Peerstore // storage for other Peer instances Routing routing.IpfsRouting // the routing system. recommend ipfs-dht Priv crypto.PrivKey Pub crypto.PubKey PeerHost p2phost.Host // the network host (server+client) StreamPeers map[string][]ps.PeerInfo // the network host (server+client) HLSBuf *lpmsStream.HLSBuffer }
func (*LivepeerNode) SendChunkReq ¶
func (n *LivepeerNode) SendChunkReq(peer ps.PeerInfo, cn, strmID string)
func (*LivepeerNode) SendChunkReqAck ¶
func (n *LivepeerNode) SendChunkReqAck(peer ps.PeerInfo, cn, strmID string, data []byte)
func (*LivepeerNode) SendHaveChunk ¶
func (n *LivepeerNode) SendHaveChunk(name, strmID string)
Takes a HLS stream and sends HAVE messages for each chunk to known peers
func (*LivepeerNode) SendJoin ¶
func (n *LivepeerNode) SendJoin(pid peer.ID)
func (*LivepeerNode) SendJoinAck ¶
func (n *LivepeerNode) SendJoinAck(pid peer.ID)
func (*LivepeerNode) SendSubscribeReq ¶
func (n *LivepeerNode) SendSubscribeReq(strmID StreamID)
type StreamID ¶
type StreamID string
func (*StreamID) SplitComponents ¶
Given a stream ID, return it's origin nodeID and the unique stream ID
type WrappedStream ¶
type WrappedStream struct { Stream net.Stream Enc multicodec.Encoder Dec multicodec.Decoder Writer *bufio.Writer Reader *bufio.Reader }
func WrapStream ¶
func WrapStream(s net.Stream) *WrappedStream
Click to show internal directories.
Click to hide internal directories.