Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a95c72
commit 9da61a2
Showing
19 changed files
with
435 additions
and
168 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,29 +1,29 @@ | ||
package api | ||
|
||
import ( | ||
"database/sql" | ||
"github.com/NickyMateev/Reviewer/api/project" | ||
"github.com/NickyMateev/Reviewer/api/pullrequest" | ||
"github.com/NickyMateev/Reviewer/api/user" | ||
"github.com/NickyMateev/Reviewer/storage" | ||
"github.com/NickyMateev/Reviewer/web" | ||
) | ||
|
||
type defaultAPI struct { | ||
db *sql.DB | ||
storage storage.Storage | ||
} | ||
|
||
// Default returns an instance of the default API | ||
func Default(db *sql.DB) web.API { | ||
func Default(storage storage.Storage) web.API { | ||
return defaultAPI{ | ||
db: db, | ||
storage: storage, | ||
} | ||
} | ||
|
||
// Controllers returns the default API's controllers | ||
func (api defaultAPI) Controllers() []web.Controller { | ||
return []web.Controller{ | ||
user.Controller(api.db), | ||
project.Controller(api.db), | ||
pullrequest.Controller(api.db), | ||
user.Controller(api.storage), | ||
project.Controller(api.storage), | ||
pullrequest.Controller(api.storage), | ||
} | ||
} |
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
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
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
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
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
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
Oops, something went wrong.