Skip to content

Commit 18261a9

Browse files
committed
Fix some typo error
1 parent 1411099 commit 18261a9

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

pkg/gofr/datasource/file/gcs/file_parse.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,39 +137,44 @@ func (f *textReader) Scan(i any) error {
137137
}
138138

139139
func (g *GCSFile) Name() string {
140+
bucketName := getBucketName(g.name)
140141

141142
g.sendOperationStats(&FileLog{
142143
Operation: "GET NAME",
143-
Location: g.name,
144+
Location: getLocation(bucketName),
144145
}, time.Now())
145146

146147
return g.name
147148
}
148149

149150
func (g *GCSFile) Size() int64 {
151+
bucketName := getBucketName(g.name)
150152

151153
g.sendOperationStats(&FileLog{
152154
Operation: "FILE/DIR SIZE",
153-
Location: g.name,
155+
Location: getLocation(bucketName),
154156
}, time.Now())
155157

156158
return g.size
157159
}
158160

159161
func (g *GCSFile) ModTime() time.Time {
162+
bucketName := getBucketName(g.name)
160163

161164
g.sendOperationStats(&FileLog{
162165
Operation: "LAST MODIFIED",
163-
Location: g.name,
166+
Location: getLocation(bucketName),
164167
}, time.Now())
165168

166169
return g.lastModified
167170
}
168171

169172
func (g *GCSFile) Mode() fs.FileMode {
173+
bucketName := getBucketName(g.name)
174+
170175
g.sendOperationStats(&FileLog{
171176
Operation: "MODE",
172-
Location: g.name,
177+
Location: getLocation(bucketName),
173178
}, time.Now())
174179

175180
if g.isDir {
@@ -179,20 +184,23 @@ func (g *GCSFile) Mode() fs.FileMode {
179184
}
180185

181186
func (g *GCSFile) IsDir() bool {
187+
bucketName := getBucketName(g.name)
182188

183189
g.sendOperationStats(&FileLog{
184190
Operation: "IS DIR",
185-
Location: g.name,
191+
Location: getLocation(bucketName),
186192
}, time.Now())
187193

188194
return g.isDir || g.contentType == "application/x-directory"
189195
}
190196

191197
func (g *GCSFile) Sys() interface{} {
198+
bucketName := getBucketName(g.name)
192199

193200
g.sendOperationStats(&FileLog{
194201
Operation: "SYS",
195-
Location: g.name,
202+
Location: getLocation(bucketName),
196203
}, time.Now())
204+
197205
return nil
198206
}

pkg/gofr/datasource/file/gcs/fs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type FileSystem struct {
3434
metrics Metrics
3535
}
3636

37-
// Config represents the s3 configuration.
37+
// Config represents the gcs configuration.
3838
type Config struct {
3939
BucketName string
4040
CredentialsJSON string

pkg/gofr/datasource/file/gcs/logger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ func clean(query *string) string {
3030

3131
func (fl *FileLog) PrettyPrint(writer io.Writer) {
3232
fmt.Fprintf(writer, "\u001B[38;5;8m%-32s \u001B[38;5;148m%-6s\u001B[0m %8d\u001B[38;5;8mµs\u001B[0m %-10s \u001B[0m %-48s \n",
33-
clean(&fl.Operation), "AWS_S3", fl.Duration, clean(fl.Status), clean(fl.Message))
33+
clean(&fl.Operation), "GCS", fl.Duration, clean(fl.Status), clean(fl.Message))
3434
}

0 commit comments

Comments
 (0)