diff --git a/README.md b/README.md index ab020cb7..39512acd 100644 --- a/README.md +++ b/README.md @@ -273,7 +273,7 @@ streams: rotate: ffmpeg:rtsp://rtsp:12345678@192.168.1.123/av_stream/ch0#video=h264#rotate=90 ``` -All trascoding formats has [built-in templates](https://github.com/AlexxIT/go2rtc/blob/master/cmd/ffmpeg/ffmpeg.go): `h264`, `h265`, `opus`, `pcmu`, `pcmu/16000`, `pcmu/48000`, `pcma`, `pcma/16000`, `pcma/48000`, `aac`, `aac/16000`. +All trascoding formats has [built-in templates](https://github.com/AlexxIT/go2rtc/blob/master/internal/ffmpeg/ffmpeg.go): `h264`, `h265`, `opus`, `pcmu`, `pcmu/16000`, `pcmu/48000`, `pcma`, `pcma/16000`, `pcma/48000`, `aac`, `aac/16000`. But you can override them via YAML config. You can also add your own formats to config and use them with source params. diff --git a/cmd/README.md b/internal/README.md similarity index 100% rename from cmd/README.md rename to internal/README.md diff --git a/cmd/api/api.go b/internal/api/api.go similarity index 98% rename from cmd/api/api.go rename to internal/api/api.go index 288ffad9..09766ca5 100644 --- a/cmd/api/api.go +++ b/internal/api/api.go @@ -2,7 +2,7 @@ package api import ( "encoding/json" - "github.com/AlexxIT/go2rtc/cmd/app" + "github.com/AlexxIT/go2rtc/internal/app" "github.com/rs/zerolog" "net" "net/http" diff --git a/cmd/api/config.go b/internal/api/config.go similarity index 98% rename from cmd/api/config.go rename to internal/api/config.go index 1bc257cb..d817b689 100644 --- a/cmd/api/config.go +++ b/internal/api/config.go @@ -1,7 +1,7 @@ package api import ( - "github.com/AlexxIT/go2rtc/cmd/app" + "github.com/AlexxIT/go2rtc/internal/app" "gopkg.in/yaml.v3" "io" "net/http" diff --git a/cmd/api/static.go b/internal/api/static.go similarity index 100% rename from cmd/api/static.go rename to internal/api/static.go diff --git a/cmd/api/ws.go b/internal/api/ws.go similarity index 100% rename from cmd/api/ws.go rename to internal/api/ws.go diff --git a/cmd/app/app.go b/internal/app/app.go similarity index 100% rename from cmd/app/app.go rename to internal/app/app.go diff --git a/cmd/app/store/store.go b/internal/app/store/store.go similarity index 100% rename from cmd/app/store/store.go rename to internal/app/store/store.go diff --git a/cmd/debug/debug.go b/internal/debug/debug.go similarity index 72% rename from cmd/debug/debug.go rename to internal/debug/debug.go index 90861b37..3d40d1f1 100644 --- a/cmd/debug/debug.go +++ b/internal/debug/debug.go @@ -1,8 +1,8 @@ package debug import ( - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" ) diff --git a/cmd/debug/stack.go b/internal/debug/stack.go similarity index 79% rename from cmd/debug/stack.go rename to internal/debug/stack.go index 048ed77e..5d23cb5b 100644 --- a/cmd/debug/stack.go +++ b/internal/debug/stack.go @@ -13,15 +13,15 @@ var stackSkip = [][]byte{ []byte("created by os/signal.Notify"), // api/stack.go - []byte("github.com/AlexxIT/go2rtc/cmd/api.stackHandler"), + []byte("github.com/AlexxIT/go2rtc/internal/api.stackHandler"), // api/api.go - []byte("created by github.com/AlexxIT/go2rtc/cmd/api.Init"), + []byte("created by github.com/AlexxIT/go2rtc/internal/api.Init"), []byte("created by net/http.(*connReader).startBackgroundRead"), []byte("created by net/http.(*Server).Serve"), // TODO: why two? - []byte("created by github.com/AlexxIT/go2rtc/cmd/rtsp.Init"), - []byte("created by github.com/AlexxIT/go2rtc/cmd/srtp.Init"), + []byte("created by github.com/AlexxIT/go2rtc/internal/rtsp.Init"), + []byte("created by github.com/AlexxIT/go2rtc/internal/srtp.Init"), // webrtc/api.go []byte("created by github.com/pion/ice/v2.NewTCPMuxDefault"), diff --git a/cmd/dvrip/dvrip.go b/internal/dvrip/dvrip.go similarity index 90% rename from cmd/dvrip/dvrip.go rename to internal/dvrip/dvrip.go index 0826b009..80fe760d 100644 --- a/cmd/dvrip/dvrip.go +++ b/internal/dvrip/dvrip.go @@ -1,7 +1,7 @@ package dvrip import ( - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/dvrip" ) diff --git a/cmd/echo/echo.go b/internal/echo/echo.go similarity index 84% rename from cmd/echo/echo.go rename to internal/echo/echo.go index d0714fc9..6d7644f7 100644 --- a/cmd/echo/echo.go +++ b/internal/echo/echo.go @@ -2,8 +2,8 @@ package echo import ( "bytes" - "github.com/AlexxIT/go2rtc/cmd/app" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/app" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/shell" "os/exec" diff --git a/cmd/exec/exec.go b/internal/exec/exec.go similarity index 94% rename from cmd/exec/exec.go rename to internal/exec/exec.go index 547d6a95..b77eb4c4 100644 --- a/cmd/exec/exec.go +++ b/internal/exec/exec.go @@ -5,9 +5,9 @@ import ( "encoding/hex" "errors" "fmt" - "github.com/AlexxIT/go2rtc/cmd/app" - "github.com/AlexxIT/go2rtc/cmd/rtsp" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/app" + "github.com/AlexxIT/go2rtc/internal/rtsp" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" pkg "github.com/AlexxIT/go2rtc/pkg/rtsp" "github.com/AlexxIT/go2rtc/pkg/shell" diff --git a/cmd/ffmpeg/README.md b/internal/ffmpeg/README.md similarity index 100% rename from cmd/ffmpeg/README.md rename to internal/ffmpeg/README.md diff --git a/cmd/ffmpeg/device/device_darwin.go b/internal/ffmpeg/device/device_darwin.go similarity index 100% rename from cmd/ffmpeg/device/device_darwin.go rename to internal/ffmpeg/device/device_darwin.go diff --git a/cmd/ffmpeg/device/device_linux.go b/internal/ffmpeg/device/device_linux.go similarity index 100% rename from cmd/ffmpeg/device/device_linux.go rename to internal/ffmpeg/device/device_linux.go diff --git a/cmd/ffmpeg/device/device_windows.go b/internal/ffmpeg/device/device_windows.go similarity index 100% rename from cmd/ffmpeg/device/device_windows.go rename to internal/ffmpeg/device/device_windows.go diff --git a/cmd/ffmpeg/device/devices.go b/internal/ffmpeg/device/devices.go similarity index 95% rename from cmd/ffmpeg/device/devices.go rename to internal/ffmpeg/device/devices.go index 33610c10..e6e43b5a 100644 --- a/cmd/ffmpeg/device/devices.go +++ b/internal/ffmpeg/device/devices.go @@ -1,8 +1,8 @@ package device import ( - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/app" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/app" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/rs/zerolog" "net/http" diff --git a/cmd/ffmpeg/ffmpeg.go b/internal/ffmpeg/ffmpeg.go similarity index 97% rename from cmd/ffmpeg/ffmpeg.go rename to internal/ffmpeg/ffmpeg.go index 2cc2e488..2f48cc1b 100644 --- a/cmd/ffmpeg/ffmpeg.go +++ b/internal/ffmpeg/ffmpeg.go @@ -3,11 +3,11 @@ package ffmpeg import ( "bytes" "errors" - "github.com/AlexxIT/go2rtc/cmd/app" - "github.com/AlexxIT/go2rtc/cmd/exec" - "github.com/AlexxIT/go2rtc/cmd/ffmpeg/device" - "github.com/AlexxIT/go2rtc/cmd/rtsp" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/app" + "github.com/AlexxIT/go2rtc/internal/exec" + "github.com/AlexxIT/go2rtc/internal/ffmpeg/device" + "github.com/AlexxIT/go2rtc/internal/rtsp" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "net/url" "strconv" diff --git a/cmd/ffmpeg/ffmpeg_test.go b/internal/ffmpeg/ffmpeg_test.go similarity index 100% rename from cmd/ffmpeg/ffmpeg_test.go rename to internal/ffmpeg/ffmpeg_test.go diff --git a/cmd/ffmpeg/hardware.go b/internal/ffmpeg/hardware.go similarity index 100% rename from cmd/ffmpeg/hardware.go rename to internal/ffmpeg/hardware.go diff --git a/cmd/ffmpeg/hardware_darwin.go b/internal/ffmpeg/hardware_darwin.go similarity index 100% rename from cmd/ffmpeg/hardware_darwin.go rename to internal/ffmpeg/hardware_darwin.go diff --git a/cmd/ffmpeg/hardware_linux.go b/internal/ffmpeg/hardware_linux.go similarity index 100% rename from cmd/ffmpeg/hardware_linux.go rename to internal/ffmpeg/hardware_linux.go diff --git a/cmd/ffmpeg/hardware_windows.go b/internal/ffmpeg/hardware_windows.go similarity index 100% rename from cmd/ffmpeg/hardware_windows.go rename to internal/ffmpeg/hardware_windows.go diff --git a/cmd/hass/api.go b/internal/hass/api.go similarity index 94% rename from cmd/hass/api.go rename to internal/hass/api.go index f5ff5572..5c8294eb 100644 --- a/cmd/hass/api.go +++ b/internal/hass/api.go @@ -3,9 +3,9 @@ package hass import ( "encoding/base64" "encoding/json" - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/streams" - "github.com/AlexxIT/go2rtc/cmd/webrtc" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/streams" + "github.com/AlexxIT/go2rtc/internal/webrtc" "net" "net/http" "strings" diff --git a/cmd/hass/hass.go b/internal/hass/hass.go similarity index 95% rename from cmd/hass/hass.go rename to internal/hass/hass.go index 32d0771e..e9a9f9b4 100644 --- a/cmd/hass/hass.go +++ b/internal/hass/hass.go @@ -4,10 +4,10 @@ import ( "bytes" "encoding/json" "fmt" - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/app" - "github.com/AlexxIT/go2rtc/cmd/roborock" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/app" + "github.com/AlexxIT/go2rtc/internal/roborock" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/rs/zerolog" "net/http" diff --git a/cmd/hls/hls.go b/internal/hls/hls.go similarity index 98% rename from cmd/hls/hls.go rename to internal/hls/hls.go index 2cd9685d..06e841cd 100644 --- a/cmd/hls/hls.go +++ b/internal/hls/hls.go @@ -2,8 +2,8 @@ package hls import ( "fmt" - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/mp4" "github.com/AlexxIT/go2rtc/pkg/mpegts" diff --git a/cmd/homekit/api.go b/internal/homekit/api.go similarity index 96% rename from cmd/homekit/api.go rename to internal/homekit/api.go index a055871a..39fdaa43 100644 --- a/cmd/homekit/api.go +++ b/internal/homekit/api.go @@ -3,8 +3,8 @@ package homekit import ( "encoding/json" "fmt" - "github.com/AlexxIT/go2rtc/cmd/app/store" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/app/store" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/hap" "github.com/AlexxIT/go2rtc/pkg/hap/mdns" "net/http" diff --git a/cmd/homekit/homekit.go b/internal/homekit/homekit.go similarity index 74% rename from cmd/homekit/homekit.go rename to internal/homekit/homekit.go index 1e7d0756..8376fd2e 100644 --- a/cmd/homekit/homekit.go +++ b/internal/homekit/homekit.go @@ -1,10 +1,10 @@ package homekit import ( - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/app" - "github.com/AlexxIT/go2rtc/cmd/srtp" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/app" + "github.com/AlexxIT/go2rtc/internal/srtp" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/homekit" "github.com/rs/zerolog" diff --git a/cmd/http/http.go b/internal/http/http.go similarity index 96% rename from cmd/http/http.go rename to internal/http/http.go index 167f0f13..1bb86a26 100644 --- a/cmd/http/http.go +++ b/internal/http/http.go @@ -3,7 +3,7 @@ package http import ( "errors" "fmt" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/mjpeg" "github.com/AlexxIT/go2rtc/pkg/mpegts" diff --git a/cmd/isapi/init.go b/internal/isapi/init.go similarity index 88% rename from cmd/isapi/init.go rename to internal/isapi/init.go index 33bb85a7..a37afa23 100644 --- a/cmd/isapi/init.go +++ b/internal/isapi/init.go @@ -1,7 +1,7 @@ package isapi import ( - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/isapi" ) diff --git a/cmd/ivideon/ivideon.go b/internal/ivideon/ivideon.go similarity index 88% rename from cmd/ivideon/ivideon.go rename to internal/ivideon/ivideon.go index d63edfd5..0ae5dc9f 100644 --- a/cmd/ivideon/ivideon.go +++ b/internal/ivideon/ivideon.go @@ -1,7 +1,7 @@ package ivideon import ( - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/ivideon" "strings" diff --git a/cmd/mjpeg/mjpeg.go b/internal/mjpeg/mjpeg.go similarity index 97% rename from cmd/mjpeg/mjpeg.go rename to internal/mjpeg/mjpeg.go index 06d89023..30dd97d0 100644 --- a/cmd/mjpeg/mjpeg.go +++ b/internal/mjpeg/mjpeg.go @@ -2,8 +2,8 @@ package mjpeg import ( "errors" - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/mjpeg" "github.com/AlexxIT/go2rtc/pkg/tcp" "github.com/rs/zerolog/log" diff --git a/cmd/mp4/mp4.go b/internal/mp4/mp4.go similarity index 96% rename from cmd/mp4/mp4.go rename to internal/mp4/mp4.go index e6df4910..e6791ee7 100644 --- a/cmd/mp4/mp4.go +++ b/internal/mp4/mp4.go @@ -6,9 +6,9 @@ import ( "strings" "time" - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/app" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/app" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/mp4" "github.com/AlexxIT/go2rtc/pkg/tcp" "github.com/rs/zerolog" diff --git a/cmd/mp4/ws.go b/internal/mp4/ws.go similarity index 97% rename from cmd/mp4/ws.go rename to internal/mp4/ws.go index 8366916c..0cd7e4fe 100644 --- a/cmd/mp4/ws.go +++ b/internal/mp4/ws.go @@ -2,8 +2,8 @@ package mp4 import ( "errors" - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/mp4" "github.com/AlexxIT/go2rtc/pkg/tcp" diff --git a/cmd/mpegts/mpegts.go b/internal/mpegts/mpegts.go similarity index 90% rename from cmd/mpegts/mpegts.go rename to internal/mpegts/mpegts.go index 7f76da92..fad0f11e 100644 --- a/cmd/mpegts/mpegts.go +++ b/internal/mpegts/mpegts.go @@ -1,8 +1,8 @@ package mpegts import ( - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/mpegts" "net/http" ) diff --git a/cmd/ngrok/ngrok.go b/internal/ngrok/ngrok.go similarity index 94% rename from cmd/ngrok/ngrok.go rename to internal/ngrok/ngrok.go index 25266b08..67668829 100644 --- a/cmd/ngrok/ngrok.go +++ b/internal/ngrok/ngrok.go @@ -2,8 +2,8 @@ package ngrok import ( "fmt" - "github.com/AlexxIT/go2rtc/cmd/app" - "github.com/AlexxIT/go2rtc/cmd/webrtc" + "github.com/AlexxIT/go2rtc/internal/app" + "github.com/AlexxIT/go2rtc/internal/webrtc" "github.com/AlexxIT/go2rtc/pkg/ngrok" "github.com/rs/zerolog" "net" diff --git a/cmd/onvif/init.go b/internal/onvif/init.go similarity index 92% rename from cmd/onvif/init.go rename to internal/onvif/init.go index 928b77d4..a4f5ad22 100644 --- a/cmd/onvif/init.go +++ b/internal/onvif/init.go @@ -1,10 +1,10 @@ package onvif import ( - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/app" - "github.com/AlexxIT/go2rtc/cmd/rtsp" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/app" + "github.com/AlexxIT/go2rtc/internal/rtsp" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/onvif" "github.com/rs/zerolog" @@ -142,6 +142,11 @@ func apiOnvif(w http.ResponseWriter, r *http.Request) { return } + if l := log.Trace(); l.Enabled() { + b, _ := client.GetProfiles() + l.Msgf("[onvif] src=%s profiles:\n%s", src, b) + } + name, err := client.GetName() if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) diff --git a/cmd/roborock/roborock.go b/internal/roborock/roborock.go similarity index 96% rename from cmd/roborock/roborock.go rename to internal/roborock/roborock.go index 6e3457b7..e99586d9 100644 --- a/cmd/roborock/roborock.go +++ b/internal/roborock/roborock.go @@ -2,8 +2,8 @@ package roborock import ( "fmt" - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/roborock" "net/http" diff --git a/cmd/rtmp/rtmp.go b/internal/rtmp/rtmp.go similarity index 93% rename from cmd/rtmp/rtmp.go rename to internal/rtmp/rtmp.go index e3042981..f84c16be 100644 --- a/cmd/rtmp/rtmp.go +++ b/internal/rtmp/rtmp.go @@ -1,8 +1,8 @@ package rtmp import ( - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/rtmp" "github.com/rs/zerolog/log" diff --git a/cmd/rtsp/rtsp.go b/internal/rtsp/rtsp.go similarity index 98% rename from cmd/rtsp/rtsp.go rename to internal/rtsp/rtsp.go index 93306d88..a2c90e51 100644 --- a/cmd/rtsp/rtsp.go +++ b/internal/rtsp/rtsp.go @@ -6,8 +6,8 @@ import ( "net/url" "strings" - "github.com/AlexxIT/go2rtc/cmd/app" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/app" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/mp4" "github.com/AlexxIT/go2rtc/pkg/rtsp" diff --git a/cmd/srtp/srtp.go b/internal/srtp/srtp.go similarity index 94% rename from cmd/srtp/srtp.go rename to internal/srtp/srtp.go index a8e2c8b6..6cb2b546 100644 --- a/cmd/srtp/srtp.go +++ b/internal/srtp/srtp.go @@ -1,7 +1,7 @@ package srtp import ( - "github.com/AlexxIT/go2rtc/cmd/app" + "github.com/AlexxIT/go2rtc/internal/app" "github.com/AlexxIT/go2rtc/pkg/srtp" "net" ) diff --git a/cmd/streams/handlers.go b/internal/streams/handlers.go similarity index 100% rename from cmd/streams/handlers.go rename to internal/streams/handlers.go diff --git a/cmd/streams/init.go b/internal/streams/init.go similarity index 95% rename from cmd/streams/init.go rename to internal/streams/init.go index 84b2f207..697ce9d2 100644 --- a/cmd/streams/init.go +++ b/internal/streams/init.go @@ -2,9 +2,9 @@ package streams import ( "encoding/json" - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/app" - "github.com/AlexxIT/go2rtc/cmd/app/store" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/app" + "github.com/AlexxIT/go2rtc/internal/app/store" "github.com/rs/zerolog" "net/http" "net/url" diff --git a/cmd/streams/play.go b/internal/streams/play.go similarity index 100% rename from cmd/streams/play.go rename to internal/streams/play.go diff --git a/cmd/streams/producer.go b/internal/streams/producer.go similarity index 100% rename from cmd/streams/producer.go rename to internal/streams/producer.go diff --git a/cmd/streams/stream.go b/internal/streams/stream.go similarity index 100% rename from cmd/streams/stream.go rename to internal/streams/stream.go diff --git a/cmd/streams/stream_test.go b/internal/streams/stream_test.go similarity index 100% rename from cmd/streams/stream_test.go rename to internal/streams/stream_test.go diff --git a/cmd/tapo/tapo.go b/internal/tapo/tapo.go similarity index 87% rename from cmd/tapo/tapo.go rename to internal/tapo/tapo.go index 07c278a5..971928c7 100644 --- a/cmd/tapo/tapo.go +++ b/internal/tapo/tapo.go @@ -1,7 +1,7 @@ package tapo import ( - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/tapo" ) diff --git a/cmd/tcp/init.go b/internal/tcp/init.go similarity index 92% rename from cmd/tcp/init.go rename to internal/tcp/init.go index 353d28e6..7f712415 100644 --- a/cmd/tcp/init.go +++ b/internal/tcp/init.go @@ -1,7 +1,7 @@ package tcp import ( - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/mpegts" "net" diff --git a/cmd/webrtc/README.md b/internal/webrtc/README.md similarity index 100% rename from cmd/webrtc/README.md rename to internal/webrtc/README.md diff --git a/cmd/webrtc/candidates.go b/internal/webrtc/candidates.go similarity index 98% rename from cmd/webrtc/candidates.go rename to internal/webrtc/candidates.go index 7825a5c5..51f97040 100644 --- a/cmd/webrtc/candidates.go +++ b/internal/webrtc/candidates.go @@ -1,7 +1,7 @@ package webrtc import ( - "github.com/AlexxIT/go2rtc/cmd/api" + "github.com/AlexxIT/go2rtc/internal/api" "github.com/AlexxIT/go2rtc/pkg/webrtc" "github.com/pion/sdp/v3" "strconv" diff --git a/cmd/webrtc/client.go b/internal/webrtc/client.go similarity index 98% rename from cmd/webrtc/client.go rename to internal/webrtc/client.go index bad44da8..9db347e9 100644 --- a/cmd/webrtc/client.go +++ b/internal/webrtc/client.go @@ -2,7 +2,7 @@ package webrtc import ( "errors" - "github.com/AlexxIT/go2rtc/cmd/api" + "github.com/AlexxIT/go2rtc/internal/api" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/webrtc" "github.com/gorilla/websocket" diff --git a/cmd/webrtc/init.go b/internal/webrtc/init.go similarity index 97% rename from cmd/webrtc/init.go rename to internal/webrtc/init.go index d760d688..6855e1bd 100644 --- a/cmd/webrtc/init.go +++ b/internal/webrtc/init.go @@ -2,9 +2,9 @@ package webrtc import ( "errors" - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/app" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/app" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/webrtc" pion "github.com/pion/webrtc/v3" diff --git a/cmd/webrtc/server.go b/internal/webrtc/server.go similarity index 99% rename from cmd/webrtc/server.go rename to internal/webrtc/server.go index f66cab00..0bdd8341 100644 --- a/cmd/webrtc/server.go +++ b/internal/webrtc/server.go @@ -2,7 +2,7 @@ package webrtc import ( "encoding/json" - "github.com/AlexxIT/go2rtc/cmd/streams" + "github.com/AlexxIT/go2rtc/internal/streams" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/webrtc" pion "github.com/pion/webrtc/v3" diff --git a/cmd/webtorrent/init.go b/internal/webtorrent/init.go similarity index 95% rename from cmd/webtorrent/init.go rename to internal/webtorrent/init.go index e5de0da5..ede46e0e 100644 --- a/cmd/webtorrent/init.go +++ b/internal/webtorrent/init.go @@ -3,10 +3,10 @@ package webtorrent import ( "errors" "fmt" - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/app" - "github.com/AlexxIT/go2rtc/cmd/streams" - "github.com/AlexxIT/go2rtc/cmd/webrtc" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/app" + "github.com/AlexxIT/go2rtc/internal/streams" + "github.com/AlexxIT/go2rtc/internal/webrtc" "github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/webtorrent" "github.com/rs/zerolog" diff --git a/cmd/webtorrent/tracker.go b/internal/webtorrent/tracker.go similarity index 100% rename from cmd/webtorrent/tracker.go rename to internal/webtorrent/tracker.go diff --git a/main.go b/main.go index 6a50d407..c637fdc8 100644 --- a/main.go +++ b/main.go @@ -1,33 +1,33 @@ package main import ( - "github.com/AlexxIT/go2rtc/cmd/api" - "github.com/AlexxIT/go2rtc/cmd/app" - "github.com/AlexxIT/go2rtc/cmd/debug" - "github.com/AlexxIT/go2rtc/cmd/dvrip" - "github.com/AlexxIT/go2rtc/cmd/echo" - "github.com/AlexxIT/go2rtc/cmd/exec" - "github.com/AlexxIT/go2rtc/cmd/ffmpeg" - "github.com/AlexxIT/go2rtc/cmd/hass" - "github.com/AlexxIT/go2rtc/cmd/hls" - "github.com/AlexxIT/go2rtc/cmd/homekit" - "github.com/AlexxIT/go2rtc/cmd/http" - "github.com/AlexxIT/go2rtc/cmd/isapi" - "github.com/AlexxIT/go2rtc/cmd/ivideon" - "github.com/AlexxIT/go2rtc/cmd/mjpeg" - "github.com/AlexxIT/go2rtc/cmd/mp4" - "github.com/AlexxIT/go2rtc/cmd/mpegts" - "github.com/AlexxIT/go2rtc/cmd/ngrok" - "github.com/AlexxIT/go2rtc/cmd/onvif" - "github.com/AlexxIT/go2rtc/cmd/roborock" - "github.com/AlexxIT/go2rtc/cmd/rtmp" - "github.com/AlexxIT/go2rtc/cmd/rtsp" - "github.com/AlexxIT/go2rtc/cmd/srtp" - "github.com/AlexxIT/go2rtc/cmd/streams" - "github.com/AlexxIT/go2rtc/cmd/tapo" - "github.com/AlexxIT/go2rtc/cmd/tcp" - "github.com/AlexxIT/go2rtc/cmd/webrtc" - "github.com/AlexxIT/go2rtc/cmd/webtorrent" + "github.com/AlexxIT/go2rtc/internal/api" + "github.com/AlexxIT/go2rtc/internal/app" + "github.com/AlexxIT/go2rtc/internal/debug" + "github.com/AlexxIT/go2rtc/internal/dvrip" + "github.com/AlexxIT/go2rtc/internal/echo" + "github.com/AlexxIT/go2rtc/internal/exec" + "github.com/AlexxIT/go2rtc/internal/ffmpeg" + "github.com/AlexxIT/go2rtc/internal/hass" + "github.com/AlexxIT/go2rtc/internal/hls" + "github.com/AlexxIT/go2rtc/internal/homekit" + "github.com/AlexxIT/go2rtc/internal/http" + "github.com/AlexxIT/go2rtc/internal/isapi" + "github.com/AlexxIT/go2rtc/internal/ivideon" + "github.com/AlexxIT/go2rtc/internal/mjpeg" + "github.com/AlexxIT/go2rtc/internal/mp4" + "github.com/AlexxIT/go2rtc/internal/mpegts" + "github.com/AlexxIT/go2rtc/internal/ngrok" + "github.com/AlexxIT/go2rtc/internal/onvif" + "github.com/AlexxIT/go2rtc/internal/roborock" + "github.com/AlexxIT/go2rtc/internal/rtmp" + "github.com/AlexxIT/go2rtc/internal/rtsp" + "github.com/AlexxIT/go2rtc/internal/srtp" + "github.com/AlexxIT/go2rtc/internal/streams" + "github.com/AlexxIT/go2rtc/internal/tapo" + "github.com/AlexxIT/go2rtc/internal/tcp" + "github.com/AlexxIT/go2rtc/internal/webrtc" + "github.com/AlexxIT/go2rtc/internal/webtorrent" "os" "os/signal" "syscall"