diff --git a/Makefile b/Makefile index d4452e6..ba3817f 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ test: ## fuzz: Run fuzz tests fuzz: - go test -fuzz=Fuzz -run=^Fuzz ./internal/packet -fuzztime 30s + go test -fuzz=Fuzz -run=^Fuzz ./packet -fuzztime 30s ## vet: Analyze code for potential errors vet: diff --git a/internal/circular/circular.go b/circular/circular.go similarity index 100% rename from internal/circular/circular.go rename to circular/circular.go diff --git a/internal/circular/circular_test.go b/circular/circular_test.go similarity index 100% rename from internal/circular/circular_test.go rename to circular/circular_test.go diff --git a/internal/congestion/congestion.go b/congestion/congestion.go similarity index 96% rename from internal/congestion/congestion.go rename to congestion/congestion.go index c36f339..10787ea 100644 --- a/internal/congestion/congestion.go +++ b/congestion/congestion.go @@ -2,8 +2,8 @@ package congestion import ( - "github.com/datarhei/gosrt/internal/circular" - "github.com/datarhei/gosrt/internal/packet" + "github.com/datarhei/gosrt/circular" + "github.com/datarhei/gosrt/packet" ) // Sender is the sending part of the congestion control diff --git a/internal/congestion/live/doc.go b/congestion/live/doc.go similarity index 100% rename from internal/congestion/live/doc.go rename to congestion/live/doc.go diff --git a/internal/congestion/live/fake.go b/congestion/live/fake.go similarity index 96% rename from internal/congestion/live/fake.go rename to congestion/live/fake.go index da62bbe..c1bc1f7 100644 --- a/internal/congestion/live/fake.go +++ b/congestion/live/fake.go @@ -4,9 +4,9 @@ import ( "sync" "time" - "github.com/datarhei/gosrt/internal/circular" - "github.com/datarhei/gosrt/internal/congestion" - "github.com/datarhei/gosrt/internal/packet" + "github.com/datarhei/gosrt/circular" + "github.com/datarhei/gosrt/congestion" + "github.com/datarhei/gosrt/packet" ) type fakeLiveReceive struct { diff --git a/internal/congestion/live/receive.go b/congestion/live/receive.go similarity index 98% rename from internal/congestion/live/receive.go rename to congestion/live/receive.go index d39ccba..4999b75 100644 --- a/internal/congestion/live/receive.go +++ b/congestion/live/receive.go @@ -7,9 +7,9 @@ import ( "sync" "time" - "github.com/datarhei/gosrt/internal/circular" - "github.com/datarhei/gosrt/internal/congestion" - "github.com/datarhei/gosrt/internal/packet" + "github.com/datarhei/gosrt/circular" + "github.com/datarhei/gosrt/congestion" + "github.com/datarhei/gosrt/packet" ) // ReceiveConfig is the configuration for the liveRecv congestion control diff --git a/internal/congestion/live/receive_test.go b/congestion/live/receive_test.go similarity index 99% rename from internal/congestion/live/receive_test.go rename to congestion/live/receive_test.go index 77b53d1..aef31cb 100644 --- a/internal/congestion/live/receive_test.go +++ b/congestion/live/receive_test.go @@ -4,8 +4,8 @@ import ( "net" "testing" - "github.com/datarhei/gosrt/internal/circular" - "github.com/datarhei/gosrt/internal/packet" + "github.com/datarhei/gosrt/circular" + "github.com/datarhei/gosrt/packet" "github.com/stretchr/testify/require" ) diff --git a/internal/congestion/live/send.go b/congestion/live/send.go similarity index 98% rename from internal/congestion/live/send.go rename to congestion/live/send.go index 15ff4ec..b296e94 100644 --- a/internal/congestion/live/send.go +++ b/congestion/live/send.go @@ -5,9 +5,9 @@ import ( "sync" "time" - "github.com/datarhei/gosrt/internal/circular" - "github.com/datarhei/gosrt/internal/congestion" - "github.com/datarhei/gosrt/internal/packet" + "github.com/datarhei/gosrt/circular" + "github.com/datarhei/gosrt/congestion" + "github.com/datarhei/gosrt/packet" ) // SendConfig is the configuration for the liveSend congestion control diff --git a/internal/congestion/live/send_test.go b/congestion/live/send_test.go similarity index 97% rename from internal/congestion/live/send_test.go rename to congestion/live/send_test.go index 942a530..a85a3b3 100644 --- a/internal/congestion/live/send_test.go +++ b/congestion/live/send_test.go @@ -4,8 +4,8 @@ import ( "net" "testing" - "github.com/datarhei/gosrt/internal/circular" - "github.com/datarhei/gosrt/internal/packet" + "github.com/datarhei/gosrt/circular" + "github.com/datarhei/gosrt/packet" "github.com/stretchr/testify/require" ) diff --git a/connection.go b/connection.go index 857009a..46890e3 100644 --- a/connection.go +++ b/connection.go @@ -11,11 +11,11 @@ import ( "sync" "time" - "github.com/datarhei/gosrt/internal/circular" - "github.com/datarhei/gosrt/internal/congestion" - "github.com/datarhei/gosrt/internal/congestion/live" - "github.com/datarhei/gosrt/internal/crypto" - "github.com/datarhei/gosrt/internal/packet" + "github.com/datarhei/gosrt/circular" + "github.com/datarhei/gosrt/congestion" + "github.com/datarhei/gosrt/congestion/live" + "github.com/datarhei/gosrt/crypto" + "github.com/datarhei/gosrt/packet" ) // Conn is a SRT network connection. diff --git a/internal/crypto/crypto.go b/crypto/crypto.go similarity index 98% rename from internal/crypto/crypto.go rename to crypto/crypto.go index 6732979..245c5f1 100644 --- a/internal/crypto/crypto.go +++ b/crypto/crypto.go @@ -9,8 +9,8 @@ import ( "errors" "fmt" - "github.com/datarhei/gosrt/internal/packet" - "github.com/datarhei/gosrt/internal/rand" + "github.com/datarhei/gosrt/packet" + "github.com/datarhei/gosrt/rand" "github.com/benburkert/openpgp/aes/keywrap" "golang.org/x/crypto/pbkdf2" diff --git a/internal/crypto/crypto_test.go b/crypto/crypto_test.go similarity index 99% rename from internal/crypto/crypto_test.go rename to crypto/crypto_test.go index 89b96e7..4f1b673 100644 --- a/internal/crypto/crypto_test.go +++ b/crypto/crypto_test.go @@ -5,7 +5,7 @@ import ( "encoding/hex" "testing" - "github.com/datarhei/gosrt/internal/packet" + "github.com/datarhei/gosrt/packet" "github.com/stretchr/testify/require" ) diff --git a/dial.go b/dial.go index 8feea5f..8627648 100644 --- a/dial.go +++ b/dial.go @@ -11,10 +11,10 @@ import ( "sync" "time" - "github.com/datarhei/gosrt/internal/circular" - "github.com/datarhei/gosrt/internal/crypto" - "github.com/datarhei/gosrt/internal/packet" - "github.com/datarhei/gosrt/internal/rand" + "github.com/datarhei/gosrt/circular" + "github.com/datarhei/gosrt/crypto" + "github.com/datarhei/gosrt/packet" + "github.com/datarhei/gosrt/rand" ) // ErrClientClosed is returned when the client connection has diff --git a/dial_test.go b/dial_test.go index 45c85cf..2b5be42 100644 --- a/dial_test.go +++ b/dial_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/datarhei/gosrt/internal/circular" - "github.com/datarhei/gosrt/internal/packet" + "github.com/datarhei/gosrt/circular" + "github.com/datarhei/gosrt/packet" "github.com/stretchr/testify/require" ) diff --git a/listen.go b/listen.go index bbe426c..1385f4e 100644 --- a/listen.go +++ b/listen.go @@ -10,9 +10,9 @@ import ( "sync" "time" - "github.com/datarhei/gosrt/internal/crypto" - srtnet "github.com/datarhei/gosrt/internal/net" - "github.com/datarhei/gosrt/internal/packet" + "github.com/datarhei/gosrt/crypto" + srtnet "github.com/datarhei/gosrt/net" + "github.com/datarhei/gosrt/packet" ) // ConnType represents the kind of connection as returned diff --git a/listen_test.go b/listen_test.go index 1569c1c..024addf 100644 --- a/listen_test.go +++ b/listen_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/datarhei/gosrt/internal/packet" + "github.com/datarhei/gosrt/packet" "github.com/stretchr/testify/require" ) diff --git a/internal/net/ip.go b/net/ip.go similarity index 100% rename from internal/net/ip.go rename to net/ip.go diff --git a/internal/net/ip_test.go b/net/ip_test.go similarity index 100% rename from internal/net/ip_test.go rename to net/ip_test.go diff --git a/internal/net/syncookie.go b/net/syncookie.go similarity index 97% rename from internal/net/syncookie.go rename to net/syncookie.go index 5d97e13..cc74685 100644 --- a/internal/net/syncookie.go +++ b/net/syncookie.go @@ -6,7 +6,7 @@ import ( "strconv" "time" - "github.com/datarhei/gosrt/internal/rand" + "github.com/datarhei/gosrt/rand" ) // SYNCookie implements a syn cookie for the SRT handshake. diff --git a/internal/net/syncookie_test.go b/net/syncookie_test.go similarity index 100% rename from internal/net/syncookie_test.go rename to net/syncookie_test.go diff --git a/internal/packet/packet.go b/packet/packet.go similarity index 99% rename from internal/packet/packet.go rename to packet/packet.go index a31160d..3b2b48f 100644 --- a/internal/packet/packet.go +++ b/packet/packet.go @@ -13,8 +13,8 @@ import ( "strings" "sync" - "github.com/datarhei/gosrt/internal/circular" - srtnet "github.com/datarhei/gosrt/internal/net" + "github.com/datarhei/gosrt/circular" + srtnet "github.com/datarhei/gosrt/net" ) const MAX_SEQUENCENUMBER uint32 = 0b01111111_11111111_11111111_11111111 diff --git a/internal/packet/packet_test.go b/packet/packet_test.go similarity index 99% rename from internal/packet/packet_test.go rename to packet/packet_test.go index 7bf5d6b..0db64ed 100644 --- a/internal/packet/packet_test.go +++ b/packet/packet_test.go @@ -7,8 +7,8 @@ import ( "sync" "testing" - "github.com/datarhei/gosrt/internal/circular" - srtnet "github.com/datarhei/gosrt/internal/net" + "github.com/datarhei/gosrt/circular" + srtnet "github.com/datarhei/gosrt/net" "github.com/stretchr/testify/require" ) diff --git a/pubsub.go b/pubsub.go index 2e37a6f..8590158 100644 --- a/pubsub.go +++ b/pubsub.go @@ -6,7 +6,7 @@ import ( "io" "sync" - "github.com/datarhei/gosrt/internal/packet" + "github.com/datarhei/gosrt/packet" ) // PubSub is a publish/subscriber service for SRT connections. diff --git a/internal/rand/rand.go b/rand/rand.go similarity index 100% rename from internal/rand/rand.go rename to rand/rand.go diff --git a/internal/rand/rand_test.go b/rand/rand_test.go similarity index 100% rename from internal/rand/rand_test.go rename to rand/rand_test.go