feat: remove sei track

This commit is contained in:
langhuihui
2024-02-26 17:16:49 +08:00
parent 5e41a2f6bb
commit b58e926819
27 changed files with 656 additions and 670 deletions

21
io.go
View File

@@ -14,6 +14,7 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"m7s.live/engine/v4/common"
"m7s.live/engine/v4/config"
"m7s.live/engine/v4/log"
"m7s.live/engine/v4/util"
@@ -48,7 +49,11 @@ type IO struct {
io.Writer `json:"-" yaml:"-"`
io.Closer `json:"-" yaml:"-"`
Args url.Values
Spesific IIO `json:"-" yaml:"-"`
Spesific common.IIO `json:"-" yaml:"-"`
}
func (io *IO) GetStream() common.IStream {
return io.Stream
}
func (io *IO) IsClosed() bool {
@@ -93,18 +98,6 @@ func (io *IO) IsShutdown() bool {
return io.Stream.IsShutdown()
}
type IIO interface {
receive(string, IIO) error
IsClosed() bool
OnEvent(any)
Stop(reason ...zapcore.Field)
SetIO(any)
SetParentCtx(context.Context)
SetLogger(*log.Logger)
IsShutdown() bool
log.Zap
}
func (i *IO) close(err StopError) bool {
if i.IsClosed() {
i.Warn("already closed", err...)
@@ -158,7 +151,7 @@ func (io *IO) auth(key string, secret string, expire string) bool {
}
// receive 用于接收发布或者订阅
func (io *IO) receive(streamPath string, specific IIO) error {
func (io *IO) receive(streamPath string, specific common.IIO) error {
streamPath = strings.Trim(streamPath, "/")
u, err := url.Parse(streamPath)
if err != nil {