neko/internal/member/dummy/manager.go

58 lines
1.5 KiB
Go
Raw Normal View History

2021-03-15 00:57:19 +13:00
package dummy
import (
2021-03-15 01:06:33 +13:00
"fmt"
2021-03-15 00:57:19 +13:00
"demodesk/neko/internal/types"
)
func New() types.MemberManager {
return &MemberManagerCtx{}
}
type MemberManagerCtx struct{}
func (manager *MemberManagerCtx) Connect() error {
return nil
}
func (manager *MemberManagerCtx) Disconnect() error {
return nil
}
func (manager *MemberManagerCtx) Authenticate(username string, password string) (string, types.MemberProfile, error) {
2021-03-15 01:06:33 +13:00
return username, types.MemberProfile{
Name: username,
IsAdmin: true,
CanLogin: true,
CanConnect: true,
CanWatch: true,
CanHost: true,
CanAccessClipboard: true,
}, nil
2021-03-15 00:57:19 +13:00
}
func (manager *MemberManagerCtx) Insert(username string, password string, profile types.MemberProfile) (string, error) {
2021-03-15 01:06:33 +13:00
return "", fmt.Errorf("Not implemented.")
2021-03-15 00:57:19 +13:00
}
func (manager *MemberManagerCtx) Select(id string) (types.MemberProfile, error) {
2021-03-15 01:06:33 +13:00
return types.MemberProfile{}, fmt.Errorf("Not implemented.")
2021-03-15 00:57:19 +13:00
}
func (manager *MemberManagerCtx) SelectAll(limit int, offset int) (map[string]types.MemberProfile, error) {
2021-03-15 01:06:33 +13:00
return map[string]types.MemberProfile{}, fmt.Errorf("Not implemented.")
2021-03-15 00:57:19 +13:00
}
func (manager *MemberManagerCtx) Update(id string, profile types.MemberProfile) error {
2021-03-15 01:06:33 +13:00
return fmt.Errorf("Not implemented.")
2021-03-15 00:57:19 +13:00
}
func (manager *MemberManagerCtx) UpdatePassword(id string, passwrod string) error {
2021-03-15 01:06:33 +13:00
return fmt.Errorf("Not implemented.")
2021-03-15 00:57:19 +13:00
}
func (manager *MemberManagerCtx) Delete(id string) error {
2021-03-15 01:06:33 +13:00
return fmt.Errorf("Not implemented.")
2021-03-15 00:57:19 +13:00
}