Documentation
¶
Index ¶
- Constants
- func CreateOnStatusPublishStartMessage(transactionID float64, streamName string) ([]byte, error)
- func CreateStreamResponseMessage(transactionID float64) ([]byte, error)
- func GenerateConnectResult(transactionID float64) ([]byte, error)
- func GenerateOnFCPublishMessage(transactionID float64, streamName string) ([]byte, error)
- func GenerateSetChunkSize(chunkSize uint32) ([]byte, error)
- func GenerateSetPeerBandwidthChunk(size uint32, limitType uint8) ([]byte, error)
- func GenerateUserStreamBegin(streamID uint32) ([]byte, error)
- func GenerateWindowAcknowledgementSizeChunk(size uint32) ([]byte, error)
- func ListenAndServe(addr string) error
- type BasicHeader
- type ChunkHeader
- type CommandCode
- type CommandLevel
- type ConnectionState
- type CreateStreamCommand
- type MessageHeader
- type MessageType
- type NetStreamStatusMessage
- type PeerBandwidthLimitType
- type ResultCommand
- type Server
Constants ¶
View Source
const ( CodeNetConnectAppShutdown CommandCode = "NetConnection.Connect.AppShutdown" CodeNetConnectClosed = "NetConnection.Connect.Closed" CodeNetConnectFailed = "NetConnection.Connect.Failed" CodeNetConnectIdleTimeout = "NetConnection.Connect.IdleTimeout" CodeNetConnectInvalidApp = "NetConnection.Connect.InvalidApp" CodeNetConnectNetworkChange = "NetConnection.Connect.NetworkChange" CodeNetConnectRejected = "NetConnection.Connect.Rejected" CodeNetConnectSuccess = "NetConnection.Connect.Success" )
View Source
const ( WindowAcknowledgementSize = 2500000 PeerBandWidth = 2500000 )
View Source
const ( MessageSetChunkSize MessageType = 1 MessageAbort = 2 MessageAcknowledgement = 3 MessageUserControl = 4 MessageAcknowledgementWindowSize = 5 MessageSetPeerBandwidth = 6 MessageAudio = 8 MessageVideo = 9 MessageDataAMF3 = 15 MessageCommandAMF3 = 17 MessageDataAMF0 = 18 MessageCommandAMF0 = 20 MessageAggregate = 22 )
View Source
const ( PeerBandwidthLimitTypeHard PeerBandwidthLimitType = 0 PeerBandwidthLimitTypeSoft = 1 PeerBandwidthLimitTypeDynamic = 2 )
Variables ¶
This section is empty.
Functions ¶
func GenerateConnectResult ¶
func GenerateSetChunkSize ¶
func GenerateUserStreamBegin ¶
func ListenAndServe ¶
Types ¶
type BasicHeader ¶
type ChunkHeader ¶
type ChunkHeader struct {
BasicHeader *BasicHeader
MessageHeader *MessageHeader
ExtendedTimestamp uint32
}
type CommandCode ¶
type CommandCode string
type CommandLevel ¶
type CommandLevel string
const ( CommandLevelStatus CommandLevel = "status" CommandLevelError = "error" )
type ConnectionState ¶
type ConnectionState int
const ( // StateInitialized means both the client and server are uninitialized. // The protocol version is sent during this stage. StateUninitialized ConnectionState = iota // StateVersionSent means both client and server are in the Version Sent state after the Uninitialized state. // The client is waiting for the packet S1 and the server is waiting for the packet C1. StateVersionSent // StateAckSent means the client and the server wait for S2 and C2 respectively. StateAckSent // StateHandshakeDone means the client and the server exchange messages. StateHandshakeDone // StateConnectResponseSent means that server has already sent the response for connect command message. StateConnectResponseSent // StateSentCreateStreamResponse means that server returns _result command message for createStream StateSentCreateStreamResponse // StatePublishingContent means that server is just receiving content. StatePublishingContent )
type CreateStreamCommand ¶
type CreateStreamCommand struct {
Name string
TransactionID float64
Properties map[string]interface{}
Message map[string]interface{}
}
func (*CreateStreamCommand) Bytes ¶
func (c *CreateStreamCommand) Bytes() []byte
type MessageHeader ¶
type MessageType ¶
type MessageType uint8
type NetStreamStatusMessage ¶
type NetStreamStatusMessage struct {
Name string
TransactionID float64
InfoObject map[string]interface{}
}
func (*NetStreamStatusMessage) Bytes ¶
func (m *NetStreamStatusMessage) Bytes() []byte
type PeerBandwidthLimitType ¶
type PeerBandwidthLimitType int
type ResultCommand ¶
type ResultCommand struct {
Name string
TransactionID float64
Properties map[string]interface{}
Information map[string]interface{}
}
func (*ResultCommand) Bytes ¶
func (rc *ResultCommand) Bytes() []byte
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
