forked from go-shiori/shiori
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add database pool to ShioriServer struct
- Loading branch information
Showing
2 changed files
with
12 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
package api | ||
|
||
import "github.com/go-shiori/shiori/internal/database" | ||
|
||
// ShioriServer holds configuration and connection pools | ||
type ShioriServer struct{} | ||
type ShioriServer struct { | ||
DB database.DB | ||
} | ||
|
||
// NewShioriServer creates new API server | ||
func NewShioriServer() *ShioriServer { | ||
return &ShioriServer{} | ||
func NewShioriServer(db database.DB) *ShioriServer { | ||
return &ShioriServer{ | ||
DB: db, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters