You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
432 B
Go
18 lines
432 B
Go
2 years ago
|
package auth
|
||
|
|
||
|
import (
|
||
|
"github.com/aziis98/lupus-lite/database"
|
||
|
"github.com/aziis98/lupus-lite/model"
|
||
|
)
|
||
|
|
||
|
type AuthService interface {
|
||
|
Register(username, password string) error
|
||
|
Login(username, password string) (string, error)
|
||
|
UserForSession(token string) (string, error)
|
||
|
GetUser(username string) (model.User, error)
|
||
|
}
|
||
|
|
||
|
func NewInMemoryAuthService(db database.Database) AuthService {
|
||
|
return &memAuth{db, map[string]string{}}
|
||
|
}
|