implemented member manager.

This commit is contained in:
Miroslav Šedivý
2021-03-14 12:57:19 +01:00
parent 7c79b48750
commit bf560d5289
8 changed files with 435 additions and 249 deletions

View File

@ -1,11 +1,25 @@
package types
type MemberProfile struct {
Name string `json:"name"`
IsAdmin bool `json:"is_admin"`
CanLogin bool `json:"can_login"`
CanConnect bool `json:"can_connect"`
CanWatch bool `json:"can_watch"`
CanHost bool `json:"can_host"`
CanAccessClipboard bool `json:"can_access_clipboard"`
}
type MemberManager interface {
Connect() error
Disconnect() error
Insert(id string, profile MemberProfile) error
Authenticate(username string, password string) (string, MemberProfile, error)
Insert(username string, password string, profile MemberProfile) (string, error)
Select(id string) (MemberProfile, error)
SelectAll(limit int, offset int) (map[string]MemberProfile, error)
Update(id string, profile MemberProfile) error
UpdatePassword(id string, passwrod string) error
Delete(id string) error
Select() (map[string]MemberProfile, error)
}

View File

@ -2,16 +2,6 @@ package types
import "net/http"
type MemberProfile struct {
Name string `json:"name"`
IsAdmin bool `json:"is_admin"`
CanLogin bool `json:"can_login"`
CanConnect bool `json:"can_connect"`
CanWatch bool `json:"can_watch"`
CanHost bool `json:"can_host"`
CanAccessClipboard bool `json:"can_access_clipboard"`
}
type SessionState struct {
IsConnected bool `json:"is_connected"`
IsWatching bool `json:"is_watching"`