From 5facab1a48124a912f3e2048a49a68ef05b560df Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sun, 1 Nov 2020 22:56:56 +0100 Subject: [PATCH] move subpackages into internal/ --- {client => internal/client}/client.go | 8 ++++---- {client => internal/client}/utils.go | 0 .../clientman}/clientman.go | 10 +++++----- {conf => internal/conf}/conf.go | 4 ++-- {conf => internal/conf}/pathconf.go | 0 {conf => internal/conf}/utils.go | 0 {confenv => internal/confenv}/confenv.go | 0 .../confwatcher}/confwatcher.go | 0 .../externalcmd}/externalcmd.go | 0 .../loghandler}/loghandler.go | 2 +- {metrics => internal/metrics}/metrics.go | 2 +- {path => internal/path}/path.go | 12 +++++------ {path => internal/path}/readersmap.go | 0 {pathman => internal/pathman}/pathman.go | 8 ++++---- {pprof => internal/pprof}/pprof.go | 0 {servertcp => internal/servertcp}/server.go | 0 {serverudp => internal/serverudp}/server.go | 0 {sourcertmp => internal/sourcertmp}/source.go | 2 +- {sourcertsp => internal/sourcertsp}/source.go | 2 +- {stats => internal/stats}/stats.go | 0 {syslog => internal/syslog}/syslog_unix.go | 0 {syslog => internal/syslog}/syslog_win.go | 0 main.go | 20 +++++++++---------- main_test.go | 2 +- 24 files changed, 36 insertions(+), 36 deletions(-) rename {client => internal/client}/client.go (99%) rename {client => internal/client}/utils.go (100%) rename {clientman => internal/clientman}/clientman.go (92%) rename {conf => internal/conf}/conf.go (97%) rename {conf => internal/conf}/pathconf.go (100%) rename {conf => internal/conf}/utils.go (100%) rename {confenv => internal/confenv}/confenv.go (100%) rename {confwatcher => internal/confwatcher}/confwatcher.go (100%) rename {externalcmd => internal/externalcmd}/externalcmd.go (100%) rename {loghandler => internal/loghandler}/loghandler.go (96%) rename {metrics => internal/metrics}/metrics.go (97%) rename {path => internal/path}/path.go (98%) rename {path => internal/path}/readersmap.go (100%) rename {pathman => internal/pathman}/pathman.go (97%) rename {pprof => internal/pprof}/pprof.go (100%) rename {servertcp => internal/servertcp}/server.go (100%) rename {serverudp => internal/serverudp}/server.go (100%) rename {sourcertmp => internal/sourcertmp}/source.go (99%) rename {sourcertsp => internal/sourcertsp}/source.go (98%) rename {stats => internal/stats}/stats.go (100%) rename {syslog => internal/syslog}/syslog_unix.go (100%) rename {syslog => internal/syslog}/syslog_win.go (100%) diff --git a/client/client.go b/internal/client/client.go similarity index 99% rename from client/client.go rename to internal/client/client.go index dd0b09c0..c9a4e8f2 100644 --- a/client/client.go +++ b/internal/client/client.go @@ -17,10 +17,10 @@ import ( "github.com/aler9/gortsplib/headers" "github.com/aler9/gortsplib/rtcpreceiver" - "github.com/aler9/rtsp-simple-server/conf" - "github.com/aler9/rtsp-simple-server/externalcmd" - "github.com/aler9/rtsp-simple-server/serverudp" - "github.com/aler9/rtsp-simple-server/stats" + "github.com/aler9/rtsp-simple-server/internal/conf" + "github.com/aler9/rtsp-simple-server/internal/externalcmd" + "github.com/aler9/rtsp-simple-server/internal/serverudp" + "github.com/aler9/rtsp-simple-server/internal/stats" ) const ( diff --git a/client/utils.go b/internal/client/utils.go similarity index 100% rename from client/utils.go rename to internal/client/utils.go diff --git a/clientman/clientman.go b/internal/clientman/clientman.go similarity index 92% rename from clientman/clientman.go rename to internal/clientman/clientman.go index 4278a29c..55707d9a 100644 --- a/clientman/clientman.go +++ b/internal/clientman/clientman.go @@ -8,11 +8,11 @@ import ( "github.com/aler9/gortsplib/base" "github.com/aler9/gortsplib/headers" - "github.com/aler9/rtsp-simple-server/client" - "github.com/aler9/rtsp-simple-server/pathman" - "github.com/aler9/rtsp-simple-server/servertcp" - "github.com/aler9/rtsp-simple-server/serverudp" - "github.com/aler9/rtsp-simple-server/stats" + "github.com/aler9/rtsp-simple-server/internal/client" + "github.com/aler9/rtsp-simple-server/internal/pathman" + "github.com/aler9/rtsp-simple-server/internal/servertcp" + "github.com/aler9/rtsp-simple-server/internal/serverudp" + "github.com/aler9/rtsp-simple-server/internal/stats" ) type Parent interface { diff --git a/conf/conf.go b/internal/conf/conf.go similarity index 97% rename from conf/conf.go rename to internal/conf/conf.go index 171a77ba..560f4024 100644 --- a/conf/conf.go +++ b/internal/conf/conf.go @@ -9,8 +9,8 @@ import ( "github.com/aler9/gortsplib/headers" "gopkg.in/yaml.v2" - "github.com/aler9/rtsp-simple-server/confenv" - "github.com/aler9/rtsp-simple-server/loghandler" + "github.com/aler9/rtsp-simple-server/internal/confenv" + "github.com/aler9/rtsp-simple-server/internal/loghandler" ) type Conf struct { diff --git a/conf/pathconf.go b/internal/conf/pathconf.go similarity index 100% rename from conf/pathconf.go rename to internal/conf/pathconf.go diff --git a/conf/utils.go b/internal/conf/utils.go similarity index 100% rename from conf/utils.go rename to internal/conf/utils.go diff --git a/confenv/confenv.go b/internal/confenv/confenv.go similarity index 100% rename from confenv/confenv.go rename to internal/confenv/confenv.go diff --git a/confwatcher/confwatcher.go b/internal/confwatcher/confwatcher.go similarity index 100% rename from confwatcher/confwatcher.go rename to internal/confwatcher/confwatcher.go diff --git a/externalcmd/externalcmd.go b/internal/externalcmd/externalcmd.go similarity index 100% rename from externalcmd/externalcmd.go rename to internal/externalcmd/externalcmd.go diff --git a/loghandler/loghandler.go b/internal/loghandler/loghandler.go similarity index 96% rename from loghandler/loghandler.go rename to internal/loghandler/loghandler.go index af85f4e8..e756589a 100644 --- a/loghandler/loghandler.go +++ b/internal/loghandler/loghandler.go @@ -5,7 +5,7 @@ import ( "log" "os" - "github.com/aler9/rtsp-simple-server/syslog" + "github.com/aler9/rtsp-simple-server/internal/syslog" ) type Destination int diff --git a/metrics/metrics.go b/internal/metrics/metrics.go similarity index 97% rename from metrics/metrics.go rename to internal/metrics/metrics.go index 5df9f5da..56d24564 100644 --- a/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -9,7 +9,7 @@ import ( "sync/atomic" "time" - "github.com/aler9/rtsp-simple-server/stats" + "github.com/aler9/rtsp-simple-server/internal/stats" ) const ( diff --git a/path/path.go b/internal/path/path.go similarity index 98% rename from path/path.go rename to internal/path/path.go index 7c325f33..b2fe4f30 100644 --- a/path/path.go +++ b/internal/path/path.go @@ -11,12 +11,12 @@ import ( "github.com/aler9/gortsplib" "github.com/aler9/gortsplib/base" - "github.com/aler9/rtsp-simple-server/client" - "github.com/aler9/rtsp-simple-server/conf" - "github.com/aler9/rtsp-simple-server/externalcmd" - "github.com/aler9/rtsp-simple-server/sourcertmp" - "github.com/aler9/rtsp-simple-server/sourcertsp" - "github.com/aler9/rtsp-simple-server/stats" + "github.com/aler9/rtsp-simple-server/internal/client" + "github.com/aler9/rtsp-simple-server/internal/conf" + "github.com/aler9/rtsp-simple-server/internal/externalcmd" + "github.com/aler9/rtsp-simple-server/internal/sourcertmp" + "github.com/aler9/rtsp-simple-server/internal/sourcertsp" + "github.com/aler9/rtsp-simple-server/internal/stats" ) func newEmptyTimer() *time.Timer { diff --git a/path/readersmap.go b/internal/path/readersmap.go similarity index 100% rename from path/readersmap.go rename to internal/path/readersmap.go diff --git a/pathman/pathman.go b/internal/pathman/pathman.go similarity index 97% rename from pathman/pathman.go rename to internal/pathman/pathman.go index 789c344f..4371f312 100644 --- a/pathman/pathman.go +++ b/internal/pathman/pathman.go @@ -9,10 +9,10 @@ import ( "github.com/aler9/gortsplib/base" "github.com/aler9/gortsplib/headers" - "github.com/aler9/rtsp-simple-server/client" - "github.com/aler9/rtsp-simple-server/conf" - "github.com/aler9/rtsp-simple-server/path" - "github.com/aler9/rtsp-simple-server/stats" + "github.com/aler9/rtsp-simple-server/internal/client" + "github.com/aler9/rtsp-simple-server/internal/conf" + "github.com/aler9/rtsp-simple-server/internal/path" + "github.com/aler9/rtsp-simple-server/internal/stats" ) type Parent interface { diff --git a/pprof/pprof.go b/internal/pprof/pprof.go similarity index 100% rename from pprof/pprof.go rename to internal/pprof/pprof.go diff --git a/servertcp/server.go b/internal/servertcp/server.go similarity index 100% rename from servertcp/server.go rename to internal/servertcp/server.go diff --git a/serverudp/server.go b/internal/serverudp/server.go similarity index 100% rename from serverudp/server.go rename to internal/serverudp/server.go diff --git a/sourcertmp/source.go b/internal/sourcertmp/source.go similarity index 99% rename from sourcertmp/source.go rename to internal/sourcertmp/source.go index 147d5faa..a085d9a9 100644 --- a/sourcertmp/source.go +++ b/internal/sourcertmp/source.go @@ -14,7 +14,7 @@ import ( "github.com/notedit/rtmp/codec/h264" "github.com/notedit/rtmp/format/rtmp" - "github.com/aler9/rtsp-simple-server/stats" + "github.com/aler9/rtsp-simple-server/internal/stats" ) const ( diff --git a/sourcertsp/source.go b/internal/sourcertsp/source.go similarity index 98% rename from sourcertsp/source.go rename to internal/sourcertsp/source.go index c2f1c693..a427e1e6 100644 --- a/sourcertsp/source.go +++ b/internal/sourcertsp/source.go @@ -7,7 +7,7 @@ import ( "github.com/aler9/gortsplib" - "github.com/aler9/rtsp-simple-server/stats" + "github.com/aler9/rtsp-simple-server/internal/stats" ) const ( diff --git a/stats/stats.go b/internal/stats/stats.go similarity index 100% rename from stats/stats.go rename to internal/stats/stats.go diff --git a/syslog/syslog_unix.go b/internal/syslog/syslog_unix.go similarity index 100% rename from syslog/syslog_unix.go rename to internal/syslog/syslog_unix.go diff --git a/syslog/syslog_win.go b/internal/syslog/syslog_win.go similarity index 100% rename from syslog/syslog_win.go rename to internal/syslog/syslog_win.go diff --git a/main.go b/main.go index e8c64619..1f5b9108 100644 --- a/main.go +++ b/main.go @@ -10,16 +10,16 @@ import ( "github.com/aler9/gortsplib" "gopkg.in/alecthomas/kingpin.v2" - "github.com/aler9/rtsp-simple-server/clientman" - "github.com/aler9/rtsp-simple-server/conf" - "github.com/aler9/rtsp-simple-server/confwatcher" - "github.com/aler9/rtsp-simple-server/loghandler" - "github.com/aler9/rtsp-simple-server/metrics" - "github.com/aler9/rtsp-simple-server/pathman" - "github.com/aler9/rtsp-simple-server/pprof" - "github.com/aler9/rtsp-simple-server/servertcp" - "github.com/aler9/rtsp-simple-server/serverudp" - "github.com/aler9/rtsp-simple-server/stats" + "github.com/aler9/rtsp-simple-server/internal/clientman" + "github.com/aler9/rtsp-simple-server/internal/conf" + "github.com/aler9/rtsp-simple-server/internal/confwatcher" + "github.com/aler9/rtsp-simple-server/internal/loghandler" + "github.com/aler9/rtsp-simple-server/internal/metrics" + "github.com/aler9/rtsp-simple-server/internal/pathman" + "github.com/aler9/rtsp-simple-server/internal/pprof" + "github.com/aler9/rtsp-simple-server/internal/servertcp" + "github.com/aler9/rtsp-simple-server/internal/serverudp" + "github.com/aler9/rtsp-simple-server/internal/stats" ) var Version = "v0.0.0" diff --git a/main_test.go b/main_test.go index cba026a3..49fc2a70 100644 --- a/main_test.go +++ b/main_test.go @@ -14,7 +14,7 @@ import ( "github.com/aler9/gortsplib" "github.com/stretchr/testify/require" - "github.com/aler9/rtsp-simple-server/conf" + "github.com/aler9/rtsp-simple-server/internal/conf" ) var ownDockerIp = func() string {