Optimize imports

This commit is contained in:
Alex X
2025-03-09 17:26:06 +03:00
parent 3954a555f8
commit c8f68f44af
13 changed files with 26 additions and 14 deletions

View File

@@ -1,8 +1,9 @@
package api package api
import ( import (
"github.com/AlexxIT/go2rtc/www"
"net/http" "net/http"
"github.com/AlexxIT/go2rtc/www"
) )
func initStatic(staticDir string) { func initStatic(staticDir string) {

View File

@@ -2,9 +2,10 @@ package webtorrent
import ( import (
"fmt" "fmt"
"net/http"
"github.com/AlexxIT/go2rtc/pkg/webtorrent" "github.com/AlexxIT/go2rtc/pkg/webtorrent"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"net/http"
) )
var upgrader *websocket.Upgrader var upgrader *websocket.Upgrader

View File

@@ -81,7 +81,7 @@ func main() {
mpegts.Init() // mpegts passive source mpegts.Init() // mpegts passive source
roborock.Init() // roborock source roborock.Init() // roborock source
homekit.Init() // homekit source homekit.Init() // homekit source
ring.Init() // ring source ring.Init() // ring source
nest.Init() // nest source nest.Init() // nest source
bubble.Init() // bubble source bubble.Init() // bubble source
expr.Init() // expr source expr.Init() // expr source

View File

@@ -3,6 +3,7 @@ package h265
import ( import (
"encoding/base64" "encoding/base64"
"encoding/binary" "encoding/binary"
"github.com/AlexxIT/go2rtc/pkg/core" "github.com/AlexxIT/go2rtc/pkg/core"
) )

View File

@@ -2,8 +2,9 @@ package h265
import ( import (
"encoding/binary" "encoding/binary"
"github.com/AlexxIT/go2rtc/pkg/h264"
"math" "math"
"github.com/AlexxIT/go2rtc/pkg/h264"
) )
// //

View File

@@ -2,8 +2,9 @@ package hass
import ( import (
"errors" "errors"
"github.com/gorilla/websocket"
"os" "os"
"github.com/gorilla/websocket"
) )
type API struct { type API struct {

View File

@@ -1,8 +1,9 @@
package mdns package mdns
import ( import (
"github.com/stretchr/testify/require"
"testing" "testing"
"github.com/stretchr/testify/require"
) )
func TestDiscovery(t *testing.T) { func TestDiscovery(t *testing.T) {

View File

@@ -3,10 +3,11 @@ package mjpeg
import ( import (
"bytes" "bytes"
"encoding/binary" "encoding/binary"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/pion/rtp"
"image" "image"
"image/jpeg" "image/jpeg"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/pion/rtp"
) )
func RTPDepay(handlerFunc core.HandlerFunc) core.HandlerFunc { func RTPDepay(handlerFunc core.HandlerFunc) core.HandlerFunc {

View File

@@ -3,10 +3,11 @@ package ngrok
import ( import (
"bufio" "bufio"
"encoding/json" "encoding/json"
"github.com/AlexxIT/go2rtc/pkg/core"
"io" "io"
"os/exec" "os/exec"
"strings" "strings"
"github.com/AlexxIT/go2rtc/pkg/core"
) )
type Ngrok struct { type Ngrok struct {

View File

@@ -1,9 +1,10 @@
package v1 package v1
import ( import (
"testing"
v2 "github.com/AlexxIT/go2rtc/pkg/pcm" v2 "github.com/AlexxIT/go2rtc/pkg/pcm"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"testing"
) )
func TestPCMUtoPCM(t *testing.T) { func TestPCMUtoPCM(t *testing.T) {

View File

@@ -7,11 +7,12 @@ import (
"encoding/base64" "encoding/base64"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/AlexxIT/go2rtc/pkg/core"
"net/http" "net/http"
"net/url" "net/url"
"strconv" "strconv"
"time" "time"
"github.com/AlexxIT/go2rtc/pkg/core"
) )
type UserInfo struct { type UserInfo struct {

View File

@@ -5,10 +5,11 @@ import (
"crypto/sha1" "crypto/sha1"
"encoding/base64" "encoding/base64"
"errors" "errors"
"github.com/AlexxIT/go2rtc/pkg/tcp"
"net" "net"
"net/http" "net/http"
"strings" "strings"
"github.com/AlexxIT/go2rtc/pkg/tcp"
) )
func Dial(address string) (net.Conn, error) { func Dial(address string) (net.Conn, error) {

View File

@@ -3,10 +3,11 @@ package webtorrent
import ( import (
"encoding/base64" "encoding/base64"
"fmt" "fmt"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/gorilla/websocket"
"sync" "sync"
"time" "time"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/gorilla/websocket"
) )
type Server struct { type Server struct {