Skip to content

Commit

Permalink
fixed missing file service access
Browse files Browse the repository at this point in the history
  • Loading branch information
Danushka96 committed Feb 16, 2025
1 parent e65b900 commit 0237ff2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ func NewContext(c *gin.Context, fileService FileService) *Context {
}
}

func (c *Context) GetFileService() FileService {
return c.fileService
}

// GetAuthContext returns the current auth context
func (c *Context) GetAuthContext() (AuthContext, error) {
userId, exists := c.Get("user_id")
Expand Down
3 changes: 3 additions & 0 deletions example/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ func main() {

server.RegisterController("/posts", postController)

fileService := ginboot.NewS3FileService("example-bucket", "./local", "AKIAIOSFODNN7EXAMPLE", "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "us-east-1", "3600")
server.BindFileService(fileService)

if err := server.Start(8080); err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 0237ff2

Please sign in to comment.