From f9b6f1e14f6b2094fa41f181fc3186f795397841 Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Thu, 19 Sep 2024 02:28:48 +0530 Subject: [PATCH 01/17] adding basic file interaction commands for ftp and sftp --- examples/using-add-filestore/main.go | 104 ++++++++++++++++++++++ examples/using-add-filestore/main_test.go | 11 +++ 2 files changed, 115 insertions(+) create mode 100644 examples/using-add-filestore/main.go create mode 100644 examples/using-add-filestore/main_test.go diff --git a/examples/using-add-filestore/main.go b/examples/using-add-filestore/main.go new file mode 100644 index 000000000..10b575032 --- /dev/null +++ b/examples/using-add-filestore/main.go @@ -0,0 +1,104 @@ +package main + +import ( + "fmt" + "strings" + + "gofr.dev/pkg/gofr" + "gofr.dev/pkg/gofr/datasource/file" + "gofr.dev/pkg/gofr/datasource/file/ftp" +) + +type FileServerType int + +const ( + FTP FileServerType = iota + SFTP +) + +// this can be a common function to configure both ftp and SFTP server +func configureFTPServer(fileServerType FileServerType) file.FileSystemProvider { + var fileSystemProvider file.FileSystemProvider + if fileServerType == FTP { + fileSystemProvider = ftp.New(&ftp.Config{ + Host: "localhost", + User: "anonymous", + Password: "", + Port: 21, + RemoteDir: "/", + }) + } else { + // fileSystemProvider = sftp.New(&ftp.Config{ + // Host: "localhost", + // User: "anonymous", + // Password: "", + // Port: 21, + // RemoteDir: "/", + // }) + } + return fileSystemProvider +} + +func printFiles(files []file.FileInfo, err error) { + if err != nil { + fmt.Println(err) + } else { + for _, f := range files { + fmt.Println(f.Name()) + } + } +} + +func filterFiles(files []file.FileInfo, keyword string, err error) { + if err != nil { + fmt.Println(err) + } else { + for _, f := range files { + if strings.HasPrefix(f.Name(), keyword) { + fmt.Println(f.Name()) + } + } + } +} + +func main() { + app := gofr.NewCMD() + + fileSystemProvider := configureFTPServer(FTP) + + app.AddFileStore(fileSystemProvider) + + app.SubCommand("pwd", func(c *gofr.Context) (interface{}, error) { + workingDirectory, error := fileSystemProvider.Getwd() + return workingDirectory, error + }) + + app.SubCommand("ls", func(c *gofr.Context) (interface{}, error) { + files, error := fileSystemProvider.ReadDir("/") + printFiles(files, error) + return "", nil + }) + + app.SubCommand("grep", func(c *gofr.Context) (interface{}, error) { + keyword := c.Param("keyword") + files, error := fileSystemProvider.ReadDir("/") + filterFiles(files, keyword, error) + return "", nil + }) + + app.SubCommand("createfile", func(c *gofr.Context) (interface{}, error) { + fileName := c.Param("filename") + fmt.Printf("Creating file :%s", fileName) + _, error := fileSystemProvider.Create(fileName) + return "", error + }) + + app.SubCommand("rm", func(c *gofr.Context) (interface{}, error) { + fileName := c.Param("filename") + fmt.Printf("Removing file :%s", fileName) + error := fileSystemProvider.Remove(fileName) + return "", error + }) + + app.Run() +} diff --git a/examples/using-add-filestore/main_test.go b/examples/using-add-filestore/main_test.go new file mode 100644 index 000000000..f5d1d602b --- /dev/null +++ b/examples/using-add-filestore/main_test.go @@ -0,0 +1,11 @@ +package main + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestIntegration(t *testing.T) { + assert.Equal(t, true, true) +} From fa1a01e609dc3c24568f253ca70c1435d297b26a Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Sat, 28 Sep 2024 03:31:34 +0530 Subject: [PATCH 02/17] adding readme for the example --- examples/using-add-filestore/README.md | 43 +++++++ examples/using-add-filestore/configs/.env | 5 + examples/using-add-filestore/main.go | 91 ++++++++------ examples/using-add-filestore/main_test.go | 141 +++++++++++++++++++++- 4 files changed, 242 insertions(+), 38 deletions(-) create mode 100644 examples/using-add-filestore/README.md create mode 100644 examples/using-add-filestore/configs/.env diff --git a/examples/using-add-filestore/README.md b/examples/using-add-filestore/README.md new file mode 100644 index 000000000..38d442aec --- /dev/null +++ b/examples/using-add-filestore/README.md @@ -0,0 +1,43 @@ +# Add FileStore Example + +This GoFr example demonstrates a CMD application that can be used to interact with a remote file server using FTP or SFTP protocol + +### Setting up an FTP server in local machine +- https://security.appspot.com/vsftpd.html +- https://pypi.org/project/pyftpdlib/ + +Choose a library listed above and follow their respective documentation to configure an FTP server in your local machine and replace the configs/env file with correct HOST,USER_NAME,PASSWORD,PORT and REMOTE_DIR_PATH details. + +### To run the example use the commands below: +To print the current working directory of the configured remote file server +``` +go run main.go pwd +``` +To get the list of all directories or files in the given path of the configured remote file server + +``` +go run main.go ls -path= + +Eg:- go run main.go ls -path=/ +``` +To grep the list of all files and directories in the given path that is matching with the keyword provided + +``` +go run main.go grep -keyword=fi -path= + +Eg:- go run main.go grep -keyword=fi -path=/ +``` + +To create a file in the current working directory with the provided filename +``` +go run main.go createfile -filename= + +Eg:- go run main.go createfile -filename=file.txt +``` + +To remove the file with the provided filename from the current working directory +``` +go run main.go rm -filename= + +Eg:- go run main.go rm -filename=file.txt +``` \ No newline at end of file diff --git a/examples/using-add-filestore/configs/.env b/examples/using-add-filestore/configs/.env new file mode 100644 index 000000000..01833ea49 --- /dev/null +++ b/examples/using-add-filestore/configs/.env @@ -0,0 +1,5 @@ +HOST="localhost" +USER_NAME="anonymous" +PASSWORD="test" +PORT=21 +REMOTE_DIR_PATH="/" \ No newline at end of file diff --git a/examples/using-add-filestore/main.go b/examples/using-add-filestore/main.go index 10b575032..49cac3aa4 100644 --- a/examples/using-add-filestore/main.go +++ b/examples/using-add-filestore/main.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "strconv" "strings" "gofr.dev/pkg/gofr" @@ -16,26 +17,16 @@ const ( SFTP ) -// this can be a common function to configure both ftp and SFTP server -func configureFTPServer(fileServerType FileServerType) file.FileSystemProvider { - var fileSystemProvider file.FileSystemProvider - if fileServerType == FTP { - fileSystemProvider = ftp.New(&ftp.Config{ - Host: "localhost", - User: "anonymous", - Password: "", - Port: 21, - RemoteDir: "/", - }) - } else { - // fileSystemProvider = sftp.New(&ftp.Config{ - // Host: "localhost", - // User: "anonymous", - // Password: "", - // Port: 21, - // RemoteDir: "/", - // }) - } +// This can be a common function to configure both FTP and SFTP server +func configureFileServer(app *gofr.App) file.FileSystemProvider { + port, _ := strconv.Atoi(app.Config.Get("PORT")) + fileSystemProvider := ftp.New(&ftp.Config{ + Host: app.Config.Get("HOST"), + User: app.Config.Get("USER_NAME"), + Password: app.Config.Get("PASSWORD"), + Port: port, + RemoteDir: app.Config.Get("REMOTE_DIR_PATH"), + }) return fileSystemProvider } @@ -49,7 +40,7 @@ func printFiles(files []file.FileInfo, err error) { } } -func filterFiles(files []file.FileInfo, keyword string, err error) { +func grepFiles(files []file.FileInfo, keyword string, err error) { if err != nil { fmt.Println(err) } else { @@ -61,44 +52,72 @@ func filterFiles(files []file.FileInfo, keyword string, err error) { } } -func main() { - app := gofr.NewCMD() - - fileSystemProvider := configureFTPServer(FTP) - - app.AddFileStore(fileSystemProvider) - +func registerPwdCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("pwd", func(c *gofr.Context) (interface{}, error) { - workingDirectory, error := fileSystemProvider.Getwd() + workingDirectory, error := fs.Getwd() return workingDirectory, error }) +} +func registerLsCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("ls", func(c *gofr.Context) (interface{}, error) { - files, error := fileSystemProvider.ReadDir("/") + path := c.Param("path") + files, error := fs.ReadDir(path) printFiles(files, error) - return "", nil + return "", error }) +} +func registerGrepCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("grep", func(c *gofr.Context) (interface{}, error) { keyword := c.Param("keyword") - files, error := fileSystemProvider.ReadDir("/") - filterFiles(files, keyword, error) - return "", nil + path := c.Param("path") + files, error := fs.ReadDir(path) + grepFiles(files, keyword, error) + return "", error }) +} +func registerCreateFileCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("createfile", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") fmt.Printf("Creating file :%s", fileName) - _, error := fileSystemProvider.Create(fileName) + _, error := fs.Create(fileName) + if error == nil { + fmt.Printf("Succesfully created file:%s", fileName) + } return "", error }) +} +func registerRmCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("rm", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") fmt.Printf("Removing file :%s", fileName) - error := fileSystemProvider.Remove(fileName) + error := fs.Remove(fileName) + if error == nil { + fmt.Printf("Succesfully removed file:%s", fileName) + } return "", error }) +} + +func main() { + app := gofr.NewCMD() + + fileSystemProvider := configureFileServer(app) + + app.AddFileStore(fileSystemProvider) + + registerPwdCommand(app, fileSystemProvider) + + registerLsCommand(app, fileSystemProvider) + + registerGrepCommand(app, fileSystemProvider) + + registerCreateFileCommand(app, fileSystemProvider) + + registerRmCommand(app, fileSystemProvider) app.Run() } diff --git a/examples/using-add-filestore/main_test.go b/examples/using-add-filestore/main_test.go index f5d1d602b..189ac4242 100644 --- a/examples/using-add-filestore/main_test.go +++ b/examples/using-add-filestore/main_test.go @@ -1,11 +1,148 @@ package main import ( + "fmt" + "os" "testing" + "time" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" + "gofr.dev/pkg/gofr" + "gofr.dev/pkg/gofr/datasource/file" + "gofr.dev/pkg/gofr/testutil" ) -func TestIntegration(t *testing.T) { - assert.Equal(t, true, true) +type mockFileInfo struct { + name string +} + +func (m mockFileInfo) Name() string { return m.name } +func (m mockFileInfo) Size() int64 { return 0 } +func (m mockFileInfo) Mode() os.FileMode { return 0 } +func (m mockFileInfo) ModTime() time.Time { return time.Now() } +func (m mockFileInfo) IsDir() bool { return false } +func (m mockFileInfo) Sys() interface{} { return nil } + +func TestPwdCommand(t *testing.T) { + os.Args = []string{"command", "pwd"} + logs := testutil.StdoutOutputForFunc(func() { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + app := gofr.NewCMD() + mock := file.NewMockFileSystemProvider(ctrl) + + mock.EXPECT().UseLogger(app.Logger()) + mock.EXPECT().UseMetrics(app.Metrics()) + mock.EXPECT().Connect() + mock.EXPECT().Getwd().DoAndReturn(func() (string, error) { + return "/", nil + }) + app.AddFileStore(mock) + registerPwdCommand(app, mock) + app.Run() + }) + assert.Contains(t, logs, "/", "Test failed") +} + +func TestLSCommand(t *testing.T) { + path := "/" + os.Args = []string{"command", "ls", fmt.Sprintf("-path=%s", path)} + logs := testutil.StdoutOutputForFunc(func() { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + app := gofr.NewCMD() + mock := file.NewMockFileSystemProvider(ctrl) + + mock.EXPECT().UseLogger(app.Logger()) + mock.EXPECT().UseMetrics(app.Metrics()) + mock.EXPECT().Connect() + mock.EXPECT().ReadDir(path).DoAndReturn(func(s string) ([]file.FileInfo, error) { + var files []file.FileInfo = []file.FileInfo{ + mockFileInfo{name: "file1.txt"}, + mockFileInfo{name: "file2.txt"}, + } + return files, nil + }) + app.AddFileStore(mock) + registerLsCommand(app, mock) + app.Run() + }) + assert.Contains(t, logs, "file1.txt", "Test failed") + assert.Contains(t, logs, "file2.txt", "Test failed") + assert.NotContains(t, logs, "file3.txt", "Test failed") +} + +func TestGrepCommand(t *testing.T) { + path := "/" + os.Args = []string{"command", "grep", "-keyword=fi", fmt.Sprintf("-path=%s", path)} + logs := testutil.StdoutOutputForFunc(func() { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + app := gofr.NewCMD() + mock := file.NewMockFileSystemProvider(ctrl) + + mock.EXPECT().UseLogger(app.Logger()) + mock.EXPECT().UseMetrics(app.Metrics()) + mock.EXPECT().Connect() + mock.EXPECT().ReadDir("/").DoAndReturn(func(s string) ([]file.FileInfo, error) { + var files []file.FileInfo = []file.FileInfo{ + mockFileInfo{name: "file1.txt"}, + mockFileInfo{name: "file2.txt"}, + } + return files, nil + }) + app.AddFileStore(mock) + registerGrepCommand(app, mock) + app.Run() + }) + assert.Contains(t, logs, "file1.txt", "Test failed") + assert.Contains(t, logs, "file2.txt", "Test failed") + assert.NotContains(t, logs, "file3.txt", "Test failed") +} + +func TestCreateFileCommand(t *testing.T) { + fileName := "file.txt" + os.Args = []string{"command", "createfile", fmt.Sprintf("-filename=%s", fileName)} + logs := testutil.StdoutOutputForFunc(func() { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + app := gofr.NewCMD() + mock := file.NewMockFileSystemProvider(ctrl) + + mock.EXPECT().UseLogger(app.Logger()) + mock.EXPECT().UseMetrics(app.Metrics()) + mock.EXPECT().Connect() + mock.EXPECT().Create(fileName).DoAndReturn(func(s string) (file.File, error) { + return &file.MockFile{}, nil + }) + app.AddFileStore(mock) + registerCreateFileCommand(app, mock) + app.Run() + }) + assert.Contains(t, logs, "Creating file :file.txt", "Test failed") + assert.Contains(t, logs, "Succesfully created file:file.txt", "Test failed") +} + +func TestRmCommand(t *testing.T) { + fileName := "file.txt" + os.Args = []string{"command", "rm", fmt.Sprintf("-filename=%s", fileName)} + logs := testutil.StdoutOutputForFunc(func() { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + app := gofr.NewCMD() + mock := file.NewMockFileSystemProvider(ctrl) + + mock.EXPECT().UseLogger(app.Logger()) + mock.EXPECT().UseMetrics(app.Metrics()) + mock.EXPECT().Connect() + mock.EXPECT().Remove("file.txt").DoAndReturn(func(filename string) error { + return nil + }) + app.AddFileStore(mock) + registerRmCommand(app, mock) + app.Run() + }) + assert.Contains(t, logs, "Removing file :file.txt", "Test failed") + assert.Contains(t, logs, "Succesfully removed file:file.txt", "Test failed") } From 1de2f7565c17b51ca4cbcfce134b22ebb5aa7486 Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Sat, 28 Sep 2024 12:45:42 +0530 Subject: [PATCH 03/17] fixing lint issues --- examples/using-add-filestore/main.go | 47 +++++++++++++---------- examples/using-add-filestore/main_test.go | 35 ++++++++++------- go.mod | 4 ++ go.sum | 9 +++++ 4 files changed, 61 insertions(+), 34 deletions(-) diff --git a/examples/using-add-filestore/main.go b/examples/using-add-filestore/main.go index 49cac3aa4..c7424d22e 100644 --- a/examples/using-add-filestore/main.go +++ b/examples/using-add-filestore/main.go @@ -17,17 +17,17 @@ const ( SFTP ) -// This can be a common function to configure both FTP and SFTP server +// This can be a common function to configure both FTP and SFTP server. func configureFileServer(app *gofr.App) file.FileSystemProvider { port, _ := strconv.Atoi(app.Config.Get("PORT")) - fileSystemProvider := ftp.New(&ftp.Config{ + + return ftp.New(&ftp.Config{ Host: app.Config.Get("HOST"), User: app.Config.Get("USER_NAME"), Password: app.Config.Get("PASSWORD"), Port: port, RemoteDir: app.Config.Get("REMOTE_DIR_PATH"), }) - return fileSystemProvider } func printFiles(files []file.FileInfo, err error) { @@ -53,18 +53,20 @@ func grepFiles(files []file.FileInfo, keyword string, err error) { } func registerPwdCommand(app *gofr.App, fs file.FileSystemProvider) { - app.SubCommand("pwd", func(c *gofr.Context) (interface{}, error) { - workingDirectory, error := fs.Getwd() - return workingDirectory, error + app.SubCommand("pwd", func(_ *gofr.Context) (interface{}, error) { + workingDirectory, err := fs.Getwd() + + return workingDirectory, err }) } func registerLsCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("ls", func(c *gofr.Context) (interface{}, error) { path := c.Param("path") - files, error := fs.ReadDir(path) - printFiles(files, error) - return "", error + files, err := fs.ReadDir(path) + printFiles(files, err) + + return "", err }) } @@ -72,9 +74,10 @@ func registerGrepCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("grep", func(c *gofr.Context) (interface{}, error) { keyword := c.Param("keyword") path := c.Param("path") - files, error := fs.ReadDir(path) - grepFiles(files, keyword, error) - return "", error + files, err := fs.ReadDir(path) + grepFiles(files, keyword, err) + + return "", err }) } @@ -82,11 +85,13 @@ func registerCreateFileCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("createfile", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") fmt.Printf("Creating file :%s", fileName) - _, error := fs.Create(fileName) - if error == nil { - fmt.Printf("Succesfully created file:%s", fileName) + _, err := fs.Create(fileName) + + if err == nil { + fmt.Printf("Successfully created file:%s", fileName) } - return "", error + + return "", err }) } @@ -94,11 +99,13 @@ func registerRmCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("rm", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") fmt.Printf("Removing file :%s", fileName) - error := fs.Remove(fileName) - if error == nil { - fmt.Printf("Succesfully removed file:%s", fileName) + err := fs.Remove(fileName) + + if err == nil { + fmt.Printf("Successfully removed file:%s", fileName) } - return "", error + + return "", err }) } diff --git a/examples/using-add-filestore/main_test.go b/examples/using-add-filestore/main_test.go index 189ac4242..9fa827738 100644 --- a/examples/using-add-filestore/main_test.go +++ b/examples/using-add-filestore/main_test.go @@ -17,18 +17,19 @@ type mockFileInfo struct { name string } -func (m mockFileInfo) Name() string { return m.name } -func (m mockFileInfo) Size() int64 { return 0 } -func (m mockFileInfo) Mode() os.FileMode { return 0 } -func (m mockFileInfo) ModTime() time.Time { return time.Now() } -func (m mockFileInfo) IsDir() bool { return false } -func (m mockFileInfo) Sys() interface{} { return nil } +func (m mockFileInfo) Name() string { return m.name } +func (mockFileInfo) Size() int64 { return 0 } +func (mockFileInfo) Mode() os.FileMode { return 0 } +func (mockFileInfo) ModTime() time.Time { return time.Now() } +func (mockFileInfo) IsDir() bool { return false } +func (mockFileInfo) Sys() interface{} { return nil } func TestPwdCommand(t *testing.T) { os.Args = []string{"command", "pwd"} logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() + app := gofr.NewCMD() mock := file.NewMockFileSystemProvider(ctrl) @@ -51,17 +52,19 @@ func TestLSCommand(t *testing.T) { logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() + app := gofr.NewCMD() mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) mock.EXPECT().UseMetrics(app.Metrics()) mock.EXPECT().Connect() - mock.EXPECT().ReadDir(path).DoAndReturn(func(s string) ([]file.FileInfo, error) { - var files []file.FileInfo = []file.FileInfo{ + mock.EXPECT().ReadDir(path).DoAndReturn(func(_ string) ([]file.FileInfo, error) { + files := []file.FileInfo{ mockFileInfo{name: "file1.txt"}, mockFileInfo{name: "file2.txt"}, } + return files, nil }) app.AddFileStore(mock) @@ -79,17 +82,19 @@ func TestGrepCommand(t *testing.T) { logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() + app := gofr.NewCMD() mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) mock.EXPECT().UseMetrics(app.Metrics()) mock.EXPECT().Connect() - mock.EXPECT().ReadDir("/").DoAndReturn(func(s string) ([]file.FileInfo, error) { - var files []file.FileInfo = []file.FileInfo{ + mock.EXPECT().ReadDir("/").DoAndReturn(func(_ string) ([]file.FileInfo, error) { + files := []file.FileInfo{ mockFileInfo{name: "file1.txt"}, mockFileInfo{name: "file2.txt"}, } + return files, nil }) app.AddFileStore(mock) @@ -107,13 +112,14 @@ func TestCreateFileCommand(t *testing.T) { logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() + app := gofr.NewCMD() mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) mock.EXPECT().UseMetrics(app.Metrics()) mock.EXPECT().Connect() - mock.EXPECT().Create(fileName).DoAndReturn(func(s string) (file.File, error) { + mock.EXPECT().Create(fileName).DoAndReturn(func(_ string) (file.File, error) { return &file.MockFile{}, nil }) app.AddFileStore(mock) @@ -121,7 +127,7 @@ func TestCreateFileCommand(t *testing.T) { app.Run() }) assert.Contains(t, logs, "Creating file :file.txt", "Test failed") - assert.Contains(t, logs, "Succesfully created file:file.txt", "Test failed") + assert.Contains(t, logs, "Successfully created file:file.txt", "Test failed") } func TestRmCommand(t *testing.T) { @@ -130,13 +136,14 @@ func TestRmCommand(t *testing.T) { logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() + app := gofr.NewCMD() mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) mock.EXPECT().UseMetrics(app.Metrics()) mock.EXPECT().Connect() - mock.EXPECT().Remove("file.txt").DoAndReturn(func(filename string) error { + mock.EXPECT().Remove("file.txt").DoAndReturn(func(_ string) error { return nil }) app.AddFileStore(mock) @@ -144,5 +151,5 @@ func TestRmCommand(t *testing.T) { app.Run() }) assert.Contains(t, logs, "Removing file :file.txt", "Test failed") - assert.Contains(t, logs, "Succesfully removed file:file.txt", "Test failed") + assert.Contains(t, logs, "Successfully removed file:file.txt", "Test failed") } diff --git a/go.mod b/go.mod index 1efab4ae8..94ce4c080 100644 --- a/go.mod +++ b/go.mod @@ -68,7 +68,10 @@ require ( github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect github.com/googleapis/gax-go/v2 v2.13.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/jlaffaye/ftp v0.2.0 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect @@ -88,6 +91,7 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect + gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd // indirect golang.org/x/crypto v0.27.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/sys v0.25.0 // indirect diff --git a/go.sum b/go.sum index 5d77c7ce2..ce3c70daa 100644 --- a/go.sum +++ b/go.sum @@ -120,8 +120,15 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDa github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/jlaffaye/ftp v0.2.0 h1:lXNvW7cBu7R/68bknOX3MrRIIqZ61zELs1P2RAiA3lg= +github.com/jlaffaye/ftp v0.2.0/go.mod h1:is2Ds5qkhceAPy2xD6RLI6hmp/qysSoymZ+Z2uTnspI= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -252,6 +259,8 @@ go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd h1:YTiTFoRmx/TK+uzmSVAP7ZPodeZaDauLmhD2ov+lgFE= +gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd/go.mod h1:Pau/kQnk86g7U3Nwuc5/g05PaPFxfn4VFXmOa8Z4xrM= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= From f20c54a740e9fbcffd25abb7b22c8de3de50b28a Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Sat, 5 Oct 2024 02:20:29 +0530 Subject: [PATCH 04/17] using logger to display logs in CMD --- examples/using-add-filestore/README.md | 18 +++++------------- examples/using-add-filestore/configs/.env | 8 ++++---- examples/using-add-filestore/main.go | 13 +++++++++---- examples/using-add-filestore/main_test.go | 11 +++++++---- go.mod | 11 +++++++---- 5 files changed, 32 insertions(+), 29 deletions(-) diff --git a/examples/using-add-filestore/README.md b/examples/using-add-filestore/README.md index 38d442aec..22506cdf2 100644 --- a/examples/using-add-filestore/README.md +++ b/examples/using-add-filestore/README.md @@ -10,34 +10,26 @@ Choose a library listed above and follow their respective documentation to confi ### To run the example use the commands below: To print the current working directory of the configured remote file server -``` +```console go run main.go pwd ``` To get the list of all directories or files in the given path of the configured remote file server ``` -go run main.go ls -path= - -Eg:- go run main.go ls -path=/ + go run main.go ls -path=/ ``` To grep the list of all files and directories in the given path that is matching with the keyword provided ``` -go run main.go grep -keyword=fi -path= - -Eg:- go run main.go grep -keyword=fi -path=/ +go run main.go grep -keyword=fi -path=/ ``` To create a file in the current working directory with the provided filename ``` -go run main.go createfile -filename= - -Eg:- go run main.go createfile -filename=file.txt + go run main.go createfile -filename=file.txt ``` To remove the file with the provided filename from the current working directory ``` -go run main.go rm -filename= - -Eg:- go run main.go rm -filename=file.txt + go run main.go rm -filename=file.txt ``` \ No newline at end of file diff --git a/examples/using-add-filestore/configs/.env b/examples/using-add-filestore/configs/.env index 01833ea49..3a56b6e80 100644 --- a/examples/using-add-filestore/configs/.env +++ b/examples/using-add-filestore/configs/.env @@ -1,5 +1,5 @@ -HOST="localhost" -USER_NAME="anonymous" -PASSWORD="test" +HOST=localhost +USER_NAME=anonymous +PASSWORD=test PORT=21 -REMOTE_DIR_PATH="/" \ No newline at end of file +REMOTE_DIR_PATH=/ \ No newline at end of file diff --git a/examples/using-add-filestore/main.go b/examples/using-add-filestore/main.go index c7424d22e..e1fdabc59 100644 --- a/examples/using-add-filestore/main.go +++ b/examples/using-add-filestore/main.go @@ -8,10 +8,13 @@ import ( "gofr.dev/pkg/gofr" "gofr.dev/pkg/gofr/datasource/file" "gofr.dev/pkg/gofr/datasource/file/ftp" + "gofr.dev/pkg/gofr/logging" ) type FileServerType int +var logger logging.Logger + const ( FTP FileServerType = iota SFTP @@ -84,11 +87,11 @@ func registerGrepCommand(app *gofr.App, fs file.FileSystemProvider) { func registerCreateFileCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("createfile", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") - fmt.Printf("Creating file :%s", fileName) + logger.Log("Creating file : ", fileName) _, err := fs.Create(fileName) if err == nil { - fmt.Printf("Successfully created file:%s", fileName) + logger.Log("Successfully created file: ", fileName) } return "", err @@ -98,11 +101,11 @@ func registerCreateFileCommand(app *gofr.App, fs file.FileSystemProvider) { func registerRmCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("rm", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") - fmt.Printf("Removing file :%s", fileName) + logger.Log("Removing file : ", fileName) err := fs.Remove(fileName) if err == nil { - fmt.Printf("Successfully removed file:%s", fileName) + logger.Log("Successfully removed file: ", fileName) } return "", err @@ -112,6 +115,8 @@ func registerRmCommand(app *gofr.App, fs file.FileSystemProvider) { func main() { app := gofr.NewCMD() + logger = gofr.New().Logger() + fileSystemProvider := configureFileServer(app) app.AddFileStore(fileSystemProvider) diff --git a/examples/using-add-filestore/main_test.go b/examples/using-add-filestore/main_test.go index 9fa827738..763163699 100644 --- a/examples/using-add-filestore/main_test.go +++ b/examples/using-add-filestore/main_test.go @@ -31,6 +31,7 @@ func TestPwdCommand(t *testing.T) { defer ctrl.Finish() app := gofr.NewCMD() + logger = gofr.New().Logger() mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -114,6 +115,7 @@ func TestCreateFileCommand(t *testing.T) { defer ctrl.Finish() app := gofr.NewCMD() + logger = gofr.New().Logger() mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -126,8 +128,8 @@ func TestCreateFileCommand(t *testing.T) { registerCreateFileCommand(app, mock) app.Run() }) - assert.Contains(t, logs, "Creating file :file.txt", "Test failed") - assert.Contains(t, logs, "Successfully created file:file.txt", "Test failed") + assert.Contains(t, logs, "Creating file : \",\"file.txt\"", "Test failed") + assert.Contains(t, logs, "Successfully created file: \",\"file.txt\"", "Test failed") } func TestRmCommand(t *testing.T) { @@ -138,6 +140,7 @@ func TestRmCommand(t *testing.T) { defer ctrl.Finish() app := gofr.NewCMD() + logger = gofr.New().Logger() mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -150,6 +153,6 @@ func TestRmCommand(t *testing.T) { registerRmCommand(app, mock) app.Run() }) - assert.Contains(t, logs, "Removing file :file.txt", "Test failed") - assert.Contains(t, logs, "Successfully removed file:file.txt", "Test failed") + assert.Contains(t, logs, "Removing file : \",\"file.txt\"", "Test failed") + assert.Contains(t, logs, "Successfully removed file: \",\"file.txt\"", "Test failed") } diff --git a/go.mod b/go.mod index 94ce4c080..c7190b4e6 100644 --- a/go.mod +++ b/go.mod @@ -45,6 +45,12 @@ require ( modernc.org/sqlite v1.33.1 ) +require ( + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/jlaffaye/ftp v0.2.0 // indirect +) + require ( cloud.google.com/go v0.115.1 // indirect cloud.google.com/go/auth v0.9.3 // indirect @@ -68,10 +74,7 @@ require ( github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect github.com/googleapis/gax-go/v2 v2.13.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect - github.com/jlaffaye/ftp v0.2.0 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect @@ -91,7 +94,7 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect - gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd // indirect + gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd golang.org/x/crypto v0.27.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/sys v0.25.0 // indirect From 0e2104f21671bc38f9b64c566f70b1c154c9faf2 Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Sun, 6 Oct 2024 00:19:37 +0530 Subject: [PATCH 05/17] initializing new module for files-interaction example --- examples/using-add-filestore/go.mod | 104 +++++++ examples/using-add-filestore/go.sum | 423 ++++++++++++++++++++++++++++ go.mod | 7 - 3 files changed, 527 insertions(+), 7 deletions(-) create mode 100644 examples/using-add-filestore/go.mod create mode 100644 examples/using-add-filestore/go.sum diff --git a/examples/using-add-filestore/go.mod b/examples/using-add-filestore/go.mod new file mode 100644 index 000000000..9bf2a37e8 --- /dev/null +++ b/examples/using-add-filestore/go.mod @@ -0,0 +1,104 @@ +module gofr.dev/examples/using-add-filestore + +go 1.22 + +require gofr.dev v1.22.1 + +require ( + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/jlaffaye/ftp v0.2.0 // indirect +) + +require ( + cloud.google.com/go v0.115.1 // indirect + cloud.google.com/go/auth v0.9.5 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect + cloud.google.com/go/compute/metadata v0.5.2 // indirect + cloud.google.com/go/iam v1.2.0 // indirect + cloud.google.com/go/pubsub v1.42.0 // indirect + filippo.io/edwards25519 v1.1.0 // indirect + github.com/DATA-DOG/go-sqlmock v1.5.2 // indirect + github.com/XSAM/otelsql v0.34.0 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/eclipse/paho.mqtt.golang v1.5.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-sql-driver/mysql v1.8.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/google/s2a-go v0.1.8 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect + github.com/googleapis/gax-go/v2 v2.13.0 // indirect + github.com/gorilla/mux v1.8.1 // indirect + github.com/gorilla/websocket v1.5.3 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/joho/godotenv v1.5.1 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/ncruces/go-strftime v0.1.9 // indirect + github.com/openzipkin/zipkin-go v0.4.3 // indirect + github.com/pierrec/lz4/v4 v4.1.21 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.20.4 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.59.1 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 // indirect + github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 // indirect + github.com/redis/go-redis/v9 v9.6.1 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + github.com/segmentio/kafka-go v0.4.47 // indirect + github.com/stretchr/testify v1.9.0 + go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.55.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/exporters/zipkin v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect + go.uber.org/mock v0.4.0 + gofr.dev/pkg/gofr/datasource/file/ftp v0.1.0 + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/oauth2 v0.23.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/text v0.18.0 // indirect + golang.org/x/time v0.6.0 // indirect + google.golang.org/api v0.199.0 // indirect + google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/grpc v1.67.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect + modernc.org/libc v1.55.3 // indirect + modernc.org/mathutil v1.6.0 // indirect + modernc.org/memory v1.8.0 // indirect + modernc.org/sqlite v1.33.1 // indirect + modernc.org/strutil v1.2.0 // indirect + modernc.org/token v1.1.0 // indirect +) diff --git a/examples/using-add-filestore/go.sum b/examples/using-add-filestore/go.sum new file mode 100644 index 000000000..11b60c22d --- /dev/null +++ b/examples/using-add-filestore/go.sum @@ -0,0 +1,423 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.115.1 h1:Jo0SM9cQnSkYfp44+v+NQXHpcHqlnRJk2qxh6yvxxxQ= +cloud.google.com/go v0.115.1/go.mod h1:DuujITeaufu3gL68/lOFIirVNJwQeyf5UXyi+Wbgknc= +cloud.google.com/go/auth v0.9.5 h1:4CTn43Eynw40aFVr3GpPqsQponx2jv0BQpjvajsbbzw= +cloud.google.com/go/auth v0.9.5/go.mod h1:Xo0n7n66eHyOWWCnitop6870Ilwo3PiZyodVkkH1xWM= +cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= +cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= +cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo= +cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= +cloud.google.com/go/iam v1.2.0 h1:kZKMKVNk/IsSSc/udOb83K0hL/Yh/Gcqpz+oAkoIFN8= +cloud.google.com/go/iam v1.2.0/go.mod h1:zITGuWgsLZxd8OwAlX+eMFgZDXzBm7icj1PVTYG766Q= +cloud.google.com/go/kms v1.19.0 h1:x0OVJDl6UH1BSX4THKlMfdcFWoE4ruh90ZHuilZekrU= +cloud.google.com/go/kms v1.19.0/go.mod h1:e4imokuPJUc17Trz2s6lEXFDt8bgDmvpVynH39bdrHM= +cloud.google.com/go/longrunning v0.6.0 h1:mM1ZmaNsQsnb+5n1DNPeL0KwQd9jQRqSqSDEkBZr+aI= +cloud.google.com/go/longrunning v0.6.0/go.mod h1:uHzSZqW89h7/pasCWNYdUpwGz3PcVWhrWupreVPYLts= +cloud.google.com/go/pubsub v1.42.0 h1:PVTbzorLryFL5ue8esTS2BfehUs0ahyNOY9qcd+HMOs= +cloud.google.com/go/pubsub v1.42.0/go.mod h1:KADJ6s4MbTwhXmse/50SebEhE4SmUwHi48z3/dHar1Y= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU= +github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= +github.com/XSAM/otelsql v0.34.0 h1:YdCRKy17Xn0MH717LEwqpVL/a+4nexmSCBrgoycYY6E= +github.com/XSAM/otelsql v0.34.0/go.mod h1:xaE+ybu+kJOYvtDyThbe0VoKWngvKHmNlrM1rOn8f94= +github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= +github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= +github.com/alicebob/miniredis/v2 v2.33.0 h1:uvTF0EDeu9RLnUEG27Db5I68ESoIxTiXbNUiji6lZrA= +github.com/alicebob/miniredis/v2 v2.33.0/go.mod h1:MhP4a3EU7aENRi9aO+tHfTBZicLqQevyi/DJpoj6mi0= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bsm/ginkgo/v2 v2.7.0/go.mod h1:AiKlXPm7ItEHNc/2+OkrNG4E0ITzojb9/xWzvQ9XZ9w= +github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= +github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= +github.com/bsm/gomega v1.26.0/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= +github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/eclipse/paho.mqtt.golang v1.5.0 h1:EH+bUVJNgttidWFkLLVKaQPGmkTUfQQqjOsyvMGvD6o= +github.com/eclipse/paho.mqtt.golang v1.5.0/go.mod h1:du/2qNQVqJf/Sqs4MEL77kR8QTqANF7XU7Fk0aOTAgk= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= +github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd h1:gbpYu9NMq8jhDVbvlGkMFWCjLFlqqEZjEmObmhUy6Vo= +github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= +github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= +github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= +github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= +github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/jlaffaye/ftp v0.2.0 h1:lXNvW7cBu7R/68bknOX3MrRIIqZ61zELs1P2RAiA3lg= +github.com/jlaffaye/ftp v0.2.0/go.mod h1:is2Ds5qkhceAPy2xD6RLI6hmp/qysSoymZ+Z2uTnspI= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kisielk/sqlstruct v0.0.0-20201105191214-5f3e10d3ab46/go.mod h1:yyMNCyc/Ib3bDTKd379tNMpB/7/H5TjM2Y9QJ5THLbE= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= +github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7sjsSdg= +github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= +github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= +github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 h1:EaDatTxkdHG+U3Bk4EUr+DZ7fOGwTfezUiUJMaIcaho= +github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5/go.mod h1:fyalQWdtzDBECAQFBJuQe5bzQ02jGd5Qcbgb97Flm7U= +github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 h1:EfpWLLCyXw8PSM2/XNJLjI3Pb27yVE+gIAfeqp8LUCc= +github.com/redis/go-redis/extra/redisotel/v9 v9.0.5/go.mod h1:WZjPDy7VNzn77AAfnAfVjZNvfJTYfPetfZk5yoSTLaQ= +github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= +github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4= +github.com/redis/go-redis/v9 v9.6.1/go.mod h1:0C0c6ycQsdpVNQpxb1njEQIqkx5UcsM8FJCQLgE9+RA= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/segmentio/kafka-go v0.4.47 h1:IqziR4pA3vrZq7YdRxaT3w1/5fvIH5qpCwstUanQQB0= +github.com/segmentio/kafka-go v0.4.47/go.mod h1:HjF6XbOKh0Pjlkr5GVZxt6CsjjwnmhVOfURM5KMd8qg= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= +github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= +go.einride.tech/aip v0.67.1 h1:d/4TW92OxXBngkSOwWS2CH5rez869KpKMaN44mdxkFI= +go.einride.tech/aip v0.67.1/go.mod h1:ZGX4/zKw8dcgzdLsrvpOOGxfxI2QSk12SlP7d6c0/XI= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.55.0 h1:sqmsIQ75l6lfZjjpnXXT9DFVtYEDg6CH0/Cn4/3A1Wg= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.55.0/go.mod h1:rsg1EO8LXSs2po50PB5CeY/MSVlhghuKBgXlKnqm6ks= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 h1:ZIg3ZT/aQ7AfKqdwp7ECpOK6vHqquXXuyTjIO8ZdmPs= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0/go.mod h1:DQAwmETtZV00skUwgD6+0U89g80NKsJE3DCKeLLPQMI= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 h1:lsInsfvhVIfOI6qHVyysXMNDnjO9Npvl7tlDPJFBVd4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0/go.mod h1:KQsVNh4OjgjTG0G6EiNi1jVpnaeeKsKMRwbLN+f1+8M= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 h1:m0yTiGDLUvVYaTFbAvCkVYIYcvwKt3G7OLoN77NUs/8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0/go.mod h1:wBQbT4UekBfegL2nx0Xk1vBcnzyBPsIVm9hRG4fYcr4= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/exporters/zipkin v1.30.0 h1:1uYaSfxiCLdJATlGEtYjQe4jZYfqCjVwxeSTMXe8VF4= +go.opentelemetry.io/otel/exporters/zipkin v1.30.0/go.mod h1:r/4BhMc3kiKxD61wGh9J3NVQ3/cZ45F2NHkQgVnql48= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= +go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= +go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= +go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= +go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +gofr.dev v1.22.1 h1:WLD9pdVkWeDMdRdggmZtq//t41RIN/6XGr++IXlN3jM= +gofr.dev v1.22.1/go.mod h1:jldZJGrUKxD6BUEFwdlODcBCGBSvgkVoMy9q15sJm2Q= +gofr.dev/pkg/gofr/datasource/file/ftp v0.1.0 h1:543791JYpNfB2Q76Ey9N5CQW5bIo6dlhVwvMdb+6Oow= +gofr.dev/pkg/gofr/datasource/file/ftp v0.1.0/go.mod h1:Pau/kQnk86g7U3Nwuc5/g05PaPFxfn4VFXmOa8Z4xrM= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.199.0 h1:aWUXClp+VFJmqE0JPvpZOK3LDQMyFKYIow4etYd9qxs= +google.golang.org/api v0.199.0/go.mod h1:ohG4qSztDJmZdjK/Ar6MhbAmb/Rpi4JHOqagsh90K28= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 h1:BulPr26Jqjnd4eYDVe+YvyR7Yc2vJGkO5/0UxD0/jZU= +google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:hL97c3SYopEHblzpxRL4lSs523++l8DYxGM1FQiYmb4= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw= +google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +modernc.org/cc/v4 v4.21.4 h1:3Be/Rdo1fpr8GrQ7IVw9OHtplU4gWbb+wNgeoBMmGLQ= +modernc.org/cc/v4 v4.21.4/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= +modernc.org/ccgo/v4 v4.19.2 h1:lwQZgvboKD0jBwdaeVCTouxhxAyN6iawF3STraAal8Y= +modernc.org/ccgo/v4 v4.19.2/go.mod h1:ysS3mxiMV38XGRTTcgo0DQTeTmAO4oCmJl1nX9VFI3s= +modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= +modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= +modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw= +modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= +modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 h1:5D53IMaUuA5InSeMu9eJtlQXS2NxAhyWQvkKEgXZhHI= +modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= +modernc.org/libc v1.55.3 h1:AzcW1mhlPNrRtjS5sS+eW2ISCgSOLLNyFzRh/V3Qj/U= +modernc.org/libc v1.55.3/go.mod h1:qFXepLhz+JjFThQ4kzwzOjA/y/artDeg+pcYnY+Q83w= +modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= +modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= +modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= +modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= +modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= +modernc.org/sqlite v1.33.1 h1:trb6Z3YYoeM9eDL1O8do81kP+0ejv+YzgyFo+Gwy0nM= +modernc.org/sqlite v1.33.1/go.mod h1:pXV2xHxhzXZsgT/RtTFAPY6JJDEvOTcTdwADQCCWD4k= +modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= +modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= +modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= +modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= diff --git a/go.mod b/go.mod index 0a0fa8ae2..05f266d07 100644 --- a/go.mod +++ b/go.mod @@ -45,12 +45,6 @@ require ( modernc.org/sqlite v1.33.1 ) -require ( - github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/jlaffaye/ftp v0.2.0 // indirect -) - require ( cloud.google.com/go v0.115.1 // indirect cloud.google.com/go/auth v0.9.5 // indirect @@ -94,7 +88,6 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect - gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd golang.org/x/crypto v0.27.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/sys v0.25.0 // indirect From eff43104a041a7677afd46aa7275cdf523d5b771 Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Sun, 6 Oct 2024 00:20:29 +0530 Subject: [PATCH 06/17] reverting go.sum --- go.sum | 9 --------- 1 file changed, 9 deletions(-) diff --git a/go.sum b/go.sum index 6d90cf3ea..3747ec8a1 100644 --- a/go.sum +++ b/go.sum @@ -120,15 +120,8 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDa github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= -github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/jlaffaye/ftp v0.2.0 h1:lXNvW7cBu7R/68bknOX3MrRIIqZ61zELs1P2RAiA3lg= -github.com/jlaffaye/ftp v0.2.0/go.mod h1:is2Ds5qkhceAPy2xD6RLI6hmp/qysSoymZ+Z2uTnspI= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -259,8 +252,6 @@ go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd h1:YTiTFoRmx/TK+uzmSVAP7ZPodeZaDauLmhD2ov+lgFE= -gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd/go.mod h1:Pau/kQnk86g7U3Nwuc5/g05PaPFxfn4VFXmOa8Z4xrM= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= From cc68a76110c885b7b086d22446a62d3a7f814d09 Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Thu, 10 Oct 2024 00:30:36 +0530 Subject: [PATCH 07/17] injecting logger into function and refactoring test --- examples/using-add-filestore/main.go | 12 +++---- examples/using-add-filestore/main_test.go | 41 ++++++++++++++++++++--- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/examples/using-add-filestore/main.go b/examples/using-add-filestore/main.go index e1fdabc59..a1ffa1068 100644 --- a/examples/using-add-filestore/main.go +++ b/examples/using-add-filestore/main.go @@ -13,8 +13,6 @@ import ( type FileServerType int -var logger logging.Logger - const ( FTP FileServerType = iota SFTP @@ -84,7 +82,7 @@ func registerGrepCommand(app *gofr.App, fs file.FileSystemProvider) { }) } -func registerCreateFileCommand(app *gofr.App, fs file.FileSystemProvider) { +func registerCreateFileCommand(app *gofr.App, fs file.FileSystemProvider, logger logging.Logger) { app.SubCommand("createfile", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") logger.Log("Creating file : ", fileName) @@ -98,7 +96,7 @@ func registerCreateFileCommand(app *gofr.App, fs file.FileSystemProvider) { }) } -func registerRmCommand(app *gofr.App, fs file.FileSystemProvider) { +func registerRmCommand(app *gofr.App, fs file.FileSystemProvider, logger logging.Logger) { app.SubCommand("rm", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") logger.Log("Removing file : ", fileName) @@ -115,7 +113,7 @@ func registerRmCommand(app *gofr.App, fs file.FileSystemProvider) { func main() { app := gofr.NewCMD() - logger = gofr.New().Logger() + logger := gofr.New().Logger() fileSystemProvider := configureFileServer(app) @@ -127,9 +125,9 @@ func main() { registerGrepCommand(app, fileSystemProvider) - registerCreateFileCommand(app, fileSystemProvider) + registerCreateFileCommand(app, fileSystemProvider, logger) - registerRmCommand(app, fileSystemProvider) + registerRmCommand(app, fileSystemProvider, logger) app.Run() } diff --git a/examples/using-add-filestore/main_test.go b/examples/using-add-filestore/main_test.go index 763163699..51dd88a11 100644 --- a/examples/using-add-filestore/main_test.go +++ b/examples/using-add-filestore/main_test.go @@ -26,12 +26,13 @@ func (mockFileInfo) Sys() interface{} { return nil } func TestPwdCommand(t *testing.T) { os.Args = []string{"command", "pwd"} + logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() app := gofr.NewCMD() - logger = gofr.New().Logger() + mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -40,21 +41,27 @@ func TestPwdCommand(t *testing.T) { mock.EXPECT().Getwd().DoAndReturn(func() (string, error) { return "/", nil }) + app.AddFileStore(mock) + registerPwdCommand(app, mock) + app.Run() }) + assert.Contains(t, logs, "/", "Test failed") } func TestLSCommand(t *testing.T) { path := "/" os.Args = []string{"command", "ls", fmt.Sprintf("-path=%s", path)} + logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() app := gofr.NewCMD() + mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -68,10 +75,14 @@ func TestLSCommand(t *testing.T) { return files, nil }) + app.AddFileStore(mock) + registerLsCommand(app, mock) + app.Run() }) + assert.Contains(t, logs, "file1.txt", "Test failed") assert.Contains(t, logs, "file2.txt", "Test failed") assert.NotContains(t, logs, "file3.txt", "Test failed") @@ -80,11 +91,13 @@ func TestLSCommand(t *testing.T) { func TestGrepCommand(t *testing.T) { path := "/" os.Args = []string{"command", "grep", "-keyword=fi", fmt.Sprintf("-path=%s", path)} + logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() app := gofr.NewCMD() + mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -98,10 +111,14 @@ func TestGrepCommand(t *testing.T) { return files, nil }) + app.AddFileStore(mock) + registerGrepCommand(app, mock) + app.Run() }) + assert.Contains(t, logs, "file1.txt", "Test failed") assert.Contains(t, logs, "file2.txt", "Test failed") assert.NotContains(t, logs, "file3.txt", "Test failed") @@ -110,12 +127,15 @@ func TestGrepCommand(t *testing.T) { func TestCreateFileCommand(t *testing.T) { fileName := "file.txt" os.Args = []string{"command", "createfile", fmt.Sprintf("-filename=%s", fileName)} + logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() app := gofr.NewCMD() - logger = gofr.New().Logger() + + logger := gofr.New().Logger() + mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -124,10 +144,14 @@ func TestCreateFileCommand(t *testing.T) { mock.EXPECT().Create(fileName).DoAndReturn(func(_ string) (file.File, error) { return &file.MockFile{}, nil }) + app.AddFileStore(mock) - registerCreateFileCommand(app, mock) + + registerCreateFileCommand(app, mock, logger) + app.Run() }) + assert.Contains(t, logs, "Creating file : \",\"file.txt\"", "Test failed") assert.Contains(t, logs, "Successfully created file: \",\"file.txt\"", "Test failed") } @@ -135,12 +159,15 @@ func TestCreateFileCommand(t *testing.T) { func TestRmCommand(t *testing.T) { fileName := "file.txt" os.Args = []string{"command", "rm", fmt.Sprintf("-filename=%s", fileName)} + logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() app := gofr.NewCMD() - logger = gofr.New().Logger() + + logger := gofr.New().Logger() + mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -149,10 +176,14 @@ func TestRmCommand(t *testing.T) { mock.EXPECT().Remove("file.txt").DoAndReturn(func(_ string) error { return nil }) + app.AddFileStore(mock) - registerRmCommand(app, mock) + + registerRmCommand(app, mock, logger) + app.Run() }) + assert.Contains(t, logs, "Removing file : \",\"file.txt\"", "Test failed") assert.Contains(t, logs, "Successfully removed file: \",\"file.txt\"", "Test failed") } From 00c7304ff74fb05f8d7a0fdbf2e02cf1beca664e Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Thu, 19 Sep 2024 02:28:48 +0530 Subject: [PATCH 08/17] adding basic file interaction commands for ftp and sftp --- examples/using-add-filestore/main.go | 104 ++++++++++++++++++++++ examples/using-add-filestore/main_test.go | 11 +++ 2 files changed, 115 insertions(+) create mode 100644 examples/using-add-filestore/main.go create mode 100644 examples/using-add-filestore/main_test.go diff --git a/examples/using-add-filestore/main.go b/examples/using-add-filestore/main.go new file mode 100644 index 000000000..10b575032 --- /dev/null +++ b/examples/using-add-filestore/main.go @@ -0,0 +1,104 @@ +package main + +import ( + "fmt" + "strings" + + "gofr.dev/pkg/gofr" + "gofr.dev/pkg/gofr/datasource/file" + "gofr.dev/pkg/gofr/datasource/file/ftp" +) + +type FileServerType int + +const ( + FTP FileServerType = iota + SFTP +) + +// this can be a common function to configure both ftp and SFTP server +func configureFTPServer(fileServerType FileServerType) file.FileSystemProvider { + var fileSystemProvider file.FileSystemProvider + if fileServerType == FTP { + fileSystemProvider = ftp.New(&ftp.Config{ + Host: "localhost", + User: "anonymous", + Password: "", + Port: 21, + RemoteDir: "/", + }) + } else { + // fileSystemProvider = sftp.New(&ftp.Config{ + // Host: "localhost", + // User: "anonymous", + // Password: "", + // Port: 21, + // RemoteDir: "/", + // }) + } + return fileSystemProvider +} + +func printFiles(files []file.FileInfo, err error) { + if err != nil { + fmt.Println(err) + } else { + for _, f := range files { + fmt.Println(f.Name()) + } + } +} + +func filterFiles(files []file.FileInfo, keyword string, err error) { + if err != nil { + fmt.Println(err) + } else { + for _, f := range files { + if strings.HasPrefix(f.Name(), keyword) { + fmt.Println(f.Name()) + } + } + } +} + +func main() { + app := gofr.NewCMD() + + fileSystemProvider := configureFTPServer(FTP) + + app.AddFileStore(fileSystemProvider) + + app.SubCommand("pwd", func(c *gofr.Context) (interface{}, error) { + workingDirectory, error := fileSystemProvider.Getwd() + return workingDirectory, error + }) + + app.SubCommand("ls", func(c *gofr.Context) (interface{}, error) { + files, error := fileSystemProvider.ReadDir("/") + printFiles(files, error) + return "", nil + }) + + app.SubCommand("grep", func(c *gofr.Context) (interface{}, error) { + keyword := c.Param("keyword") + files, error := fileSystemProvider.ReadDir("/") + filterFiles(files, keyword, error) + return "", nil + }) + + app.SubCommand("createfile", func(c *gofr.Context) (interface{}, error) { + fileName := c.Param("filename") + fmt.Printf("Creating file :%s", fileName) + _, error := fileSystemProvider.Create(fileName) + return "", error + }) + + app.SubCommand("rm", func(c *gofr.Context) (interface{}, error) { + fileName := c.Param("filename") + fmt.Printf("Removing file :%s", fileName) + error := fileSystemProvider.Remove(fileName) + return "", error + }) + + app.Run() +} diff --git a/examples/using-add-filestore/main_test.go b/examples/using-add-filestore/main_test.go new file mode 100644 index 000000000..f5d1d602b --- /dev/null +++ b/examples/using-add-filestore/main_test.go @@ -0,0 +1,11 @@ +package main + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestIntegration(t *testing.T) { + assert.Equal(t, true, true) +} From 6f4622d744acc604ab2f3c8ce3035afb1fbd6f9b Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Sat, 28 Sep 2024 03:31:34 +0530 Subject: [PATCH 09/17] adding readme for the example --- examples/using-add-filestore/README.md | 43 +++++++ examples/using-add-filestore/configs/.env | 5 + examples/using-add-filestore/main.go | 91 ++++++++------ examples/using-add-filestore/main_test.go | 141 +++++++++++++++++++++- 4 files changed, 242 insertions(+), 38 deletions(-) create mode 100644 examples/using-add-filestore/README.md create mode 100644 examples/using-add-filestore/configs/.env diff --git a/examples/using-add-filestore/README.md b/examples/using-add-filestore/README.md new file mode 100644 index 000000000..38d442aec --- /dev/null +++ b/examples/using-add-filestore/README.md @@ -0,0 +1,43 @@ +# Add FileStore Example + +This GoFr example demonstrates a CMD application that can be used to interact with a remote file server using FTP or SFTP protocol + +### Setting up an FTP server in local machine +- https://security.appspot.com/vsftpd.html +- https://pypi.org/project/pyftpdlib/ + +Choose a library listed above and follow their respective documentation to configure an FTP server in your local machine and replace the configs/env file with correct HOST,USER_NAME,PASSWORD,PORT and REMOTE_DIR_PATH details. + +### To run the example use the commands below: +To print the current working directory of the configured remote file server +``` +go run main.go pwd +``` +To get the list of all directories or files in the given path of the configured remote file server + +``` +go run main.go ls -path= + +Eg:- go run main.go ls -path=/ +``` +To grep the list of all files and directories in the given path that is matching with the keyword provided + +``` +go run main.go grep -keyword=fi -path= + +Eg:- go run main.go grep -keyword=fi -path=/ +``` + +To create a file in the current working directory with the provided filename +``` +go run main.go createfile -filename= + +Eg:- go run main.go createfile -filename=file.txt +``` + +To remove the file with the provided filename from the current working directory +``` +go run main.go rm -filename= + +Eg:- go run main.go rm -filename=file.txt +``` \ No newline at end of file diff --git a/examples/using-add-filestore/configs/.env b/examples/using-add-filestore/configs/.env new file mode 100644 index 000000000..01833ea49 --- /dev/null +++ b/examples/using-add-filestore/configs/.env @@ -0,0 +1,5 @@ +HOST="localhost" +USER_NAME="anonymous" +PASSWORD="test" +PORT=21 +REMOTE_DIR_PATH="/" \ No newline at end of file diff --git a/examples/using-add-filestore/main.go b/examples/using-add-filestore/main.go index 10b575032..49cac3aa4 100644 --- a/examples/using-add-filestore/main.go +++ b/examples/using-add-filestore/main.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "strconv" "strings" "gofr.dev/pkg/gofr" @@ -16,26 +17,16 @@ const ( SFTP ) -// this can be a common function to configure both ftp and SFTP server -func configureFTPServer(fileServerType FileServerType) file.FileSystemProvider { - var fileSystemProvider file.FileSystemProvider - if fileServerType == FTP { - fileSystemProvider = ftp.New(&ftp.Config{ - Host: "localhost", - User: "anonymous", - Password: "", - Port: 21, - RemoteDir: "/", - }) - } else { - // fileSystemProvider = sftp.New(&ftp.Config{ - // Host: "localhost", - // User: "anonymous", - // Password: "", - // Port: 21, - // RemoteDir: "/", - // }) - } +// This can be a common function to configure both FTP and SFTP server +func configureFileServer(app *gofr.App) file.FileSystemProvider { + port, _ := strconv.Atoi(app.Config.Get("PORT")) + fileSystemProvider := ftp.New(&ftp.Config{ + Host: app.Config.Get("HOST"), + User: app.Config.Get("USER_NAME"), + Password: app.Config.Get("PASSWORD"), + Port: port, + RemoteDir: app.Config.Get("REMOTE_DIR_PATH"), + }) return fileSystemProvider } @@ -49,7 +40,7 @@ func printFiles(files []file.FileInfo, err error) { } } -func filterFiles(files []file.FileInfo, keyword string, err error) { +func grepFiles(files []file.FileInfo, keyword string, err error) { if err != nil { fmt.Println(err) } else { @@ -61,44 +52,72 @@ func filterFiles(files []file.FileInfo, keyword string, err error) { } } -func main() { - app := gofr.NewCMD() - - fileSystemProvider := configureFTPServer(FTP) - - app.AddFileStore(fileSystemProvider) - +func registerPwdCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("pwd", func(c *gofr.Context) (interface{}, error) { - workingDirectory, error := fileSystemProvider.Getwd() + workingDirectory, error := fs.Getwd() return workingDirectory, error }) +} +func registerLsCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("ls", func(c *gofr.Context) (interface{}, error) { - files, error := fileSystemProvider.ReadDir("/") + path := c.Param("path") + files, error := fs.ReadDir(path) printFiles(files, error) - return "", nil + return "", error }) +} +func registerGrepCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("grep", func(c *gofr.Context) (interface{}, error) { keyword := c.Param("keyword") - files, error := fileSystemProvider.ReadDir("/") - filterFiles(files, keyword, error) - return "", nil + path := c.Param("path") + files, error := fs.ReadDir(path) + grepFiles(files, keyword, error) + return "", error }) +} +func registerCreateFileCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("createfile", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") fmt.Printf("Creating file :%s", fileName) - _, error := fileSystemProvider.Create(fileName) + _, error := fs.Create(fileName) + if error == nil { + fmt.Printf("Succesfully created file:%s", fileName) + } return "", error }) +} +func registerRmCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("rm", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") fmt.Printf("Removing file :%s", fileName) - error := fileSystemProvider.Remove(fileName) + error := fs.Remove(fileName) + if error == nil { + fmt.Printf("Succesfully removed file:%s", fileName) + } return "", error }) +} + +func main() { + app := gofr.NewCMD() + + fileSystemProvider := configureFileServer(app) + + app.AddFileStore(fileSystemProvider) + + registerPwdCommand(app, fileSystemProvider) + + registerLsCommand(app, fileSystemProvider) + + registerGrepCommand(app, fileSystemProvider) + + registerCreateFileCommand(app, fileSystemProvider) + + registerRmCommand(app, fileSystemProvider) app.Run() } diff --git a/examples/using-add-filestore/main_test.go b/examples/using-add-filestore/main_test.go index f5d1d602b..189ac4242 100644 --- a/examples/using-add-filestore/main_test.go +++ b/examples/using-add-filestore/main_test.go @@ -1,11 +1,148 @@ package main import ( + "fmt" + "os" "testing" + "time" "github.com/stretchr/testify/assert" + "go.uber.org/mock/gomock" + "gofr.dev/pkg/gofr" + "gofr.dev/pkg/gofr/datasource/file" + "gofr.dev/pkg/gofr/testutil" ) -func TestIntegration(t *testing.T) { - assert.Equal(t, true, true) +type mockFileInfo struct { + name string +} + +func (m mockFileInfo) Name() string { return m.name } +func (m mockFileInfo) Size() int64 { return 0 } +func (m mockFileInfo) Mode() os.FileMode { return 0 } +func (m mockFileInfo) ModTime() time.Time { return time.Now() } +func (m mockFileInfo) IsDir() bool { return false } +func (m mockFileInfo) Sys() interface{} { return nil } + +func TestPwdCommand(t *testing.T) { + os.Args = []string{"command", "pwd"} + logs := testutil.StdoutOutputForFunc(func() { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + app := gofr.NewCMD() + mock := file.NewMockFileSystemProvider(ctrl) + + mock.EXPECT().UseLogger(app.Logger()) + mock.EXPECT().UseMetrics(app.Metrics()) + mock.EXPECT().Connect() + mock.EXPECT().Getwd().DoAndReturn(func() (string, error) { + return "/", nil + }) + app.AddFileStore(mock) + registerPwdCommand(app, mock) + app.Run() + }) + assert.Contains(t, logs, "/", "Test failed") +} + +func TestLSCommand(t *testing.T) { + path := "/" + os.Args = []string{"command", "ls", fmt.Sprintf("-path=%s", path)} + logs := testutil.StdoutOutputForFunc(func() { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + app := gofr.NewCMD() + mock := file.NewMockFileSystemProvider(ctrl) + + mock.EXPECT().UseLogger(app.Logger()) + mock.EXPECT().UseMetrics(app.Metrics()) + mock.EXPECT().Connect() + mock.EXPECT().ReadDir(path).DoAndReturn(func(s string) ([]file.FileInfo, error) { + var files []file.FileInfo = []file.FileInfo{ + mockFileInfo{name: "file1.txt"}, + mockFileInfo{name: "file2.txt"}, + } + return files, nil + }) + app.AddFileStore(mock) + registerLsCommand(app, mock) + app.Run() + }) + assert.Contains(t, logs, "file1.txt", "Test failed") + assert.Contains(t, logs, "file2.txt", "Test failed") + assert.NotContains(t, logs, "file3.txt", "Test failed") +} + +func TestGrepCommand(t *testing.T) { + path := "/" + os.Args = []string{"command", "grep", "-keyword=fi", fmt.Sprintf("-path=%s", path)} + logs := testutil.StdoutOutputForFunc(func() { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + app := gofr.NewCMD() + mock := file.NewMockFileSystemProvider(ctrl) + + mock.EXPECT().UseLogger(app.Logger()) + mock.EXPECT().UseMetrics(app.Metrics()) + mock.EXPECT().Connect() + mock.EXPECT().ReadDir("/").DoAndReturn(func(s string) ([]file.FileInfo, error) { + var files []file.FileInfo = []file.FileInfo{ + mockFileInfo{name: "file1.txt"}, + mockFileInfo{name: "file2.txt"}, + } + return files, nil + }) + app.AddFileStore(mock) + registerGrepCommand(app, mock) + app.Run() + }) + assert.Contains(t, logs, "file1.txt", "Test failed") + assert.Contains(t, logs, "file2.txt", "Test failed") + assert.NotContains(t, logs, "file3.txt", "Test failed") +} + +func TestCreateFileCommand(t *testing.T) { + fileName := "file.txt" + os.Args = []string{"command", "createfile", fmt.Sprintf("-filename=%s", fileName)} + logs := testutil.StdoutOutputForFunc(func() { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + app := gofr.NewCMD() + mock := file.NewMockFileSystemProvider(ctrl) + + mock.EXPECT().UseLogger(app.Logger()) + mock.EXPECT().UseMetrics(app.Metrics()) + mock.EXPECT().Connect() + mock.EXPECT().Create(fileName).DoAndReturn(func(s string) (file.File, error) { + return &file.MockFile{}, nil + }) + app.AddFileStore(mock) + registerCreateFileCommand(app, mock) + app.Run() + }) + assert.Contains(t, logs, "Creating file :file.txt", "Test failed") + assert.Contains(t, logs, "Succesfully created file:file.txt", "Test failed") +} + +func TestRmCommand(t *testing.T) { + fileName := "file.txt" + os.Args = []string{"command", "rm", fmt.Sprintf("-filename=%s", fileName)} + logs := testutil.StdoutOutputForFunc(func() { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + app := gofr.NewCMD() + mock := file.NewMockFileSystemProvider(ctrl) + + mock.EXPECT().UseLogger(app.Logger()) + mock.EXPECT().UseMetrics(app.Metrics()) + mock.EXPECT().Connect() + mock.EXPECT().Remove("file.txt").DoAndReturn(func(filename string) error { + return nil + }) + app.AddFileStore(mock) + registerRmCommand(app, mock) + app.Run() + }) + assert.Contains(t, logs, "Removing file :file.txt", "Test failed") + assert.Contains(t, logs, "Succesfully removed file:file.txt", "Test failed") } From 074667740e3b7986fd77cdcf5d53d1314dde94b4 Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Sat, 28 Sep 2024 12:45:42 +0530 Subject: [PATCH 10/17] fixing lint issues --- examples/using-add-filestore/main.go | 47 +++++++++++++---------- examples/using-add-filestore/main_test.go | 35 ++++++++++------- go.mod | 4 ++ go.sum | 9 +++++ 4 files changed, 61 insertions(+), 34 deletions(-) diff --git a/examples/using-add-filestore/main.go b/examples/using-add-filestore/main.go index 49cac3aa4..c7424d22e 100644 --- a/examples/using-add-filestore/main.go +++ b/examples/using-add-filestore/main.go @@ -17,17 +17,17 @@ const ( SFTP ) -// This can be a common function to configure both FTP and SFTP server +// This can be a common function to configure both FTP and SFTP server. func configureFileServer(app *gofr.App) file.FileSystemProvider { port, _ := strconv.Atoi(app.Config.Get("PORT")) - fileSystemProvider := ftp.New(&ftp.Config{ + + return ftp.New(&ftp.Config{ Host: app.Config.Get("HOST"), User: app.Config.Get("USER_NAME"), Password: app.Config.Get("PASSWORD"), Port: port, RemoteDir: app.Config.Get("REMOTE_DIR_PATH"), }) - return fileSystemProvider } func printFiles(files []file.FileInfo, err error) { @@ -53,18 +53,20 @@ func grepFiles(files []file.FileInfo, keyword string, err error) { } func registerPwdCommand(app *gofr.App, fs file.FileSystemProvider) { - app.SubCommand("pwd", func(c *gofr.Context) (interface{}, error) { - workingDirectory, error := fs.Getwd() - return workingDirectory, error + app.SubCommand("pwd", func(_ *gofr.Context) (interface{}, error) { + workingDirectory, err := fs.Getwd() + + return workingDirectory, err }) } func registerLsCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("ls", func(c *gofr.Context) (interface{}, error) { path := c.Param("path") - files, error := fs.ReadDir(path) - printFiles(files, error) - return "", error + files, err := fs.ReadDir(path) + printFiles(files, err) + + return "", err }) } @@ -72,9 +74,10 @@ func registerGrepCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("grep", func(c *gofr.Context) (interface{}, error) { keyword := c.Param("keyword") path := c.Param("path") - files, error := fs.ReadDir(path) - grepFiles(files, keyword, error) - return "", error + files, err := fs.ReadDir(path) + grepFiles(files, keyword, err) + + return "", err }) } @@ -82,11 +85,13 @@ func registerCreateFileCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("createfile", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") fmt.Printf("Creating file :%s", fileName) - _, error := fs.Create(fileName) - if error == nil { - fmt.Printf("Succesfully created file:%s", fileName) + _, err := fs.Create(fileName) + + if err == nil { + fmt.Printf("Successfully created file:%s", fileName) } - return "", error + + return "", err }) } @@ -94,11 +99,13 @@ func registerRmCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("rm", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") fmt.Printf("Removing file :%s", fileName) - error := fs.Remove(fileName) - if error == nil { - fmt.Printf("Succesfully removed file:%s", fileName) + err := fs.Remove(fileName) + + if err == nil { + fmt.Printf("Successfully removed file:%s", fileName) } - return "", error + + return "", err }) } diff --git a/examples/using-add-filestore/main_test.go b/examples/using-add-filestore/main_test.go index 189ac4242..9fa827738 100644 --- a/examples/using-add-filestore/main_test.go +++ b/examples/using-add-filestore/main_test.go @@ -17,18 +17,19 @@ type mockFileInfo struct { name string } -func (m mockFileInfo) Name() string { return m.name } -func (m mockFileInfo) Size() int64 { return 0 } -func (m mockFileInfo) Mode() os.FileMode { return 0 } -func (m mockFileInfo) ModTime() time.Time { return time.Now() } -func (m mockFileInfo) IsDir() bool { return false } -func (m mockFileInfo) Sys() interface{} { return nil } +func (m mockFileInfo) Name() string { return m.name } +func (mockFileInfo) Size() int64 { return 0 } +func (mockFileInfo) Mode() os.FileMode { return 0 } +func (mockFileInfo) ModTime() time.Time { return time.Now() } +func (mockFileInfo) IsDir() bool { return false } +func (mockFileInfo) Sys() interface{} { return nil } func TestPwdCommand(t *testing.T) { os.Args = []string{"command", "pwd"} logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() + app := gofr.NewCMD() mock := file.NewMockFileSystemProvider(ctrl) @@ -51,17 +52,19 @@ func TestLSCommand(t *testing.T) { logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() + app := gofr.NewCMD() mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) mock.EXPECT().UseMetrics(app.Metrics()) mock.EXPECT().Connect() - mock.EXPECT().ReadDir(path).DoAndReturn(func(s string) ([]file.FileInfo, error) { - var files []file.FileInfo = []file.FileInfo{ + mock.EXPECT().ReadDir(path).DoAndReturn(func(_ string) ([]file.FileInfo, error) { + files := []file.FileInfo{ mockFileInfo{name: "file1.txt"}, mockFileInfo{name: "file2.txt"}, } + return files, nil }) app.AddFileStore(mock) @@ -79,17 +82,19 @@ func TestGrepCommand(t *testing.T) { logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() + app := gofr.NewCMD() mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) mock.EXPECT().UseMetrics(app.Metrics()) mock.EXPECT().Connect() - mock.EXPECT().ReadDir("/").DoAndReturn(func(s string) ([]file.FileInfo, error) { - var files []file.FileInfo = []file.FileInfo{ + mock.EXPECT().ReadDir("/").DoAndReturn(func(_ string) ([]file.FileInfo, error) { + files := []file.FileInfo{ mockFileInfo{name: "file1.txt"}, mockFileInfo{name: "file2.txt"}, } + return files, nil }) app.AddFileStore(mock) @@ -107,13 +112,14 @@ func TestCreateFileCommand(t *testing.T) { logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() + app := gofr.NewCMD() mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) mock.EXPECT().UseMetrics(app.Metrics()) mock.EXPECT().Connect() - mock.EXPECT().Create(fileName).DoAndReturn(func(s string) (file.File, error) { + mock.EXPECT().Create(fileName).DoAndReturn(func(_ string) (file.File, error) { return &file.MockFile{}, nil }) app.AddFileStore(mock) @@ -121,7 +127,7 @@ func TestCreateFileCommand(t *testing.T) { app.Run() }) assert.Contains(t, logs, "Creating file :file.txt", "Test failed") - assert.Contains(t, logs, "Succesfully created file:file.txt", "Test failed") + assert.Contains(t, logs, "Successfully created file:file.txt", "Test failed") } func TestRmCommand(t *testing.T) { @@ -130,13 +136,14 @@ func TestRmCommand(t *testing.T) { logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() + app := gofr.NewCMD() mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) mock.EXPECT().UseMetrics(app.Metrics()) mock.EXPECT().Connect() - mock.EXPECT().Remove("file.txt").DoAndReturn(func(filename string) error { + mock.EXPECT().Remove("file.txt").DoAndReturn(func(_ string) error { return nil }) app.AddFileStore(mock) @@ -144,5 +151,5 @@ func TestRmCommand(t *testing.T) { app.Run() }) assert.Contains(t, logs, "Removing file :file.txt", "Test failed") - assert.Contains(t, logs, "Succesfully removed file:file.txt", "Test failed") + assert.Contains(t, logs, "Successfully removed file:file.txt", "Test failed") } diff --git a/go.mod b/go.mod index a72222387..6c86f9e96 100644 --- a/go.mod +++ b/go.mod @@ -68,7 +68,10 @@ require ( github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect github.com/googleapis/gax-go/v2 v2.13.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/jlaffaye/ftp v0.2.0 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect @@ -88,6 +91,7 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect + gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd // indirect golang.org/x/crypto v0.27.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/sys v0.26.0 // indirect diff --git a/go.sum b/go.sum index e22cf2652..54e6df91e 100644 --- a/go.sum +++ b/go.sum @@ -120,8 +120,15 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDa github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/jlaffaye/ftp v0.2.0 h1:lXNvW7cBu7R/68bknOX3MrRIIqZ61zELs1P2RAiA3lg= +github.com/jlaffaye/ftp v0.2.0/go.mod h1:is2Ds5qkhceAPy2xD6RLI6hmp/qysSoymZ+Z2uTnspI= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -252,6 +259,8 @@ go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd h1:YTiTFoRmx/TK+uzmSVAP7ZPodeZaDauLmhD2ov+lgFE= +gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd/go.mod h1:Pau/kQnk86g7U3Nwuc5/g05PaPFxfn4VFXmOa8Z4xrM= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= From 50258a76f806ad45c3fe901687de635e41d9bea9 Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Sat, 5 Oct 2024 02:20:29 +0530 Subject: [PATCH 11/17] using logger to display logs in CMD --- examples/using-add-filestore/README.md | 18 +++++------------- examples/using-add-filestore/configs/.env | 8 ++++---- examples/using-add-filestore/main.go | 13 +++++++++---- examples/using-add-filestore/main_test.go | 11 +++++++---- go.mod | 11 +++++++---- 5 files changed, 32 insertions(+), 29 deletions(-) diff --git a/examples/using-add-filestore/README.md b/examples/using-add-filestore/README.md index 38d442aec..22506cdf2 100644 --- a/examples/using-add-filestore/README.md +++ b/examples/using-add-filestore/README.md @@ -10,34 +10,26 @@ Choose a library listed above and follow their respective documentation to confi ### To run the example use the commands below: To print the current working directory of the configured remote file server -``` +```console go run main.go pwd ``` To get the list of all directories or files in the given path of the configured remote file server ``` -go run main.go ls -path= - -Eg:- go run main.go ls -path=/ + go run main.go ls -path=/ ``` To grep the list of all files and directories in the given path that is matching with the keyword provided ``` -go run main.go grep -keyword=fi -path= - -Eg:- go run main.go grep -keyword=fi -path=/ +go run main.go grep -keyword=fi -path=/ ``` To create a file in the current working directory with the provided filename ``` -go run main.go createfile -filename= - -Eg:- go run main.go createfile -filename=file.txt + go run main.go createfile -filename=file.txt ``` To remove the file with the provided filename from the current working directory ``` -go run main.go rm -filename= - -Eg:- go run main.go rm -filename=file.txt + go run main.go rm -filename=file.txt ``` \ No newline at end of file diff --git a/examples/using-add-filestore/configs/.env b/examples/using-add-filestore/configs/.env index 01833ea49..3a56b6e80 100644 --- a/examples/using-add-filestore/configs/.env +++ b/examples/using-add-filestore/configs/.env @@ -1,5 +1,5 @@ -HOST="localhost" -USER_NAME="anonymous" -PASSWORD="test" +HOST=localhost +USER_NAME=anonymous +PASSWORD=test PORT=21 -REMOTE_DIR_PATH="/" \ No newline at end of file +REMOTE_DIR_PATH=/ \ No newline at end of file diff --git a/examples/using-add-filestore/main.go b/examples/using-add-filestore/main.go index c7424d22e..e1fdabc59 100644 --- a/examples/using-add-filestore/main.go +++ b/examples/using-add-filestore/main.go @@ -8,10 +8,13 @@ import ( "gofr.dev/pkg/gofr" "gofr.dev/pkg/gofr/datasource/file" "gofr.dev/pkg/gofr/datasource/file/ftp" + "gofr.dev/pkg/gofr/logging" ) type FileServerType int +var logger logging.Logger + const ( FTP FileServerType = iota SFTP @@ -84,11 +87,11 @@ func registerGrepCommand(app *gofr.App, fs file.FileSystemProvider) { func registerCreateFileCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("createfile", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") - fmt.Printf("Creating file :%s", fileName) + logger.Log("Creating file : ", fileName) _, err := fs.Create(fileName) if err == nil { - fmt.Printf("Successfully created file:%s", fileName) + logger.Log("Successfully created file: ", fileName) } return "", err @@ -98,11 +101,11 @@ func registerCreateFileCommand(app *gofr.App, fs file.FileSystemProvider) { func registerRmCommand(app *gofr.App, fs file.FileSystemProvider) { app.SubCommand("rm", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") - fmt.Printf("Removing file :%s", fileName) + logger.Log("Removing file : ", fileName) err := fs.Remove(fileName) if err == nil { - fmt.Printf("Successfully removed file:%s", fileName) + logger.Log("Successfully removed file: ", fileName) } return "", err @@ -112,6 +115,8 @@ func registerRmCommand(app *gofr.App, fs file.FileSystemProvider) { func main() { app := gofr.NewCMD() + logger = gofr.New().Logger() + fileSystemProvider := configureFileServer(app) app.AddFileStore(fileSystemProvider) diff --git a/examples/using-add-filestore/main_test.go b/examples/using-add-filestore/main_test.go index 9fa827738..763163699 100644 --- a/examples/using-add-filestore/main_test.go +++ b/examples/using-add-filestore/main_test.go @@ -31,6 +31,7 @@ func TestPwdCommand(t *testing.T) { defer ctrl.Finish() app := gofr.NewCMD() + logger = gofr.New().Logger() mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -114,6 +115,7 @@ func TestCreateFileCommand(t *testing.T) { defer ctrl.Finish() app := gofr.NewCMD() + logger = gofr.New().Logger() mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -126,8 +128,8 @@ func TestCreateFileCommand(t *testing.T) { registerCreateFileCommand(app, mock) app.Run() }) - assert.Contains(t, logs, "Creating file :file.txt", "Test failed") - assert.Contains(t, logs, "Successfully created file:file.txt", "Test failed") + assert.Contains(t, logs, "Creating file : \",\"file.txt\"", "Test failed") + assert.Contains(t, logs, "Successfully created file: \",\"file.txt\"", "Test failed") } func TestRmCommand(t *testing.T) { @@ -138,6 +140,7 @@ func TestRmCommand(t *testing.T) { defer ctrl.Finish() app := gofr.NewCMD() + logger = gofr.New().Logger() mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -150,6 +153,6 @@ func TestRmCommand(t *testing.T) { registerRmCommand(app, mock) app.Run() }) - assert.Contains(t, logs, "Removing file :file.txt", "Test failed") - assert.Contains(t, logs, "Successfully removed file:file.txt", "Test failed") + assert.Contains(t, logs, "Removing file : \",\"file.txt\"", "Test failed") + assert.Contains(t, logs, "Successfully removed file: \",\"file.txt\"", "Test failed") } diff --git a/go.mod b/go.mod index 6c86f9e96..438ba3e3e 100644 --- a/go.mod +++ b/go.mod @@ -45,6 +45,12 @@ require ( modernc.org/sqlite v1.33.1 ) +require ( + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/jlaffaye/ftp v0.2.0 // indirect +) + require ( cloud.google.com/go v0.115.1 // indirect cloud.google.com/go/auth v0.9.5 // indirect @@ -68,10 +74,7 @@ require ( github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect github.com/googleapis/gax-go/v2 v2.13.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect - github.com/jlaffaye/ftp v0.2.0 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect @@ -91,7 +94,7 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect - gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd // indirect + gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd golang.org/x/crypto v0.27.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/sys v0.26.0 // indirect From 5daf5e1fb289cbccf37198bf8b04c75823deb7bd Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Sun, 6 Oct 2024 00:19:37 +0530 Subject: [PATCH 12/17] initializing new module for files-interaction example --- examples/using-add-filestore/go.mod | 104 +++++++ examples/using-add-filestore/go.sum | 423 ++++++++++++++++++++++++++++ go.mod | 7 - 3 files changed, 527 insertions(+), 7 deletions(-) create mode 100644 examples/using-add-filestore/go.mod create mode 100644 examples/using-add-filestore/go.sum diff --git a/examples/using-add-filestore/go.mod b/examples/using-add-filestore/go.mod new file mode 100644 index 000000000..9bf2a37e8 --- /dev/null +++ b/examples/using-add-filestore/go.mod @@ -0,0 +1,104 @@ +module gofr.dev/examples/using-add-filestore + +go 1.22 + +require gofr.dev v1.22.1 + +require ( + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/jlaffaye/ftp v0.2.0 // indirect +) + +require ( + cloud.google.com/go v0.115.1 // indirect + cloud.google.com/go/auth v0.9.5 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect + cloud.google.com/go/compute/metadata v0.5.2 // indirect + cloud.google.com/go/iam v1.2.0 // indirect + cloud.google.com/go/pubsub v1.42.0 // indirect + filippo.io/edwards25519 v1.1.0 // indirect + github.com/DATA-DOG/go-sqlmock v1.5.2 // indirect + github.com/XSAM/otelsql v0.34.0 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/eclipse/paho.mqtt.golang v1.5.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-sql-driver/mysql v1.8.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/google/s2a-go v0.1.8 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect + github.com/googleapis/gax-go/v2 v2.13.0 // indirect + github.com/gorilla/mux v1.8.1 // indirect + github.com/gorilla/websocket v1.5.3 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/joho/godotenv v1.5.1 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/ncruces/go-strftime v0.1.9 // indirect + github.com/openzipkin/zipkin-go v0.4.3 // indirect + github.com/pierrec/lz4/v4 v4.1.21 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.20.4 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.59.1 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 // indirect + github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 // indirect + github.com/redis/go-redis/v9 v9.6.1 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + github.com/segmentio/kafka-go v0.4.47 // indirect + github.com/stretchr/testify v1.9.0 + go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.55.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/exporters/zipkin v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect + go.uber.org/mock v0.4.0 + gofr.dev/pkg/gofr/datasource/file/ftp v0.1.0 + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/oauth2 v0.23.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/text v0.18.0 // indirect + golang.org/x/time v0.6.0 // indirect + google.golang.org/api v0.199.0 // indirect + google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/grpc v1.67.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect + modernc.org/libc v1.55.3 // indirect + modernc.org/mathutil v1.6.0 // indirect + modernc.org/memory v1.8.0 // indirect + modernc.org/sqlite v1.33.1 // indirect + modernc.org/strutil v1.2.0 // indirect + modernc.org/token v1.1.0 // indirect +) diff --git a/examples/using-add-filestore/go.sum b/examples/using-add-filestore/go.sum new file mode 100644 index 000000000..11b60c22d --- /dev/null +++ b/examples/using-add-filestore/go.sum @@ -0,0 +1,423 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.115.1 h1:Jo0SM9cQnSkYfp44+v+NQXHpcHqlnRJk2qxh6yvxxxQ= +cloud.google.com/go v0.115.1/go.mod h1:DuujITeaufu3gL68/lOFIirVNJwQeyf5UXyi+Wbgknc= +cloud.google.com/go/auth v0.9.5 h1:4CTn43Eynw40aFVr3GpPqsQponx2jv0BQpjvajsbbzw= +cloud.google.com/go/auth v0.9.5/go.mod h1:Xo0n7n66eHyOWWCnitop6870Ilwo3PiZyodVkkH1xWM= +cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= +cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= +cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo= +cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= +cloud.google.com/go/iam v1.2.0 h1:kZKMKVNk/IsSSc/udOb83K0hL/Yh/Gcqpz+oAkoIFN8= +cloud.google.com/go/iam v1.2.0/go.mod h1:zITGuWgsLZxd8OwAlX+eMFgZDXzBm7icj1PVTYG766Q= +cloud.google.com/go/kms v1.19.0 h1:x0OVJDl6UH1BSX4THKlMfdcFWoE4ruh90ZHuilZekrU= +cloud.google.com/go/kms v1.19.0/go.mod h1:e4imokuPJUc17Trz2s6lEXFDt8bgDmvpVynH39bdrHM= +cloud.google.com/go/longrunning v0.6.0 h1:mM1ZmaNsQsnb+5n1DNPeL0KwQd9jQRqSqSDEkBZr+aI= +cloud.google.com/go/longrunning v0.6.0/go.mod h1:uHzSZqW89h7/pasCWNYdUpwGz3PcVWhrWupreVPYLts= +cloud.google.com/go/pubsub v1.42.0 h1:PVTbzorLryFL5ue8esTS2BfehUs0ahyNOY9qcd+HMOs= +cloud.google.com/go/pubsub v1.42.0/go.mod h1:KADJ6s4MbTwhXmse/50SebEhE4SmUwHi48z3/dHar1Y= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU= +github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= +github.com/XSAM/otelsql v0.34.0 h1:YdCRKy17Xn0MH717LEwqpVL/a+4nexmSCBrgoycYY6E= +github.com/XSAM/otelsql v0.34.0/go.mod h1:xaE+ybu+kJOYvtDyThbe0VoKWngvKHmNlrM1rOn8f94= +github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= +github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= +github.com/alicebob/miniredis/v2 v2.33.0 h1:uvTF0EDeu9RLnUEG27Db5I68ESoIxTiXbNUiji6lZrA= +github.com/alicebob/miniredis/v2 v2.33.0/go.mod h1:MhP4a3EU7aENRi9aO+tHfTBZicLqQevyi/DJpoj6mi0= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bsm/ginkgo/v2 v2.7.0/go.mod h1:AiKlXPm7ItEHNc/2+OkrNG4E0ITzojb9/xWzvQ9XZ9w= +github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= +github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= +github.com/bsm/gomega v1.26.0/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= +github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/eclipse/paho.mqtt.golang v1.5.0 h1:EH+bUVJNgttidWFkLLVKaQPGmkTUfQQqjOsyvMGvD6o= +github.com/eclipse/paho.mqtt.golang v1.5.0/go.mod h1:du/2qNQVqJf/Sqs4MEL77kR8QTqANF7XU7Fk0aOTAgk= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= +github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd h1:gbpYu9NMq8jhDVbvlGkMFWCjLFlqqEZjEmObmhUy6Vo= +github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= +github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= +github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= +github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= +github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/jlaffaye/ftp v0.2.0 h1:lXNvW7cBu7R/68bknOX3MrRIIqZ61zELs1P2RAiA3lg= +github.com/jlaffaye/ftp v0.2.0/go.mod h1:is2Ds5qkhceAPy2xD6RLI6hmp/qysSoymZ+Z2uTnspI= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kisielk/sqlstruct v0.0.0-20201105191214-5f3e10d3ab46/go.mod h1:yyMNCyc/Ib3bDTKd379tNMpB/7/H5TjM2Y9QJ5THLbE= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= +github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7sjsSdg= +github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= +github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= +github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 h1:EaDatTxkdHG+U3Bk4EUr+DZ7fOGwTfezUiUJMaIcaho= +github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5/go.mod h1:fyalQWdtzDBECAQFBJuQe5bzQ02jGd5Qcbgb97Flm7U= +github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 h1:EfpWLLCyXw8PSM2/XNJLjI3Pb27yVE+gIAfeqp8LUCc= +github.com/redis/go-redis/extra/redisotel/v9 v9.0.5/go.mod h1:WZjPDy7VNzn77AAfnAfVjZNvfJTYfPetfZk5yoSTLaQ= +github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= +github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4= +github.com/redis/go-redis/v9 v9.6.1/go.mod h1:0C0c6ycQsdpVNQpxb1njEQIqkx5UcsM8FJCQLgE9+RA= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/segmentio/kafka-go v0.4.47 h1:IqziR4pA3vrZq7YdRxaT3w1/5fvIH5qpCwstUanQQB0= +github.com/segmentio/kafka-go v0.4.47/go.mod h1:HjF6XbOKh0Pjlkr5GVZxt6CsjjwnmhVOfURM5KMd8qg= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= +github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= +go.einride.tech/aip v0.67.1 h1:d/4TW92OxXBngkSOwWS2CH5rez869KpKMaN44mdxkFI= +go.einride.tech/aip v0.67.1/go.mod h1:ZGX4/zKw8dcgzdLsrvpOOGxfxI2QSk12SlP7d6c0/XI= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.55.0 h1:sqmsIQ75l6lfZjjpnXXT9DFVtYEDg6CH0/Cn4/3A1Wg= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.55.0/go.mod h1:rsg1EO8LXSs2po50PB5CeY/MSVlhghuKBgXlKnqm6ks= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 h1:ZIg3ZT/aQ7AfKqdwp7ECpOK6vHqquXXuyTjIO8ZdmPs= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0/go.mod h1:DQAwmETtZV00skUwgD6+0U89g80NKsJE3DCKeLLPQMI= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 h1:lsInsfvhVIfOI6qHVyysXMNDnjO9Npvl7tlDPJFBVd4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0/go.mod h1:KQsVNh4OjgjTG0G6EiNi1jVpnaeeKsKMRwbLN+f1+8M= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 h1:m0yTiGDLUvVYaTFbAvCkVYIYcvwKt3G7OLoN77NUs/8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0/go.mod h1:wBQbT4UekBfegL2nx0Xk1vBcnzyBPsIVm9hRG4fYcr4= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= +go.opentelemetry.io/otel/exporters/prometheus v0.52.0/go.mod h1:+wsAp2+JhuGXX7YRkjlkx6hyWY3ogFPfNA4x3nyiAh0= +go.opentelemetry.io/otel/exporters/zipkin v1.30.0 h1:1uYaSfxiCLdJATlGEtYjQe4jZYfqCjVwxeSTMXe8VF4= +go.opentelemetry.io/otel/exporters/zipkin v1.30.0/go.mod h1:r/4BhMc3kiKxD61wGh9J3NVQ3/cZ45F2NHkQgVnql48= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= +go.opentelemetry.io/otel/sdk/metric v1.30.0 h1:QJLT8Pe11jyHBHfSAgYH7kEmT24eX792jZO1bo4BXkM= +go.opentelemetry.io/otel/sdk/metric v1.30.0/go.mod h1:waS6P3YqFNzeP01kuo/MBBYqaoBJl7efRQHOaydhy1Y= +go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= +go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +gofr.dev v1.22.1 h1:WLD9pdVkWeDMdRdggmZtq//t41RIN/6XGr++IXlN3jM= +gofr.dev v1.22.1/go.mod h1:jldZJGrUKxD6BUEFwdlODcBCGBSvgkVoMy9q15sJm2Q= +gofr.dev/pkg/gofr/datasource/file/ftp v0.1.0 h1:543791JYpNfB2Q76Ey9N5CQW5bIo6dlhVwvMdb+6Oow= +gofr.dev/pkg/gofr/datasource/file/ftp v0.1.0/go.mod h1:Pau/kQnk86g7U3Nwuc5/g05PaPFxfn4VFXmOa8Z4xrM= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.199.0 h1:aWUXClp+VFJmqE0JPvpZOK3LDQMyFKYIow4etYd9qxs= +google.golang.org/api v0.199.0/go.mod h1:ohG4qSztDJmZdjK/Ar6MhbAmb/Rpi4JHOqagsh90K28= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 h1:BulPr26Jqjnd4eYDVe+YvyR7Yc2vJGkO5/0UxD0/jZU= +google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:hL97c3SYopEHblzpxRL4lSs523++l8DYxGM1FQiYmb4= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw= +google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +modernc.org/cc/v4 v4.21.4 h1:3Be/Rdo1fpr8GrQ7IVw9OHtplU4gWbb+wNgeoBMmGLQ= +modernc.org/cc/v4 v4.21.4/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= +modernc.org/ccgo/v4 v4.19.2 h1:lwQZgvboKD0jBwdaeVCTouxhxAyN6iawF3STraAal8Y= +modernc.org/ccgo/v4 v4.19.2/go.mod h1:ysS3mxiMV38XGRTTcgo0DQTeTmAO4oCmJl1nX9VFI3s= +modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= +modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= +modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw= +modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= +modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 h1:5D53IMaUuA5InSeMu9eJtlQXS2NxAhyWQvkKEgXZhHI= +modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= +modernc.org/libc v1.55.3 h1:AzcW1mhlPNrRtjS5sS+eW2ISCgSOLLNyFzRh/V3Qj/U= +modernc.org/libc v1.55.3/go.mod h1:qFXepLhz+JjFThQ4kzwzOjA/y/artDeg+pcYnY+Q83w= +modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= +modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= +modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= +modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= +modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= +modernc.org/sqlite v1.33.1 h1:trb6Z3YYoeM9eDL1O8do81kP+0ejv+YzgyFo+Gwy0nM= +modernc.org/sqlite v1.33.1/go.mod h1:pXV2xHxhzXZsgT/RtTFAPY6JJDEvOTcTdwADQCCWD4k= +modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= +modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= +modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= +modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= diff --git a/go.mod b/go.mod index 438ba3e3e..a72222387 100644 --- a/go.mod +++ b/go.mod @@ -45,12 +45,6 @@ require ( modernc.org/sqlite v1.33.1 ) -require ( - github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/jlaffaye/ftp v0.2.0 // indirect -) - require ( cloud.google.com/go v0.115.1 // indirect cloud.google.com/go/auth v0.9.5 // indirect @@ -94,7 +88,6 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect - gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd golang.org/x/crypto v0.27.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/sys v0.26.0 // indirect From 9b6eac85393d5bf515c592f57d4e4fff2a7322bc Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Sun, 6 Oct 2024 00:20:29 +0530 Subject: [PATCH 13/17] reverting go.sum --- go.sum | 9 --------- 1 file changed, 9 deletions(-) diff --git a/go.sum b/go.sum index 54e6df91e..e22cf2652 100644 --- a/go.sum +++ b/go.sum @@ -120,15 +120,8 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDa github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= -github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/jlaffaye/ftp v0.2.0 h1:lXNvW7cBu7R/68bknOX3MrRIIqZ61zELs1P2RAiA3lg= -github.com/jlaffaye/ftp v0.2.0/go.mod h1:is2Ds5qkhceAPy2xD6RLI6hmp/qysSoymZ+Z2uTnspI= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -259,8 +252,6 @@ go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd h1:YTiTFoRmx/TK+uzmSVAP7ZPodeZaDauLmhD2ov+lgFE= -gofr.dev/pkg/gofr/datasource/file/ftp v0.0.0-20240823110359-085d180867dd/go.mod h1:Pau/kQnk86g7U3Nwuc5/g05PaPFxfn4VFXmOa8Z4xrM= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= From 6a0511d79b2f29c85a682894dc7f7dd56fd3fe62 Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Thu, 10 Oct 2024 00:30:36 +0530 Subject: [PATCH 14/17] injecting logger into function and refactoring test --- examples/using-add-filestore/main.go | 12 +++---- examples/using-add-filestore/main_test.go | 41 ++++++++++++++++++++--- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/examples/using-add-filestore/main.go b/examples/using-add-filestore/main.go index e1fdabc59..a1ffa1068 100644 --- a/examples/using-add-filestore/main.go +++ b/examples/using-add-filestore/main.go @@ -13,8 +13,6 @@ import ( type FileServerType int -var logger logging.Logger - const ( FTP FileServerType = iota SFTP @@ -84,7 +82,7 @@ func registerGrepCommand(app *gofr.App, fs file.FileSystemProvider) { }) } -func registerCreateFileCommand(app *gofr.App, fs file.FileSystemProvider) { +func registerCreateFileCommand(app *gofr.App, fs file.FileSystemProvider, logger logging.Logger) { app.SubCommand("createfile", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") logger.Log("Creating file : ", fileName) @@ -98,7 +96,7 @@ func registerCreateFileCommand(app *gofr.App, fs file.FileSystemProvider) { }) } -func registerRmCommand(app *gofr.App, fs file.FileSystemProvider) { +func registerRmCommand(app *gofr.App, fs file.FileSystemProvider, logger logging.Logger) { app.SubCommand("rm", func(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") logger.Log("Removing file : ", fileName) @@ -115,7 +113,7 @@ func registerRmCommand(app *gofr.App, fs file.FileSystemProvider) { func main() { app := gofr.NewCMD() - logger = gofr.New().Logger() + logger := gofr.New().Logger() fileSystemProvider := configureFileServer(app) @@ -127,9 +125,9 @@ func main() { registerGrepCommand(app, fileSystemProvider) - registerCreateFileCommand(app, fileSystemProvider) + registerCreateFileCommand(app, fileSystemProvider, logger) - registerRmCommand(app, fileSystemProvider) + registerRmCommand(app, fileSystemProvider, logger) app.Run() } diff --git a/examples/using-add-filestore/main_test.go b/examples/using-add-filestore/main_test.go index 763163699..51dd88a11 100644 --- a/examples/using-add-filestore/main_test.go +++ b/examples/using-add-filestore/main_test.go @@ -26,12 +26,13 @@ func (mockFileInfo) Sys() interface{} { return nil } func TestPwdCommand(t *testing.T) { os.Args = []string{"command", "pwd"} + logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() app := gofr.NewCMD() - logger = gofr.New().Logger() + mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -40,21 +41,27 @@ func TestPwdCommand(t *testing.T) { mock.EXPECT().Getwd().DoAndReturn(func() (string, error) { return "/", nil }) + app.AddFileStore(mock) + registerPwdCommand(app, mock) + app.Run() }) + assert.Contains(t, logs, "/", "Test failed") } func TestLSCommand(t *testing.T) { path := "/" os.Args = []string{"command", "ls", fmt.Sprintf("-path=%s", path)} + logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() app := gofr.NewCMD() + mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -68,10 +75,14 @@ func TestLSCommand(t *testing.T) { return files, nil }) + app.AddFileStore(mock) + registerLsCommand(app, mock) + app.Run() }) + assert.Contains(t, logs, "file1.txt", "Test failed") assert.Contains(t, logs, "file2.txt", "Test failed") assert.NotContains(t, logs, "file3.txt", "Test failed") @@ -80,11 +91,13 @@ func TestLSCommand(t *testing.T) { func TestGrepCommand(t *testing.T) { path := "/" os.Args = []string{"command", "grep", "-keyword=fi", fmt.Sprintf("-path=%s", path)} + logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() app := gofr.NewCMD() + mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -98,10 +111,14 @@ func TestGrepCommand(t *testing.T) { return files, nil }) + app.AddFileStore(mock) + registerGrepCommand(app, mock) + app.Run() }) + assert.Contains(t, logs, "file1.txt", "Test failed") assert.Contains(t, logs, "file2.txt", "Test failed") assert.NotContains(t, logs, "file3.txt", "Test failed") @@ -110,12 +127,15 @@ func TestGrepCommand(t *testing.T) { func TestCreateFileCommand(t *testing.T) { fileName := "file.txt" os.Args = []string{"command", "createfile", fmt.Sprintf("-filename=%s", fileName)} + logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() app := gofr.NewCMD() - logger = gofr.New().Logger() + + logger := gofr.New().Logger() + mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -124,10 +144,14 @@ func TestCreateFileCommand(t *testing.T) { mock.EXPECT().Create(fileName).DoAndReturn(func(_ string) (file.File, error) { return &file.MockFile{}, nil }) + app.AddFileStore(mock) - registerCreateFileCommand(app, mock) + + registerCreateFileCommand(app, mock, logger) + app.Run() }) + assert.Contains(t, logs, "Creating file : \",\"file.txt\"", "Test failed") assert.Contains(t, logs, "Successfully created file: \",\"file.txt\"", "Test failed") } @@ -135,12 +159,15 @@ func TestCreateFileCommand(t *testing.T) { func TestRmCommand(t *testing.T) { fileName := "file.txt" os.Args = []string{"command", "rm", fmt.Sprintf("-filename=%s", fileName)} + logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() app := gofr.NewCMD() - logger = gofr.New().Logger() + + logger := gofr.New().Logger() + mock := file.NewMockFileSystemProvider(ctrl) mock.EXPECT().UseLogger(app.Logger()) @@ -149,10 +176,14 @@ func TestRmCommand(t *testing.T) { mock.EXPECT().Remove("file.txt").DoAndReturn(func(_ string) error { return nil }) + app.AddFileStore(mock) - registerRmCommand(app, mock) + + registerRmCommand(app, mock, logger) + app.Run() }) + assert.Contains(t, logs, "Removing file : \",\"file.txt\"", "Test failed") assert.Contains(t, logs, "Successfully removed file: \",\"file.txt\"", "Test failed") } From 44d96e8ed5058caf88e01ce3a16304fa53091c4e Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Mon, 28 Oct 2024 13:50:55 +0530 Subject: [PATCH 15/17] files interaction refactor --- examples/using-add-filestore/main.go | 150 ++++++++++------------ examples/using-add-filestore/main_test.go | 130 +++++++------------ 2 files changed, 111 insertions(+), 169 deletions(-) diff --git a/examples/using-add-filestore/main.go b/examples/using-add-filestore/main.go index a1ffa1068..44ad2fc11 100644 --- a/examples/using-add-filestore/main.go +++ b/examples/using-add-filestore/main.go @@ -8,7 +8,6 @@ import ( "gofr.dev/pkg/gofr" "gofr.dev/pkg/gofr/datasource/file" "gofr.dev/pkg/gofr/datasource/file/ftp" - "gofr.dev/pkg/gofr/logging" ) type FileServerType int @@ -18,116 +17,99 @@ const ( SFTP ) -// This can be a common function to configure both FTP and SFTP server. -func configureFileServer(app *gofr.App) file.FileSystemProvider { - port, _ := strconv.Atoi(app.Config.Get("PORT")) +func main() { + app := gofr.NewCMD() - return ftp.New(&ftp.Config{ - Host: app.Config.Get("HOST"), - User: app.Config.Get("USER_NAME"), - Password: app.Config.Get("PASSWORD"), - Port: port, - RemoteDir: app.Config.Get("REMOTE_DIR_PATH"), - }) + fileSystemProvider := configureFileServer(app) + + app.AddFileStore(fileSystemProvider) + + app.SubCommand("pwd", pwdCommandHandler) + app.SubCommand("ls", lsCommandHandler) + app.SubCommand("grep", grepCommandHandler) + app.SubCommand("createfile", createFileCommandHandler) + app.SubCommand("rm", rmCommandHandler) + + app.Run() +} + +func pwdCommandHandler(c *gofr.Context) (interface{}, error) { + workingDirectory, err := c.File.Getwd() + + return workingDirectory, err } -func printFiles(files []file.FileInfo, err error) { +func lsCommandHandler(c *gofr.Context) (interface{}, error) { + path := c.Param("path") + files, err := c.File.ReadDir(path) if err != nil { fmt.Println(err) } else { - for _, f := range files { - fmt.Println(f.Name()) - } + printFiles(files) } + + return "", err } -func grepFiles(files []file.FileInfo, keyword string, err error) { +func grepCommandHandler(c *gofr.Context) (interface{}, error) { + keyword := c.Param("keyword") + path := c.Param("path") + files, err := c.File.ReadDir(path) if err != nil { fmt.Println(err) } else { - for _, f := range files { - if strings.HasPrefix(f.Name(), keyword) { - fmt.Println(f.Name()) - } - } - } -} + grepFiles(files, keyword) -func registerPwdCommand(app *gofr.App, fs file.FileSystemProvider) { - app.SubCommand("pwd", func(_ *gofr.Context) (interface{}, error) { - workingDirectory, err := fs.Getwd() + } - return workingDirectory, err - }) + return "", err } -func registerLsCommand(app *gofr.App, fs file.FileSystemProvider) { - app.SubCommand("ls", func(c *gofr.Context) (interface{}, error) { - path := c.Param("path") - files, err := fs.ReadDir(path) - printFiles(files, err) +func createFileCommandHandler(c *gofr.Context) (interface{}, error) { + fileName := c.Param("filename") + _, err := c.File.Create(fileName) - return "", err - }) -} - -func registerGrepCommand(app *gofr.App, fs file.FileSystemProvider) { - app.SubCommand("grep", func(c *gofr.Context) (interface{}, error) { - keyword := c.Param("keyword") - path := c.Param("path") - files, err := fs.ReadDir(path) - grepFiles(files, keyword, err) + if err == nil { + return fmt.Sprintln("Successfully created file:", fileName), nil + } - return "", err - }) + return fmt.Sprintln("File Creation error"), err } -func registerCreateFileCommand(app *gofr.App, fs file.FileSystemProvider, logger logging.Logger) { - app.SubCommand("createfile", func(c *gofr.Context) (interface{}, error) { - fileName := c.Param("filename") - logger.Log("Creating file : ", fileName) - _, err := fs.Create(fileName) +func rmCommandHandler(c *gofr.Context) (interface{}, error) { + fileName := c.Param("filename") + err := c.File.Remove(fileName) - if err == nil { - logger.Log("Successfully created file: ", fileName) - } + if err == nil { + return fmt.Sprintln("Successfully removed file:", fileName), nil + } - return "", err - }) + return fmt.Sprintln("File removal error"), err } -func registerRmCommand(app *gofr.App, fs file.FileSystemProvider, logger logging.Logger) { - app.SubCommand("rm", func(c *gofr.Context) (interface{}, error) { - fileName := c.Param("filename") - logger.Log("Removing file : ", fileName) - err := fs.Remove(fileName) - - if err == nil { - logger.Log("Successfully removed file: ", fileName) - } +// This can be a common function to configure both FTP and SFTP server. +func configureFileServer(app *gofr.App) file.FileSystemProvider { + port, _ := strconv.Atoi(app.Config.Get("PORT")) - return "", err + return ftp.New(&ftp.Config{ + Host: app.Config.Get("HOST"), + User: app.Config.Get("USER_NAME"), + Password: app.Config.Get("PASSWORD"), + Port: port, + RemoteDir: app.Config.Get("REMOTE_DIR_PATH"), }) } -func main() { - app := gofr.NewCMD() - - logger := gofr.New().Logger() - - fileSystemProvider := configureFileServer(app) - - app.AddFileStore(fileSystemProvider) - - registerPwdCommand(app, fileSystemProvider) - - registerLsCommand(app, fileSystemProvider) - - registerGrepCommand(app, fileSystemProvider) - - registerCreateFileCommand(app, fileSystemProvider, logger) - - registerRmCommand(app, fileSystemProvider, logger) +func printFiles(files []file.FileInfo) { + for _, f := range files { + fmt.Println(f.Name()) + } +} - app.Run() +func grepFiles(files []file.FileInfo, keyword string) { + for _, f := range files { + if strings.HasPrefix(f.Name(), keyword) { + fmt.Println(f.Name()) + } + } } diff --git a/examples/using-add-filestore/main_test.go b/examples/using-add-filestore/main_test.go index 51dd88a11..3a532ca3e 100644 --- a/examples/using-add-filestore/main_test.go +++ b/examples/using-add-filestore/main_test.go @@ -1,6 +1,7 @@ package main import ( + "context" "fmt" "os" "testing" @@ -9,6 +10,8 @@ import ( "github.com/stretchr/testify/assert" "go.uber.org/mock/gomock" "gofr.dev/pkg/gofr" + "gofr.dev/pkg/gofr/cmd" + "gofr.dev/pkg/gofr/container" "gofr.dev/pkg/gofr/datasource/file" "gofr.dev/pkg/gofr/testutil" ) @@ -24,63 +27,50 @@ func (mockFileInfo) ModTime() time.Time { return time.Now() } func (mockFileInfo) IsDir() bool { return false } func (mockFileInfo) Sys() interface{} { return nil } -func TestPwdCommand(t *testing.T) { - os.Args = []string{"command", "pwd"} - - logs := testutil.StdoutOutputForFunc(func() { - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - app := gofr.NewCMD() +func getContext(request gofr.Request, fileMock file.FileSystem) *gofr.Context { + return &gofr.Context{Context: context.Background(), Request: request, Container: &container.Container{File: fileMock}} +} - mock := file.NewMockFileSystemProvider(ctrl) +func TestPwdCommandHandler(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() - mock.EXPECT().UseLogger(app.Logger()) - mock.EXPECT().UseMetrics(app.Metrics()) - mock.EXPECT().Connect() - mock.EXPECT().Getwd().DoAndReturn(func() (string, error) { - return "/", nil - }) + mock := file.NewMockFileSystemProvider(ctrl) - app.AddFileStore(mock) + mock.EXPECT().Getwd().DoAndReturn(func() (string, error) { + return "/", nil + }) - registerPwdCommand(app, mock) + ctx := getContext(nil, mock) - app.Run() - }) + workingDirectory, _ := pwdCommandHandler(ctx) - assert.Contains(t, logs, "/", "Test failed") + assert.Contains(t, workingDirectory, "/", "Test failed") } -func TestLSCommand(t *testing.T) { +func TestLSCommandHandler(t *testing.T) { path := "/" - os.Args = []string{"command", "ls", fmt.Sprintf("-path=%s", path)} logs := testutil.StdoutOutputForFunc(func() { + ctrl := gomock.NewController(t) defer ctrl.Finish() - app := gofr.NewCMD() - mock := file.NewMockFileSystemProvider(ctrl) - mock.EXPECT().UseLogger(app.Logger()) - mock.EXPECT().UseMetrics(app.Metrics()) - mock.EXPECT().Connect() mock.EXPECT().ReadDir(path).DoAndReturn(func(_ string) ([]file.FileInfo, error) { files := []file.FileInfo{ mockFileInfo{name: "file1.txt"}, mockFileInfo{name: "file2.txt"}, } - return files, nil }) - app.AddFileStore(mock) + r := cmd.NewRequest([]string{"command", "ls", "-path=/"}) - registerLsCommand(app, mock) + ctx := getContext(r, mock) - app.Run() + lsCommandHandler(ctx) }) assert.Contains(t, logs, "file1.txt", "Test failed") @@ -88,35 +78,27 @@ func TestLSCommand(t *testing.T) { assert.NotContains(t, logs, "file3.txt", "Test failed") } -func TestGrepCommand(t *testing.T) { +func TestGrepCommandHandler(t *testing.T) { path := "/" - os.Args = []string{"command", "grep", "-keyword=fi", fmt.Sprintf("-path=%s", path)} logs := testutil.StdoutOutputForFunc(func() { ctrl := gomock.NewController(t) defer ctrl.Finish() - app := gofr.NewCMD() - mock := file.NewMockFileSystemProvider(ctrl) - mock.EXPECT().UseLogger(app.Logger()) - mock.EXPECT().UseMetrics(app.Metrics()) - mock.EXPECT().Connect() mock.EXPECT().ReadDir("/").DoAndReturn(func(_ string) ([]file.FileInfo, error) { files := []file.FileInfo{ mockFileInfo{name: "file1.txt"}, mockFileInfo{name: "file2.txt"}, } - return files, nil }) - app.AddFileStore(mock) - - registerGrepCommand(app, mock) + r := cmd.NewRequest([]string{"command", "grep", "-keyword=fi", fmt.Sprintf("-path=%s", path)}) + ctx := getContext(r, mock) - app.Run() + grepCommandHandler(ctx) }) assert.Contains(t, logs, "file1.txt", "Test failed") @@ -126,64 +108,42 @@ func TestGrepCommand(t *testing.T) { func TestCreateFileCommand(t *testing.T) { fileName := "file.txt" - os.Args = []string{"command", "createfile", fmt.Sprintf("-filename=%s", fileName)} - logs := testutil.StdoutOutputForFunc(func() { - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - app := gofr.NewCMD() + ctrl := gomock.NewController(t) + defer ctrl.Finish() - logger := gofr.New().Logger() + mock := file.NewMockFileSystemProvider(ctrl) - mock := file.NewMockFileSystemProvider(ctrl) - - mock.EXPECT().UseLogger(app.Logger()) - mock.EXPECT().UseMetrics(app.Metrics()) - mock.EXPECT().Connect() - mock.EXPECT().Create(fileName).DoAndReturn(func(_ string) (file.File, error) { - return &file.MockFile{}, nil - }) - - app.AddFileStore(mock) + mock.EXPECT().Create(fileName).DoAndReturn(func(_ string) (file.File, error) { + return &file.MockFile{}, nil + }) - registerCreateFileCommand(app, mock, logger) + r := cmd.NewRequest([]string{"command", "createfile", fmt.Sprintf("-filename=%s", fileName)}) + ctx := getContext(r, mock) - app.Run() - }) + output, _ := createFileCommandHandler(ctx) - assert.Contains(t, logs, "Creating file : \",\"file.txt\"", "Test failed") - assert.Contains(t, logs, "Successfully created file: \",\"file.txt\"", "Test failed") + assert.Contains(t, output, "Successfully created file: file.txt", "Test failed") } func TestRmCommand(t *testing.T) { fileName := "file.txt" os.Args = []string{"command", "rm", fmt.Sprintf("-filename=%s", fileName)} - logs := testutil.StdoutOutputForFunc(func() { - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - app := gofr.NewCMD() - - logger := gofr.New().Logger() + ctrl := gomock.NewController(t) + defer ctrl.Finish() - mock := file.NewMockFileSystemProvider(ctrl) + mock := file.NewMockFileSystemProvider(ctrl) - mock.EXPECT().UseLogger(app.Logger()) - mock.EXPECT().UseMetrics(app.Metrics()) - mock.EXPECT().Connect() - mock.EXPECT().Remove("file.txt").DoAndReturn(func(_ string) error { - return nil - }) + mock.EXPECT().Remove("file.txt").DoAndReturn(func(_ string) error { + return nil + }) - app.AddFileStore(mock) + r := cmd.NewRequest([]string{"command", "rm", fmt.Sprintf("-filename=%s", fileName)}) - registerRmCommand(app, mock, logger) + ctx := getContext(r, mock) - app.Run() - }) + output, _ := rmCommandHandler(ctx) - assert.Contains(t, logs, "Removing file : \",\"file.txt\"", "Test failed") - assert.Contains(t, logs, "Successfully removed file: \",\"file.txt\"", "Test failed") + assert.Contains(t, output, "Successfully removed file: file.txt", "Test failed") } From 1a7a540e696dc3abbd311cd594a742249fc6ba67 Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Mon, 28 Oct 2024 14:07:22 +0530 Subject: [PATCH 16/17] refactor --- examples/using-add-filestore/main_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/using-add-filestore/main_test.go b/examples/using-add-filestore/main_test.go index 3a532ca3e..e6d5d14fe 100644 --- a/examples/using-add-filestore/main_test.go +++ b/examples/using-add-filestore/main_test.go @@ -52,7 +52,6 @@ func TestLSCommandHandler(t *testing.T) { path := "/" logs := testutil.StdoutOutputForFunc(func() { - ctrl := gomock.NewController(t) defer ctrl.Finish() From da7c8762342f143bda25000e70981af274fa7803 Mon Sep 17 00:00:00 2001 From: RahulMohanK Date: Mon, 28 Oct 2024 14:15:29 +0530 Subject: [PATCH 17/17] using handlers for subcommands --- examples/using-add-filestore/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/using-add-filestore/main.go b/examples/using-add-filestore/main.go index 44ad2fc11..d11368c65 100644 --- a/examples/using-add-filestore/main.go +++ b/examples/using-add-filestore/main.go @@ -41,7 +41,9 @@ func pwdCommandHandler(c *gofr.Context) (interface{}, error) { func lsCommandHandler(c *gofr.Context) (interface{}, error) { path := c.Param("path") + files, err := c.File.ReadDir(path) + if err != nil { fmt.Println(err) } else { @@ -54,7 +56,9 @@ func lsCommandHandler(c *gofr.Context) (interface{}, error) { func grepCommandHandler(c *gofr.Context) (interface{}, error) { keyword := c.Param("keyword") path := c.Param("path") + files, err := c.File.ReadDir(path) + if err != nil { fmt.Println(err) } else { @@ -67,6 +71,7 @@ func grepCommandHandler(c *gofr.Context) (interface{}, error) { func createFileCommandHandler(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") + _, err := c.File.Create(fileName) if err == nil { @@ -78,6 +83,7 @@ func createFileCommandHandler(c *gofr.Context) (interface{}, error) { func rmCommandHandler(c *gofr.Context) (interface{}, error) { fileName := c.Param("filename") + err := c.File.Remove(fileName) if err == nil {