Code Review
/
nonrtric
/
plt
/
ranpm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Make it easier to build doc & subsites
[nonrtric/plt/ranpm.git]
/
pm-file-converter
/
components
/
miniocollector
/
miniocollector.go
diff --git
a/pm-file-converter/components/miniocollector/miniocollector.go
b/pm-file-converter/components/miniocollector/miniocollector.go
index
ac8ce05
..
24ff41f
100644
(file)
--- a/
pm-file-converter/components/miniocollector/miniocollector.go
+++ b/
pm-file-converter/components/miniocollector/miniocollector.go
@@
-39,7
+39,7
@@
import (
)
// nolint
)
// nolint
-func Xml
_to_json_conv(evt_d
ata *dataTypes.XmlFileEventHeader) string {
+func Xml
ToJsonConv(evtD
ata *dataTypes.XmlFileEventHeader) string {
filestoreUser := os.Getenv("FILESTORE_USER")
filestorePwd := os.Getenv("FILESTORE_PWD")
filestoreServer := os.Getenv("FILESTORE_SERVER")
filestoreUser := os.Getenv("FILESTORE_USER")
filestorePwd := os.Getenv("FILESTORE_PWD")
filestoreServer := os.Getenv("FILESTORE_SERVER")
@@
-52,12
+52,12
@@
func Xml_to_json_conv(evt_data *dataTypes.XmlFileEventHeader) string {
log.Fatalln(err)
}
expiry := time.Second * 24 * 60 * 60 // 1 day.
log.Fatalln(err)
}
expiry := time.Second * 24 * 60 * 60 // 1 day.
- objectName := evt
_d
ata.Name
- bucketName := evt
_d
ata.ObjectStoreBucket
- compresion := evt
_d
ata.Compression
+ objectName := evt
D
ata.Name
+ bucketName := evt
D
ata.ObjectStoreBucket
+ compresion := evt
D
ata.Compression
reqParams := make(url.Values)
reqParams := make(url.Values)
- xmlh, err := jsoniter.Marshal(evt
_d
ata)
+ xmlh, err := jsoniter.Marshal(evt
D
ata)
if err != nil {
fmt.Printf("Error: %s", err)
return ""
if err != nil {
fmt.Printf("Error: %s", err)
return ""
@@
-68,18
+68,18
@@
func Xml_to_json_conv(evt_data *dataTypes.XmlFileEventHeader) string {
if err != nil {
log.Fatalln(err)
}
if err != nil {
log.Fatalln(err)
}
- file
_b
ytes := xmltransform.Convert(presignedURL.String(), compresion, string(xmlh))
+ file
B
ytes := xmltransform.Convert(presignedURL.String(), compresion, string(xmlh))
newObjectName := objectName + "kafka-producer-pm-xml2json-0.json.gz"
var buf bytes.Buffer
newObjectName := objectName + "kafka-producer-pm-xml2json-0.json.gz"
var buf bytes.Buffer
- err = gzipWrite(&buf, &file
_b
ytes)
- upload
_o
bject(s3Client, buf.Bytes(), newObjectName, "pm-files-json")
+ err = gzipWrite(&buf, &file
B
ytes)
+ upload
O
bject(s3Client, buf.Bytes(), newObjectName, "pm-files-json")
fmt.Println("")
return newObjectName
}
// nolint
fmt.Println("")
return newObjectName
}
// nolint
-func upload
_o
bject(mc *minio.Client, b []byte, objectName string, fsbucket string) {
+func upload
O
bject(mc *minio.Client, b []byte, objectName string, fsbucket string) {
contentType := "application/json"
if strings.HasSuffix(objectName, ".gz") {
contentType = "application/gzip"
contentType := "application/json"
if strings.HasSuffix(objectName, ".gz") {
contentType = "application/gzip"
@@
-88,8
+88,8
@@
func upload_object(mc *minio.Client, b []byte, objectName string, fsbucket strin
// Upload the xml file with PutObject
r := bytes.NewReader(b)
tctx := context.Background()
// Upload the xml file with PutObject
r := bytes.NewReader(b)
tctx := context.Background()
- if check
_minio_b
ucket(mc, fsbucket) == false {
- err := create
_minio_b
ucket(mc, fsbucket)
+ if check
MinioB
ucket(mc, fsbucket) == false {
+ err := create
MinioB
ucket(mc, fsbucket)
if err != nil {
log.Error("Cannot create bucket: ", fsbucket, ", ", err)
return
if err != nil {
log.Error("Cannot create bucket: ", fsbucket, ", ", err)
return
@@
-113,7
+113,7
@@
func upload_object(mc *minio.Client, b []byte, objectName string, fsbucket strin
}
// nolint
}
// nolint
-func create
_minio_b
ucket(mc *minio.Client, bucket string) error {
+func create
MinioB
ucket(mc *minio.Client, bucket string) error {
tctx := context.Background()
err := mc.MakeBucket(tctx, bucket, minio.MakeBucketOptions{})
if err != nil {
tctx := context.Background()
err := mc.MakeBucket(tctx, bucket, minio.MakeBucketOptions{})
if err != nil {
@@
-132,7
+132,7
@@
func create_minio_bucket(mc *minio.Client, bucket string) error {
}
// nolint
}
// nolint
-func check
_minio_b
ucket(mc *minio.Client, bucket string) bool {
+func check
MinioB
ucket(mc *minio.Client, bucket string) bool {
tctx := context.Background()
exists, err := mc.BucketExists(tctx, bucket)
if err == nil && exists {
tctx := context.Background()
exists, err := mc.BucketExists(tctx, bucket)
if err == nil && exists {