core

package
v0.0.0-...-9a013c3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFail = fmt.Errorf("respone err")
)
View Source
var (
	ErrReq = fmt.Errorf("req error")
)

Functions

This section is empty.

Types

type ChunkStream

type ChunkStream struct {
	Format    uint32
	CSID      uint32
	Timestamp uint32
	Length    uint32
	TypeID    uint32
	StreamID  uint32

	Data []byte
	// contains filtered or unexported fields
}

type Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

func NewConn

func NewConn(c net.Conn, bufferSize int) *Conn

func (*Conn) Close

func (conn *Conn) Close() error

func (*Conn) Flush

func (conn *Conn) Flush() error

func (*Conn) HandshakeClient

func (conn *Conn) HandshakeClient() (err error)

func (*Conn) HandshakeServer

func (conn *Conn) HandshakeServer() (err error)

func (*Conn) LocalAddr

func (conn *Conn) LocalAddr() net.Addr

func (*Conn) NewAck

func (conn *Conn) NewAck(size uint32) ChunkStream

func (*Conn) NewSetChunkSize

func (conn *Conn) NewSetChunkSize(size uint32) ChunkStream

func (*Conn) NewSetPeerBandwidth

func (conn *Conn) NewSetPeerBandwidth(size uint32) ChunkStream

func (*Conn) NewWindowAckSize

func (conn *Conn) NewWindowAckSize(size uint32) ChunkStream

func (*Conn) Read

func (conn *Conn) Read(c *ChunkStream) error

func (*Conn) RemoteAddr

func (conn *Conn) RemoteAddr() net.Addr

func (*Conn) SetBegin

func (conn *Conn) SetBegin()

func (*Conn) SetDeadline

func (conn *Conn) SetDeadline(t time.Time) error

func (*Conn) SetRecorded

func (conn *Conn) SetRecorded()

func (*Conn) Write

func (conn *Conn) Write(c *ChunkStream) error

type ConnClient

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

func NewConnClient

func NewConnClient() *ConnClient

func (*ConnClient) Close

func (connClient *ConnClient) Close(err error)

func (*ConnClient) DecodeBatch

func (connClient *ConnClient) DecodeBatch(r io.Reader, ver amf.Version) (ret []interface{}, err error)

func (*ConnClient) Flush

func (connClient *ConnClient) Flush() error

func (*ConnClient) GetInfo

func (connClient *ConnClient) GetInfo() (app string, name string, url string)

func (*ConnClient) GetStreamId

func (connClient *ConnClient) GetStreamId() uint32

func (*ConnClient) Read

func (connClient *ConnClient) Read(c *ChunkStream) (err error)

func (*ConnClient) Start

func (connClient *ConnClient) Start(url string, method string) error

func (*ConnClient) Write

func (connClient *ConnClient) Write(c ChunkStream) error

type ConnServer

type ConnServer struct {
	ConnInfo    ConnectInfo
	PublishInfo PublishInfo
	// contains filtered or unexported fields
}

func NewConnServer

func NewConnServer(conn *Conn) *ConnServer

func (*ConnServer) Close

func (connServer *ConnServer) Close(err error)

func (*ConnServer) Flush

func (connServer *ConnServer) Flush() error

func (*ConnServer) GetInfo

func (connServer *ConnServer) GetInfo() (app string, name string, url string)

func (*ConnServer) IsPublisher

func (connServer *ConnServer) IsPublisher() bool

func (*ConnServer) Read

func (connServer *ConnServer) Read(c *ChunkStream) (err error)

func (*ConnServer) ReadMsg

func (connServer *ConnServer) ReadMsg() error

func (*ConnServer) Write

func (connServer *ConnServer) Write(c ChunkStream) error

type ConnectEvent

type ConnectEvent struct {
	Level          string `amf:"level"`
	Code           string `amf:"code"`
	Description    string `amf:"description"`
	ObjectEncoding int    `amf:"objectEncoding"`
}

type ConnectInfo

type ConnectInfo struct {
	App            string `amf:"app" json:"app"`
	Flashver       string `amf:"flashVer" json:"flashVer"`
	SwfUrl         string `amf:"swfUrl" json:"swfUrl"`
	TcUrl          string `amf:"tcUrl" json:"tcUrl"`
	Fpad           bool   `amf:"fpad" json:"fpad"`
	AudioCodecs    int    `amf:"audioCodecs" json:"audioCodecs"`
	VideoCodecs    int    `amf:"videoCodecs" json:"videoCodecs"`
	VideoFunction  int    `amf:"videoFunction" json:"videoFunction"`
	PageUrl        string `amf:"pageUrl" json:"pageUrl"`
	ObjectEncoding int    `amf:"objectEncoding" json:"objectEncoding"`
}

type ConnectResp

type ConnectResp struct {
	FMSVer       string `amf:"fmsVer"`
	Capabilities int    `amf:"capabilities"`
}

type PublishInfo

type PublishInfo struct {
	Name string
	Type string
}

type ReadWriter

type ReadWriter struct {
	*bufio.ReadWriter
	// contains filtered or unexported fields
}

func NewReadWriter

func NewReadWriter(rw io.ReadWriter, bufSize int) *ReadWriter

func (*ReadWriter) Flush

func (rw *ReadWriter) Flush() error

func (*ReadWriter) Read

func (rw *ReadWriter) Read(p []byte) (int, error)

func (*ReadWriter) ReadError

func (rw *ReadWriter) ReadError() error

func (*ReadWriter) ReadUintBE

func (rw *ReadWriter) ReadUintBE(n int) (uint32, error)

func (*ReadWriter) ReadUintLE

func (rw *ReadWriter) ReadUintLE(n int) (uint32, error)

func (*ReadWriter) Write

func (rw *ReadWriter) Write(p []byte) (int, error)

func (*ReadWriter) WriteError

func (rw *ReadWriter) WriteError() error

func (*ReadWriter) WriteUintBE

func (rw *ReadWriter) WriteUintBE(v uint32, n int) error

func (*ReadWriter) WriteUintLE

func (rw *ReadWriter) WriteUintLE(v uint32, n int) error

Jump to

Keyboard shortcuts

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