Archived
v1.4.1
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Copyright 2024 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
// Copyright 2024 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cloud .
|
||||
|
||||
package compressions
|
||||
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
package compressions
|
||||
|
||||
import (
|
||||
"github.com/andybalholm/brotli"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"github.com/andybalholm/brotli"
|
||||
)
|
||||
|
||||
type BrotliReader struct {
|
||||
|
||||
@@ -4,10 +4,11 @@ package compressions_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
"io"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
)
|
||||
|
||||
func TestBrotliReader(t *testing.T) {
|
||||
|
||||
@@ -4,9 +4,10 @@ package compressions_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
"io"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
)
|
||||
|
||||
func TestDeflateReader(t *testing.T) {
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
package compressions
|
||||
|
||||
import (
|
||||
"github.com/klauspost/compress/gzip"
|
||||
"io"
|
||||
|
||||
"github.com/klauspost/compress/gzip"
|
||||
)
|
||||
|
||||
type GzipReader struct {
|
||||
|
||||
@@ -4,12 +4,13 @@ package compressions_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
"github.com/iwind/TeaGo/rands"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
"github.com/iwind/TeaGo/rands"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
)
|
||||
|
||||
func TestGzipReader(t *testing.T) {
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
package compressions
|
||||
|
||||
import (
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
"io"
|
||||
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
)
|
||||
|
||||
var sharedBrotliReaderPool *ReaderPool
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
package compressions
|
||||
|
||||
import (
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
"io"
|
||||
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
)
|
||||
|
||||
var sharedDeflateReaderPool *ReaderPool
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
package compressions
|
||||
|
||||
import (
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
"io"
|
||||
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
)
|
||||
|
||||
var sharedGzipReaderPool *ReaderPool
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
package compressions
|
||||
|
||||
import (
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
"io"
|
||||
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
)
|
||||
|
||||
var sharedZSTDReaderPool *ReaderPool
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
package compressions
|
||||
|
||||
import (
|
||||
"github.com/klauspost/compress/zstd"
|
||||
"io"
|
||||
|
||||
"github.com/klauspost/compress/zstd"
|
||||
)
|
||||
|
||||
type ZSTDReader struct {
|
||||
|
||||
@@ -4,12 +4,13 @@ package compressions_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
"github.com/iwind/TeaGo/rands"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
"github.com/iwind/TeaGo/rands"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
)
|
||||
|
||||
func TestZSTDReader(t *testing.T) {
|
||||
|
||||
@@ -4,11 +4,12 @@ package compressions
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem"
|
||||
"io"
|
||||
"net/http"
|
||||
"runtime"
|
||||
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem"
|
||||
)
|
||||
|
||||
type ContentEncoding = string
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
// Copyright 2024 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
// Copyright 2024 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cloud .
|
||||
|
||||
package compressions_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
"github.com/iwind/TeaGo/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGenerateCompressLevel(t *testing.T) {
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
package compressions
|
||||
|
||||
import (
|
||||
"github.com/andybalholm/brotli"
|
||||
"io"
|
||||
|
||||
"github.com/andybalholm/brotli"
|
||||
)
|
||||
|
||||
type BrotliWriter struct {
|
||||
|
||||
@@ -4,11 +4,12 @@ package compressions_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
stringutil "github.com/iwind/TeaGo/utils/string"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
stringutil "github.com/iwind/TeaGo/utils/string"
|
||||
)
|
||||
|
||||
func TestBrotliWriter_LargeFile(t *testing.T) {
|
||||
|
||||
@@ -4,9 +4,10 @@ package compressions_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
)
|
||||
|
||||
func BenchmarkDeflateWriter_Write(b *testing.B) {
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
package compressions
|
||||
|
||||
import (
|
||||
"github.com/klauspost/compress/gzip"
|
||||
"io"
|
||||
|
||||
"github.com/klauspost/compress/gzip"
|
||||
)
|
||||
|
||||
type GzipWriter struct {
|
||||
|
||||
@@ -4,8 +4,9 @@ package compressions_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
)
|
||||
|
||||
func BenchmarkGzipWriter_Write(b *testing.B) {
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
package compressions
|
||||
|
||||
import (
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils/goman"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils/goman"
|
||||
)
|
||||
|
||||
const maxWriterHits = 1 << 20
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
package compressions
|
||||
|
||||
import (
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
"io"
|
||||
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
)
|
||||
|
||||
var sharedBrotliWriterPool *WriterPool
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
package compressions
|
||||
|
||||
import (
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
"io"
|
||||
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
)
|
||||
|
||||
var sharedDeflateWriterPool *WriterPool
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
package compressions
|
||||
|
||||
import (
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
"io"
|
||||
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
)
|
||||
|
||||
var sharedGzipWriterPool *WriterPool
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
package compressions
|
||||
|
||||
import (
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
"io"
|
||||
|
||||
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
||||
)
|
||||
|
||||
var sharedZSTDWriterPool *WriterPool
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
package compressions
|
||||
|
||||
import (
|
||||
"github.com/klauspost/compress/zstd"
|
||||
"io"
|
||||
|
||||
"github.com/klauspost/compress/zstd"
|
||||
)
|
||||
|
||||
type ZSTDWriter struct {
|
||||
|
||||
@@ -4,9 +4,10 @@ package compressions_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/TeaOSLab/EdgeNode/internal/compressions"
|
||||
)
|
||||
|
||||
func TestNewZSTDWriter_Level0(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user