From 3032dcec1ae889e3ac07546fa6e75c9993a0cb06 Mon Sep 17 00:00:00 2001 From: Dmitry Kravtsov Date: Sat, 2 May 2020 20:31:14 +0300 Subject: [PATCH] Refactor imports and module name --- configure/channel.go | 2 +- container/flv/demuxer.go | 2 +- container/flv/muxer.go | 10 +++++----- container/flv/tag.go | 2 +- container/ts/muxer.go | 2 +- container/ts/muxer_test.go | 2 +- go.mod | 3 ++- main.go | 10 +++++----- parser/aac/parser.go | 2 +- parser/parser.go | 8 ++++---- protocol/api/api.go | 8 ++++---- protocol/hls/hls.go | 4 ++-- protocol/hls/source.go | 10 +++++----- protocol/httpflv/server.go | 4 ++-- protocol/httpflv/writer.go | 8 ++++---- protocol/rtmp/cache/cache.go | 4 ++-- protocol/rtmp/cache/gop.go | 2 +- protocol/rtmp/cache/special.go | 4 ++-- protocol/rtmp/core/chunk_stream.go | 4 ++-- protocol/rtmp/core/chunk_stream_test.go | 2 +- protocol/rtmp/core/conn.go | 4 ++-- protocol/rtmp/core/conn_client.go | 4 ++-- protocol/rtmp/core/conn_server.go | 4 ++-- protocol/rtmp/core/conn_test.go | 2 +- protocol/rtmp/core/handshake.go | 2 +- protocol/rtmp/rtmp.go | 10 +++++----- protocol/rtmp/rtmprelay/rtmprelay.go | 4 ++-- protocol/rtmp/rtmprelay/staticrelay.go | 6 +++--- protocol/rtmp/stream.go | 6 +++--- utils/queue/queue.go | 2 +- 30 files changed, 69 insertions(+), 68 deletions(-) diff --git a/configure/channel.go b/configure/channel.go index 270c52aa..f85fb8f4 100755 --- a/configure/channel.go +++ b/configure/channel.go @@ -3,7 +3,7 @@ package configure import ( "fmt" - "livego/utils/uid" + "github.com/gwuhaolin/livego/utils/uid" "github.com/go-redis/redis/v7" "github.com/patrickmn/go-cache" diff --git a/container/flv/demuxer.go b/container/flv/demuxer.go index 896d39ad..c4f69ec0 100755 --- a/container/flv/demuxer.go +++ b/container/flv/demuxer.go @@ -2,7 +2,7 @@ package flv import ( "fmt" - "livego/av" + "github.com/gwuhaolin/livego/av" ) var ( diff --git a/container/flv/muxer.go b/container/flv/muxer.go index f7ef137d..fdcc07a8 100755 --- a/container/flv/muxer.go +++ b/container/flv/muxer.go @@ -7,11 +7,11 @@ import ( "strings" "time" - "livego/av" - "livego/configure" - "livego/protocol/amf" - "livego/utils/pio" - "livego/utils/uid" + "github.com/gwuhaolin/livego/av" + "github.com/gwuhaolin/livego/configure" + "github.com/gwuhaolin/livego/protocol/amf" + "github.com/gwuhaolin/livego/utils/pio" + "github.com/gwuhaolin/livego/utils/uid" log "github.com/sirupsen/logrus" ) diff --git a/container/flv/tag.go b/container/flv/tag.go index d2aec4f5..5c85466e 100755 --- a/container/flv/tag.go +++ b/container/flv/tag.go @@ -3,7 +3,7 @@ package flv import ( "fmt" - "livego/av" + "github.com/gwuhaolin/livego/av" ) type flvTag struct { diff --git a/container/ts/muxer.go b/container/ts/muxer.go index 8f7ad3d2..cbb9981d 100755 --- a/container/ts/muxer.go +++ b/container/ts/muxer.go @@ -3,7 +3,7 @@ package ts import ( "io" - "livego/av" + "github.com/gwuhaolin/livego/av" ) const ( diff --git a/container/ts/muxer_test.go b/container/ts/muxer_test.go index 5ee3cf38..f13eaccb 100755 --- a/container/ts/muxer_test.go +++ b/container/ts/muxer_test.go @@ -3,7 +3,7 @@ package ts import ( "testing" - "livego/av" + "github.com/gwuhaolin/livego/av" "github.com/stretchr/testify/assert" ) diff --git a/go.mod b/go.mod index e1cf69ea..6503fa14 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module livego +module github.com/gwuhaolin/livego go 1.13 @@ -14,6 +14,7 @@ require ( github.com/sirupsen/logrus v1.5.0 github.com/spf13/pflag v1.0.3 github.com/spf13/viper v1.6.3 + github.com/stretchr/objx v0.1.1 // indirect github.com/stretchr/testify v1.4.0 github.com/urfave/negroni v1.0.0 // indirect ) diff --git a/main.go b/main.go index 32a9f2d7..2cf6eca3 100755 --- a/main.go +++ b/main.go @@ -2,11 +2,11 @@ package main import ( "fmt" - "livego/configure" - "livego/protocol/api" - "livego/protocol/hls" - "livego/protocol/httpflv" - "livego/protocol/rtmp" + "github.com/gwuhaolin/livego/configure" + "github.com/gwuhaolin/livego/protocol/api" + "github.com/gwuhaolin/livego/protocol/hls" + "github.com/gwuhaolin/livego/protocol/httpflv" + "github.com/gwuhaolin/livego/protocol/rtmp" "net" "path" "runtime" diff --git a/parser/aac/parser.go b/parser/aac/parser.go index f05bcf68..81af84f2 100755 --- a/parser/aac/parser.go +++ b/parser/aac/parser.go @@ -4,7 +4,7 @@ import ( "fmt" "io" - "livego/av" + "github.com/gwuhaolin/livego/av" ) type mpegExtension struct { diff --git a/parser/parser.go b/parser/parser.go index 8fa8f9b9..e256e5e4 100755 --- a/parser/parser.go +++ b/parser/parser.go @@ -4,10 +4,10 @@ import ( "fmt" "io" - "livego/av" - "livego/parser/aac" - "livego/parser/h264" - "livego/parser/mp3" + "github.com/gwuhaolin/livego/av" + "github.com/gwuhaolin/livego/parser/aac" + "github.com/gwuhaolin/livego/parser/h264" + "github.com/gwuhaolin/livego/parser/mp3" ) var ( diff --git a/protocol/api/api.go b/protocol/api/api.go index 20cb22b9..c424580d 100755 --- a/protocol/api/api.go +++ b/protocol/api/api.go @@ -6,10 +6,10 @@ import ( "net" "net/http" - "livego/av" - "livego/configure" - "livego/protocol/rtmp" - "livego/protocol/rtmp/rtmprelay" + "github.com/gwuhaolin/livego/av" + "github.com/gwuhaolin/livego/configure" + "github.com/gwuhaolin/livego/protocol/rtmp" + "github.com/gwuhaolin/livego/protocol/rtmp/rtmprelay" jwtmiddleware "github.com/auth0/go-jwt-middleware" "github.com/dgrijalva/jwt-go" diff --git a/protocol/hls/hls.go b/protocol/hls/hls.go index 83781612..57e2ba2f 100755 --- a/protocol/hls/hls.go +++ b/protocol/hls/hls.go @@ -2,7 +2,7 @@ package hls import ( "fmt" - "livego/configure" + "github.com/gwuhaolin/livego/configure" "net" "net/http" "path" @@ -10,7 +10,7 @@ import ( "strings" "time" - "livego/av" + "github.com/gwuhaolin/livego/av" cmap "github.com/orcaman/concurrent-map" log "github.com/sirupsen/logrus" diff --git a/protocol/hls/source.go b/protocol/hls/source.go index 5b2ef8fe..0d9dc7f5 100644 --- a/protocol/hls/source.go +++ b/protocol/hls/source.go @@ -3,13 +3,13 @@ package hls import ( "bytes" "fmt" - "livego/configure" + "github.com/gwuhaolin/livego/configure" "time" - "livego/av" - "livego/container/flv" - "livego/container/ts" - "livego/parser" + "github.com/gwuhaolin/livego/av" + "github.com/gwuhaolin/livego/container/flv" + "github.com/gwuhaolin/livego/container/ts" + "github.com/gwuhaolin/livego/parser" log "github.com/sirupsen/logrus" ) diff --git a/protocol/httpflv/server.go b/protocol/httpflv/server.go index 07dc2f2b..3d7f6657 100644 --- a/protocol/httpflv/server.go +++ b/protocol/httpflv/server.go @@ -6,8 +6,8 @@ import ( "net/http" "strings" - "livego/av" - "livego/protocol/rtmp" + "github.com/gwuhaolin/livego/av" + "github.com/gwuhaolin/livego/protocol/rtmp" log "github.com/sirupsen/logrus" ) diff --git a/protocol/httpflv/writer.go b/protocol/httpflv/writer.go index bb65ade3..e6caa73a 100755 --- a/protocol/httpflv/writer.go +++ b/protocol/httpflv/writer.go @@ -5,10 +5,10 @@ import ( "net/http" "time" - "livego/av" - "livego/protocol/amf" - "livego/utils/pio" - "livego/utils/uid" + "github.com/gwuhaolin/livego/av" + "github.com/gwuhaolin/livego/protocol/amf" + "github.com/gwuhaolin/livego/utils/pio" + "github.com/gwuhaolin/livego/utils/uid" log "github.com/sirupsen/logrus" ) diff --git a/protocol/rtmp/cache/cache.go b/protocol/rtmp/cache/cache.go index 71af1deb..e10e1d17 100755 --- a/protocol/rtmp/cache/cache.go +++ b/protocol/rtmp/cache/cache.go @@ -1,8 +1,8 @@ package cache import ( - "livego/av" - "livego/configure" + "github.com/gwuhaolin/livego/av" + "github.com/gwuhaolin/livego/configure" ) type Cache struct { diff --git a/protocol/rtmp/cache/gop.go b/protocol/rtmp/cache/gop.go index bbf28a12..fde6d195 100755 --- a/protocol/rtmp/cache/gop.go +++ b/protocol/rtmp/cache/gop.go @@ -3,7 +3,7 @@ package cache import ( "fmt" - "livego/av" + "github.com/gwuhaolin/livego/av" ) var ( diff --git a/protocol/rtmp/cache/special.go b/protocol/rtmp/cache/special.go index 20837214..5d035299 100755 --- a/protocol/rtmp/cache/special.go +++ b/protocol/rtmp/cache/special.go @@ -3,8 +3,8 @@ package cache import ( "bytes" - "livego/av" - "livego/protocol/amf" + "github.com/gwuhaolin/livego/av" + "github.com/gwuhaolin/livego/protocol/amf" log "github.com/sirupsen/logrus" ) diff --git a/protocol/rtmp/core/chunk_stream.go b/protocol/rtmp/core/chunk_stream.go index 379646b2..33970c48 100755 --- a/protocol/rtmp/core/chunk_stream.go +++ b/protocol/rtmp/core/chunk_stream.go @@ -4,8 +4,8 @@ import ( "encoding/binary" "fmt" - "livego/av" - "livego/utils/pool" + "github.com/gwuhaolin/livego/av" + "github.com/gwuhaolin/livego/utils/pool" ) type ChunkStream struct { diff --git a/protocol/rtmp/core/chunk_stream_test.go b/protocol/rtmp/core/chunk_stream_test.go index 94cd05a6..7227eb15 100755 --- a/protocol/rtmp/core/chunk_stream_test.go +++ b/protocol/rtmp/core/chunk_stream_test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - "livego/utils/pool" + "github.com/gwuhaolin/livego/utils/pool" "github.com/stretchr/testify/assert" ) diff --git a/protocol/rtmp/core/conn.go b/protocol/rtmp/core/conn.go index 2e563a9f..610a58c8 100755 --- a/protocol/rtmp/core/conn.go +++ b/protocol/rtmp/core/conn.go @@ -5,8 +5,8 @@ import ( "net" "time" - "livego/utils/pio" - "livego/utils/pool" + "github.com/gwuhaolin/livego/utils/pio" + "github.com/gwuhaolin/livego/utils/pool" ) const ( diff --git a/protocol/rtmp/core/conn_client.go b/protocol/rtmp/core/conn_client.go index c9a70484..66eb5f0a 100755 --- a/protocol/rtmp/core/conn_client.go +++ b/protocol/rtmp/core/conn_client.go @@ -9,8 +9,8 @@ import ( neturl "net/url" "strings" - "livego/av" - "livego/protocol/amf" + "github.com/gwuhaolin/livego/av" + "github.com/gwuhaolin/livego/protocol/amf" log "github.com/sirupsen/logrus" ) diff --git a/protocol/rtmp/core/conn_server.go b/protocol/rtmp/core/conn_server.go index 83bbf69e..2bb2232d 100755 --- a/protocol/rtmp/core/conn_server.go +++ b/protocol/rtmp/core/conn_server.go @@ -5,8 +5,8 @@ import ( "fmt" "io" - "livego/av" - "livego/protocol/amf" + "github.com/gwuhaolin/livego/av" + "github.com/gwuhaolin/livego/protocol/amf" log "github.com/sirupsen/logrus" ) diff --git a/protocol/rtmp/core/conn_test.go b/protocol/rtmp/core/conn_test.go index 1f4cb9b4..a1103e92 100755 --- a/protocol/rtmp/core/conn_test.go +++ b/protocol/rtmp/core/conn_test.go @@ -5,7 +5,7 @@ import ( "io" "testing" - "livego/utils/pool" + "github.com/gwuhaolin/livego/utils/pool" "github.com/stretchr/testify/assert" ) diff --git a/protocol/rtmp/core/handshake.go b/protocol/rtmp/core/handshake.go index 61a79b20..e5583768 100755 --- a/protocol/rtmp/core/handshake.go +++ b/protocol/rtmp/core/handshake.go @@ -10,7 +10,7 @@ import ( "time" - "livego/utils/pio" + "github.com/gwuhaolin/livego/utils/pio" ) var ( diff --git a/protocol/rtmp/rtmp.go b/protocol/rtmp/rtmp.go index a724995a..ec57546b 100755 --- a/protocol/rtmp/rtmp.go +++ b/protocol/rtmp/rtmp.go @@ -8,12 +8,12 @@ import ( "strings" "time" - "livego/utils/uid" + "github.com/gwuhaolin/livego/utils/uid" - "livego/av" - "livego/configure" - "livego/container/flv" - "livego/protocol/rtmp/core" + "github.com/gwuhaolin/livego/av" + "github.com/gwuhaolin/livego/configure" + "github.com/gwuhaolin/livego/container/flv" + "github.com/gwuhaolin/livego/protocol/rtmp/core" log "github.com/sirupsen/logrus" ) diff --git a/protocol/rtmp/rtmprelay/rtmprelay.go b/protocol/rtmp/rtmprelay/rtmprelay.go index a686a52d..af152e2f 100644 --- a/protocol/rtmp/rtmprelay/rtmprelay.go +++ b/protocol/rtmp/rtmprelay/rtmprelay.go @@ -5,8 +5,8 @@ import ( "fmt" "io" - "livego/protocol/amf" - "livego/protocol/rtmp/core" + "github.com/gwuhaolin/livego/protocol/amf" + "github.com/gwuhaolin/livego/protocol/rtmp/core" log "github.com/sirupsen/logrus" ) diff --git a/protocol/rtmp/rtmprelay/staticrelay.go b/protocol/rtmp/rtmprelay/staticrelay.go index d91214a7..87238505 100644 --- a/protocol/rtmp/rtmprelay/staticrelay.go +++ b/protocol/rtmp/rtmprelay/staticrelay.go @@ -4,9 +4,9 @@ import ( "fmt" "sync" - "livego/av" - "livego/configure" - "livego/protocol/rtmp/core" + "github.com/gwuhaolin/livego/av" + "github.com/gwuhaolin/livego/configure" + "github.com/gwuhaolin/livego/protocol/rtmp/core" log "github.com/sirupsen/logrus" ) diff --git a/protocol/rtmp/stream.go b/protocol/rtmp/stream.go index 0de6948c..3ebd276c 100755 --- a/protocol/rtmp/stream.go +++ b/protocol/rtmp/stream.go @@ -5,9 +5,9 @@ import ( "strings" "time" - "livego/av" - "livego/protocol/rtmp/cache" - "livego/protocol/rtmp/rtmprelay" + "github.com/gwuhaolin/livego/av" + "github.com/gwuhaolin/livego/protocol/rtmp/cache" + "github.com/gwuhaolin/livego/protocol/rtmp/rtmprelay" cmap "github.com/orcaman/concurrent-map" log "github.com/sirupsen/logrus" diff --git a/utils/queue/queue.go b/utils/queue/queue.go index 03e4b6f7..fc82ff9b 100755 --- a/utils/queue/queue.go +++ b/utils/queue/queue.go @@ -3,7 +3,7 @@ package queue import ( "sync" - "livego/av" + "github.com/gwuhaolin/livego/av" ) // Queue is a basic FIFO queue for Messages.