/
service_interface.go
32 lines (28 loc) · 1.02 KB
/
service_interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package web
import (
"net/http"
"github.com/aceraizel/go-oauth2-server/config"
"github.com/aceraizel/go-oauth2-server/oauth"
"github.com/aceraizel/go-oauth2-server/session"
"github.com/aceraizel/go-oauth2-server/util/routes"
"github.com/gorilla/mux"
)
// ServiceInterface defines exported methods
type ServiceInterface interface {
// Exported methods
GetConfig() *config.Config
GetOauthService() oauth.ServiceInterface
GetSessionService() session.ServiceInterface
GetRoutes() []routes.Route
RegisterRoutes(router *mux.Router, prefix string)
Close()
// Needed for the newRoutes to be able to register handlers
setSessionService(r *http.Request, w http.ResponseWriter)
authorizeForm(w http.ResponseWriter, r *http.Request)
authorize(w http.ResponseWriter, r *http.Request)
loginForm(w http.ResponseWriter, r *http.Request)
login(w http.ResponseWriter, r *http.Request)
logout(w http.ResponseWriter, r *http.Request)
registerForm(w http.ResponseWriter, r *http.Request)
register(w http.ResponseWriter, r *http.Request)
}