Documentation
¶
Index ¶
- Constants
- Variables
- func Dump(label string, val interface{}) error
- func DumpBytes(label string, buf []byte, size int)
- func Error(f string, v ...interface{}) error
- func GetCurrentTimestamp() uint32
- type Client
- func (c *Client) Call(msg *Message, t uint32) (response *Response, err error)
- func (c *Client) Connect() (err error)
- func (c *Client) Disconnect()
- func (c *Client) EncodeInvoke(className string, destination interface{}, operation interface{}, ...) (msg *Message, err error)
- func (c *Client) EncodeInvokeCommand(destination interface{}, operation interface{}, body interface{}) (msg *Message, err error)
- func (c *Client) EncodeInvokeRemote(destination interface{}, operation interface{}, body interface{}) (msg *Message, err error)
- func (c *Client) GetResponse(tid uint32) (response *Response, ready bool)
- func (c *Client) IsAlive() bool
- func (c *Client) NextTransactionId() uint32
- func (c *Client) Read(p []byte) (n int, err error)
- func (c *Client) RegisterExternalHandler(name string, fn amf.ExternalHandler)
- func (c *Client) Reset()
- func (c *Client) SendMessage(msg *Message)
- func (c *Client) Write(p []byte) (n int, err error)
- type Command
- type Header
- type InboundChunkStream
- type Message
- type OutboundChunkStream
- type Response
Constants ¶
View Source
const ( TIMESTAMP_MAX = uint32(2000000000) TIMESTAMP_AUTO = uint32(0) TIMESTAMP_EXTENDED = 0xFFFFFF )
View Source
const ( CHUNK_STREAM_ID_PROTOCOL = uint32(2) CHUNK_STREAM_ID_COMMAND = uint32(3) CHUNK_STREAM_ID_USER_CONTROL = uint32(4) )
View Source
const ( HEADER_FORMAT_FULL = 0x00 HEADER_FORMAT_SAME_STREAM = 0x01 HEADER_FORMAT_SAME_LENGTH_AND_STREAM = 0x02 HEADER_FORMAT_CONTINUATION = 0x03 )
View Source
const ( MESSAGE_TYPE_NONE = 0x00 MESSAGE_TYPE_CHUNK_SIZE = 0x01 MESSAGE_TYPE_ABORT = 0x02 MESSAGE_TYPE_ACK = 0x03 MESSAGE_TYPE_PING = 0x04 MESSAGE_TYPE_ACK_SIZE = 0x05 MESSAGE_TYPE_BANDWIDTH = 0x06 MESSAGE_TYPE_AUDIO = 0x08 MESSAGE_TYPE_VIDEO = 0x09 MESSAGE_TYPE_FLEX = 0x0F MESSAGE_TYPE_AMF3_SHARED_OBJECT = 0x10 MESSAGE_TYPE_AMF3 = 0x11 MESSAGE_TYPE_INVOKE = 0x12 MESSAGE_TYPE_AMF0_SHARED_OBJECT = 0x13 MESSAGE_TYPE_AMF0 = 0x14 MESSAGE_TYPE_FLV = 0x16 )
View Source
const ( AMF0 = 0x00 AMF3 = 0x03 )
View Source
const ( DEFAULT_CHUNK_SIZE = uint32(128) DEFAULT_WINDOW_SIZE = uint32(2500000) )
View Source
const (
MESSAGE_DISPATCH_QUEUE_LENGTH = 100
)
Variables ¶
View Source
var (
ErrResponseTimeout = errors.New("rtmp: response timeout")
)
Functions ¶
func GetCurrentTimestamp ¶
func GetCurrentTimestamp() uint32
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Disconnect ¶
func (c *Client) Disconnect()
func (*Client) EncodeInvoke ¶
func (*Client) EncodeInvokeCommand ¶
func (*Client) EncodeInvokeRemote ¶
func (*Client) GetResponse ¶
func (*Client) NextTransactionId ¶
func (*Client) RegisterExternalHandler ¶
func (*Client) SendMessage ¶
type Header ¶
type Header struct {
Format uint8
ChunkStreamId uint32
MessageLength uint32
MessageTypeId uint8
MessageStreamId uint32
Timestamp uint32
ExtendedTimestamp uint32
}
func (*Header) CalculateTimestamp ¶
type InboundChunkStream ¶
type InboundChunkStream struct {
Id uint32
// contains filtered or unexported fields
}
func NewInboundChunkStream ¶
func NewInboundChunkStream(id uint32) *InboundChunkStream
type Message ¶
type Message struct {
Type uint8
ChunkStreamId uint32
StreamId uint32
Timestamp uint32
AbsoluteTimestamp uint32
TransactionId uint32
Length uint32
Buffer *bytes.Buffer
}
func EncodeConnect ¶
func (*Message) DecodeResponse ¶
func (*Message) RemainingBytes ¶
type OutboundChunkStream ¶
type OutboundChunkStream struct {
Id uint32
// contains filtered or unexported fields
}
func NewOutboundChunkStream ¶
func NewOutboundChunkStream(id uint32) *OutboundChunkStream
func (*OutboundChunkStream) GetTimestamp ¶
func (cs *OutboundChunkStream) GetTimestamp() uint32
func (*OutboundChunkStream) NewOutboundHeader ¶
func (cs *OutboundChunkStream) NewOutboundHeader(m *Message) *Header
Click to show internal directories.
Click to hide internal directories.
