neko/internal/types/member.go

26 lines
839 B
Go
Raw Normal View History

2021-03-13 23:42:16 +01:00
package types
2021-03-14 12:57:19 +01:00
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"`
}
2021-03-14 01:08:50 +01:00
type MemberManager interface {
2021-03-13 23:42:16 +01:00
Connect() error
Disconnect() error
2021-03-14 12:57:19 +01:00
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)
2021-03-13 23:42:16 +01:00
Update(id string, profile MemberProfile) error
2021-03-14 12:57:19 +01:00
UpdatePassword(id string, passwrod string) error
2021-03-13 23:42:16 +01:00
Delete(id string) error
}