mirror of
https://github.com/pushbits/server.git
synced 2025-07-29 06:17:55 +02:00
Implement retrieving of user data
This commit is contained in:
parent
a3de04b2a5
commit
e4e87f2710
7 changed files with 101 additions and 73 deletions
34
api/interfaces.go
Normal file
34
api/interfaces.go
Normal file
|
@ -0,0 +1,34 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"github.com/eikendev/pushbits/model"
|
||||
)
|
||||
|
||||
// The Database interface for encapsulating database access.
|
||||
type Database interface {
|
||||
CreateApplication(application *model.Application) error
|
||||
DeleteApplication(application *model.Application) error
|
||||
GetApplicationByID(ID uint) (*model.Application, error)
|
||||
GetApplicationByToken(token string) (*model.Application, error)
|
||||
UpdateApplication(application *model.Application) error
|
||||
|
||||
AdminUserCount() (int64, error)
|
||||
CreateUser(user model.CreateUser) (*model.User, error)
|
||||
DeleteUser(user *model.User) error
|
||||
GetApplications(user *model.User) ([]model.Application, error)
|
||||
GetUserByID(ID uint) (*model.User, error)
|
||||
GetUserByName(name string) (*model.User, error)
|
||||
GetUsers() ([]model.User, error)
|
||||
UpdateUser(user *model.User) error
|
||||
}
|
||||
|
||||
// The Dispatcher interface for relaying notifications.
|
||||
type Dispatcher interface {
|
||||
RegisterApplication(name, user string) (string, error)
|
||||
DeregisterApplication(a *model.Application) error
|
||||
}
|
||||
|
||||
// The CredentialsManager interface for updating credentials.
|
||||
type CredentialsManager interface {
|
||||
CreatePasswordHash(password string) []byte
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue