perf: remove go-nanoid and rxgo

This commit is contained in:
2025-03-12 21:20:57 +03:30
parent b33dc0ba1d
commit 6f91ad607f
8 changed files with 17 additions and 839 deletions

View File

@@ -1,6 +1,8 @@
package jar
import (
"crypto/rand"
"encoding/hex"
"errors"
"io"
"net/http"
@@ -10,7 +12,6 @@ import (
"flink-kube-operator/pkg"
api "github.com/logi-camp/go-flink-client"
gonanoid "github.com/matoous/go-nanoid/v2"
"go.uber.org/zap"
)
@@ -46,7 +47,9 @@ func (jarFile *JarFile) Upload(flinkClient *api.Client) (fileName string, err er
}
func (jarFile *JarFile) Download() error {
fileName, _ := gonanoid.New()
randBytes := make([]byte, 16)
rand.Read(randBytes)
fileName := hex.EncodeToString(randBytes)
jarFile.filePath = "/tmp/" + fileName + ".jar"
out, err := os.Create(jarFile.filePath)
if err != nil {