perf: remove go-nanoid and rxgo
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user