mirror of
https://github.com/h44z/wg-portal.git
synced 2025-09-15 07:11:15 +00:00
chore: use interfaces for web related services
This commit is contained in:
@@ -79,11 +79,16 @@ func ParseServiceError(err error) (int, models.Error) {
|
||||
}
|
||||
}
|
||||
|
||||
// region handler-interfaces
|
||||
|
||||
type Authenticator interface {
|
||||
// LoggedIn checks if a user is logged in. If scopes are given, they are validated as well.
|
||||
LoggedIn(scopes ...Scope) func(next http.Handler) http.Handler
|
||||
}
|
||||
|
||||
type Validator interface {
|
||||
// Struct validates the given struct.
|
||||
Struct(s interface{}) error
|
||||
}
|
||||
|
||||
// endregion handler-interfaces
|
||||
|
Reference in New Issue
Block a user