Versions in this module Expand all Collapse all v4 v4.15.3 Apr 23, 2024 v4.15.2 Apr 23, 2024 Changes in this version + const AMF0_AVMPLUS_OBJECT + const AMF0_BOOLEAN + const AMF0_DATE + const AMF0_ECMA_ARRAY + const AMF0_END_OBJECT + const AMF0_LONG_STRING + const AMF0_MOVIECLIP + const AMF0_NULL + const AMF0_NUMBER + const AMF0_OBJECT + const AMF0_RECORDSET + const AMF0_REFERENCE + const AMF0_STRICT_ARRAY + const AMF0_STRING + const AMF0_TYPED_OBJECT + const AMF0_UNDEFINED + const AMF0_UNSUPPORTED + const AMF0_XML_DOCUMENT + const AMF3_ARRAY + const AMF3_BYTE_ARRAY + const AMF3_DATE + const AMF3_DICTIONARY + const AMF3_DOUBLE + const AMF3_FALSE + const AMF3_INTEGER + const AMF3_NULL + const AMF3_OBJECT + const AMF3_STRING + const AMF3_TRUE + const AMF3_UNDEFINED + const AMF3_VECTOR_DOUBLE + const AMF3_VECTOR_INT + const AMF3_VECTOR_OBJECT + const AMF3_VECTOR_UINT + const AMF3_XML + const AMF3_XML_DOC + const APIErrorDecode + const APIErrorInternal + const APIErrorJSONEncode + const APIErrorNoBody + const APIErrorNoConfig + const APIErrorNoPusher + const APIErrorNoSEI + const APIErrorNoStream + const APIErrorNoSubscriber + const APIErrorNone + const APIErrorNotFound + const APIErrorOpen + const APIErrorPublish + const APIErrorQueryParse + const APIErrorSave + var BigEndian bigEndian + var Crc32_Table = []uint32 + var END_OBJ = []byte + var EmptyLocker emptyLocker + var FieldNoExist error = errors.New("field no exist") + var LittleEndian littleEndian + var Null = struct{} + var ObjectEnd = &struct{} + var PoolSize = 16 + var RTPReorderBufferLen uint16 = 50 + var Undefined = &struct{} + func BasicAuth(u, p string, next http.Handler) http.Handler + func BigLittleSwap(v uint) uint + func Bit1(b byte, index int) bool + func ByteToUint32(data []byte, bigEndian bool) (ret uint32, err error) + func ByteToUint32N(data []byte) (ret uint32, err error) + func ByteToUint64N(data []byte) (ret uint64, err error) + func CORS(next http.Handler) http.Handler + func Clone[T any](x T) *T + func ConcatBuffers[T ~[]byte](input []T) (out []byte) + func Conditoinal[T any](cond bool, t, f T) T + func Conf2Listener(conf string) (protocol string, ports []uint16) + func ConvertNum[F Integer, T Integer](from F, to T) T + func CreateShutdownScript() error + func CurrentDir(path ...string) string + func Exist(filename string) bool + func FetchValue[T any](t T) func() T + func GetBE[T Integer](b []byte, num *T) T + func GetFillBytes(data byte, n int) []byte + func GetPCR(v uint64) uint64 + func GetPtsDts(v uint64) uint64 + func GetUev(buff []byte, start int) (value int, pos int) + func IsLANAddr(ip string) (bool, string) + func IsLANIp(ip net.IP) (bool, string) + func IsSubdir(baseDir, joinedDir string) bool + func LastElement[T any](s []T) T + func ListenUDP(address string, networkBuffer int) (*net.UDPConn, error) + func MapList[K comparable, V any, R any](m *Map[K, V], f func(K, V) R) (r []R) + func MarshalAMF3s(v ...any) []byte + func MarshalAMFs(v ...any) []byte + func PutBE[T Integer](b []byte, num T) []byte + func PutPCR(pcr uint64) uint64 + func PutPtsDts(v uint64) uint64 + func ReadAMF[T string | float64 | bool | map[string]any](amf *AMF) (result T) + func ReadBE[T Integer](b []byte) (num T) + func ReadByteToUint16(r io.Reader, bigEndian bool) (data uint16, err error) + func ReadByteToUint24(r io.Reader, bigEndian bool) (data uint32, err error) + func ReadByteToUint32(r io.Reader, bigEndian bool) (data uint32, err error) + func ReadByteToUint40(r io.Reader, bigEndian bool) (data uint64, err error) + func ReadByteToUint48(r io.Reader, bigEndian bool) (data uint64, err error) + func ReadByteToUint64(r io.Reader, bigEndian bool) (data uint64, err error) + func ReadByteToUint8(r io.Reader) (data uint8, err error) + func Retry(attempts int, sleep time.Duration, f func() error) error + func RetryStopErr(err error) retryStop + func ReturnError(code int, msg string, rw http.ResponseWriter, r *http.Request) + func ReturnFetchList[T any](fetch func() []T, rw http.ResponseWriter, r *http.Request) + func ReturnFetchValue[T any](fetch func() T, rw http.ResponseWriter, r *http.Request) + func ReturnOK(rw http.ResponseWriter, r *http.Request) + func ReturnValue(v any, rw http.ResponseWriter, r *http.Request) + func SizeOfBuffers[T ~[]byte](buf []T) (size int) + func SplitBuffers[T ~[]byte](buf []T, size int) (result [][]T) + func ToFloat64(num interface{}) float64 + func Uint32ToByte(data uint32, bigEndian bool) (ret []byte, err error) + func WaitTerm(cancel context.CancelFunc) + func WriteUint16ToByte(w io.Writer, data uint16, bigEndian bool) error + func WriteUint24ToByte(w io.Writer, data uint32, bigEndian bool) error + func WriteUint32ToByte(w io.Writer, data uint32, bigEndian bool) error + func WriteUint40ToByte(w io.Writer, data uint64, bigEndian bool) error + func WriteUint48ToByte(w io.Writer, data uint64, bigEndian bool) error + func WriteUint64ToByte(w io.Writer, data uint64, bigEndian bool) error + func WriteUint8ToByte(w io.Writer, data uint8) error + type AMF struct + func (amf *AMF) Marshal(v any) []byte + func (amf *AMF) Marshals(v ...any) []byte + func (amf *AMF) ReadBool() (result bool) + func (amf *AMF) ReadNumber() (result float64) + func (amf *AMF) ReadObject() (result map[string]any) + func (amf *AMF) ReadShortString() (result string) + func (amf *AMF) Unmarshal() (obj any, err error) + type AMF3 struct + func (amf *AMF3) Marshal(v any) []byte + func (amf *AMF3) Marshals(v ...any) []byte + func (amf *AMF3) Unmarshal() (obj any, err error) + type APIError struct + Code int + Message string + type APIResult struct + Code int + Data any + Message string + type BLL struct + ByteLength int + func (list *BLL) Clear() + func (list *BLL) GetByte(index int) (b byte) + func (list *BLL) GetUint24(index int) uint32 + func (list *BLL) GetUintN(index int, n int) (result uint32) + func (list *BLL) NewReader() *BLLReader + func (list *BLL) Push(item LIBP) + func (list *BLL) Recycle() + func (list *BLL) Shift() (item LIBP) + func (list *BLL) ToBuffers() (result net.Buffers) + func (list *BLL) ToBytes() (b []byte) + func (list *BLL) WriteTo(w io.Writer) (int64, error) + type BLLReader struct + func (r *BLLReader) CanRead() bool + func (r *BLLReader) GetOffset() int + func (r *BLLReader) LEB128Unmarshal() (uint, int, error) + func (r *BLLReader) ReadBE(n int) (be uint32, err error) + func (r *BLLReader) ReadByte() (b byte, err error) + func (r *BLLReader) ReadN(n int) (result net.Buffers) + func (r *BLLReader) Skip(n int) (err error) + func (r *BLLReader) WriteNTo(n int, result *net.Buffers) (actual int) + type BLLs struct + ByteLength int + func (list *BLLs) NewReader() *BLLsReader + func (list *BLLs) Push(item LIBP) + func (list *BLLs) PushValue(item *BLL) + func (list *BLLs) Recycle() + func (list *BLLs) ToBuffers() (result net.Buffers) + func (list *BLLs) ToBytes() (result []byte) + func (list *BLLs) ToList() (result [][][]byte) + type BLLsReader struct + func (r *BLLsReader) CanRead() bool + func (r *BLLsReader) ReadByte() (b byte, err error) + type Buffer []byte + func (Buffer) Reuse() bool + func (b *Buffer) Malloc(count int) Buffer + func (b *Buffer) Read(buf []byte) (n int, err error) + func (b *Buffer) ReadByte() byte + func (b *Buffer) ReadFloat64() float64 + func (b *Buffer) ReadN(n int) Buffer + func (b *Buffer) ReadUint16() uint16 + func (b *Buffer) ReadUint24() uint32 + func (b *Buffer) ReadUint32() uint32 + func (b *Buffer) ReadUint64() uint64 + func (b *Buffer) Relloc(count int) + func (b *Buffer) Reset() + func (b *Buffer) Split(n int) (result net.Buffers) + func (b *Buffer) Write(a []byte) (n int, err error) + func (b *Buffer) WriteByte(v byte) + func (b *Buffer) WriteFloat64(v float64) + func (b *Buffer) WriteString(a string) + func (b *Buffer) WriteUint16(v uint16) + func (b *Buffer) WriteUint24(v uint32) + func (b *Buffer) WriteUint32(v uint32) + func (b Buffer) Bytes() []byte + func (b Buffer) CanRead() bool + func (b Buffer) CanReadN(n int) bool + func (b Buffer) Cap() int + func (b Buffer) Clone() (result Buffer) + func (b Buffer) Len() int + func (b Buffer) SubBuf(start int, length int) Buffer + type Builder struct + func NewBuilder() *Builder + func (b *Builder) AddBool(name string) *Builder + func (b *Builder) AddField(field string, typ reflect.Type) *Builder + func (b *Builder) AddFloat64(name string) *Builder + func (b *Builder) AddInt64(name string) *Builder + func (b *Builder) AddString(name string) *Builder + func (b *Builder) Build() *Struct + type BytesPool []List[Buffer] + func (p BytesPool) Get(size int) (item LIBP) + func (p BytesPool) GetShell(b []byte) (item LIBP) + type Crc32Reader struct + Crc32 uint32 + R io.Reader + func (cr *Crc32Reader) Read(b []byte) (n int, err error) + func (cr *Crc32Reader) ReadCrc32UIntAndCheck() (err error) + type Crc32Writer struct + Crc32 uint32 + W io.Writer + func (wr *Crc32Writer) Write(b []byte) (n int, err error) + type DTSEstimator struct + func NewDTSEstimator() *DTSEstimator + func (d *DTSEstimator) Clone() *DTSEstimator + func (d *DTSEstimator) Feed(pts uint32) uint32 + type EcmaArray map[string]any + type IAMF interface + Marshal func(any) []byte + Marshals func(...any) []byte + Unmarshal func() (any, error) + type IBuffer interface + Bytes func() []byte + CanRead func() bool + CanReadN func(n int) bool + Cap func() int + Clone func() Buffer + Len func() int + Malloc func(count int) Buffer + Read func(buf []byte) (n int, err error) + ReadByte func() byte + ReadFloat64 func() float64 + ReadN func(n int) Buffer + ReadUint16 func() uint16 + ReadUint24 func() uint32 + ReadUint32 func() uint32 + ReadUint64 func() uint64 + Reset func() + Reuse func() bool + SubBuf func(start int, length int) Buffer + Write func(a []byte) (n int, err error) + WriteByte func(v byte) + WriteFloat64 func(v float64) + WriteString func(a string) + WriteUint16 func(v uint16) + WriteUint24 func(v uint32) + WriteUint32 func(v uint32) + type IBytes interface + Bytes func() []byte + Len func() int + Reuse func() bool + type IDataFrame interface + Broadcast func() + Discard func() int32 + GetSequence func() uint32 + Init func() + IsDiscarded func() bool + IsWriting func() bool + ReaderCount func() int32 + ReaderEnter func() int32 + ReaderLeave func() int32 + Ready func() + Reset func() + SetSequence func(uint32) + StartWrite func() bool + Wait func() + type IList interface + Clear func() + Push func(*ListItem[T]) + Shift func() *ListItem[T] + type IOVec struct + Data [][]byte + Length int + func (iov *IOVec) Append(b []byte) + func (iov *IOVec) WriteTo(w io.Writer, n int) (written int, err error) + type IOVecWriter struct + func NewIOVecWriter(w io.Writer) (iow *IOVecWriter) + func (iow *IOVecWriter) Flush() error + func (iow *IOVecWriter) Write(data []byte) (written int, err error) + type Instance struct + func (i *Instance) Addr() interface{} + func (i *Instance) Interface() interface{} + func (in *Instance) SetBool(name string, value bool) + func (in *Instance) SetFloat64(name string, value float64) + func (in *Instance) SetInt64(name string, value int64) + func (in *Instance) SetString(name, value string) + func (in Instance) Field(name string) (reflect.Value, error) + type Integer interface + type LIB = ListItem[Buffer] + type LIBP = *LIB + type LimitBuffer struct + func (b *LimitBuffer) Malloc(count int) (result LimitBuffer) + func (b *LimitBuffer) ReadN(n int) (result LimitBuffer) + func (b *LimitBuffer) Write(a []byte) (n int, err error) + func (b LimitBuffer) Clone() (result LimitBuffer) + func (b LimitBuffer) SubBuf(start int, length int) (result LimitBuffer) + type List struct + Length int + func (p *List[T]) Clear() + func (p *List[T]) PoolShift() (head *ListItem[T]) + func (p *List[T]) Push(item *ListItem[T]) + func (p *List[T]) PushValue(value T) + func (p *List[T]) Range(do func(value T) bool) + func (p *List[T]) RangeItem(do func(*ListItem[T]) bool) + func (p *List[T]) Recycle() + func (p *List[T]) Shift() (head *ListItem[T]) + func (p *List[T]) ShiftValue() T + func (p *List[T]) Transfer(target IList[T]) + func (p *List[T]) Unshift(item *ListItem[T]) + func (p *List[T]) UnshiftValue(value T) + type ListItem struct + Next *ListItem[T] + Pool *List[T] + Pre *ListItem[T] + Value T + func NewListItem[T any](value T) *ListItem[T] + func (item *ListItem[T]) InsertAfter(insert *ListItem[T]) + func (item *ListItem[T]) InsertAfterValue(value T) (result *ListItem[T]) + func (item *ListItem[T]) InsertBefore(insert *ListItem[T]) + func (item *ListItem[T]) InsertBeforeValue(value T) (result *ListItem[T]) + func (item *ListItem[T]) IsRoot() bool + func (item *ListItem[T]) Range(do func(value T) bool) + func (item *ListItem[T]) RangeItem(do func(*ListItem[T]) bool) + func (item *ListItem[T]) Recycle() + type Map struct + func (m *Map[K, V]) Add(k K, v V) bool + func (m *Map[K, V]) Delete(k K) (v V, ok bool) + func (m *Map[K, V]) Get(k K) (result V) + func (m *Map[K, V]) Has(k K) (ok bool) + func (m *Map[K, V]) Len() (l int) + func (m *Map[K, V]) Range(f func(K, V)) + func (m *Map[K, V]) Set(k K, v V) + func (m *Map[K, V]) ToList() (r []V) + type Pool List[T] + func (p *Pool[T]) Get() (item *ListItem[T]) + type Promise struct + Value S + func NewPromise[S any](value S) *Promise[S] + func (p *Promise[S]) Await() (err error) + func (p *Promise[S]) Then(resolved func(S), rejected func(error)) + func (r *Promise[S]) Reject(err error) + func (r *Promise[S]) Resolve() + type RTPReorder struct + Drop uint32 + Total uint32 + func (p *RTPReorder[T]) Pop() (result T) + func (p *RTPReorder[T]) Push(seq uint16, v T) (result T) + type Recyclable interface + Recycle func() + type ReuseBuffer struct + func (ReuseBuffer) Reuse() bool + type Ring struct + Value T + func NewRing[T any](n int) *Ring[T] + func (r *Ring[T]) Do(f func(T)) + func (r *Ring[T]) Len() int + func (r *Ring[T]) Link(s *Ring[T]) *Ring[T] + func (r *Ring[T]) Move(n int) *Ring[T] + func (r *Ring[T]) Next() *Ring[T] + func (r *Ring[T]) Prev() *Ring[T] + func (r *Ring[T]) Unlink(n int) *Ring[T] + type RingWriter struct + LastValue F + ReaderCount atomic.Int32 + Size int + func (rb *RingWriter[T, F]) GetReaderCount() int32 + func (rb *RingWriter[T, F]) Glow(size int) (newItem *Ring[F]) + func (rb *RingWriter[T, F]) Init(n int, constructor func() F) *RingWriter[T, F] + func (rb *RingWriter[T, F]) Recycle(r *Ring[F]) + func (rb *RingWriter[T, F]) Reduce(size int) + func (rb *RingWriter[T, F]) Step() (normal bool) + type SSE struct + func NewSSE(w http.ResponseWriter, ctx context.Context) *SSE + func (sse *SSE) Write(data []byte) (n int, err error) + func (sse *SSE) WriteEvent(event string, data []byte) (err error) + func (sse *SSE) WriteExec(cmd *exec.Cmd) error + func (sse *SSE) WriteJSON(data any) error + func (sse *SSE) WriteYAML(data any) error + type SafeChan struct + C chan T + func (sc *SafeChan[T]) Close() bool + func (sc *SafeChan[T]) Init(n int) + func (sc *SafeChan[T]) IsClosed() bool + func (sc *SafeChan[T]) IsEmpty() bool + func (sc *SafeChan[T]) IsFull() bool + func (sc *SafeChan[T]) Send(v T) bool + type Slice []T + func (s *Slice[T]) Add(v T) + func (s *Slice[T]) Delete(v T) bool + func (s *Slice[T]) Reset() + func (s *Slice[T]) ResetAppend(first T) + func (s Slice[T]) Len() int + type Struct struct + func (s Struct) New() *Instance + type SysIOVec struct + Base uintptr + Length uint64 + type TimestampProcessor struct + func (p *TimestampProcessor) ProcessTimestamp(timestamp int) int