working mvp + manager

This commit is contained in:
A.Unger
2020-01-30 16:11:34 +01:00
parent 34191e887c
commit 92a2c65bba
3 changed files with 8 additions and 8 deletions

1
go.mod
View File

@@ -4,6 +4,7 @@ go 1.13
require (
github.com/golang/protobuf v1.3.2
github.com/google/uuid v1.1.1
github.com/micro/cli v0.2.0
github.com/micro/go-micro v1.18.0
github.com/oklog/run v1.1.0

2
pkg/manager/manager.go Normal file
View File

@@ -0,0 +1,2 @@
// package manager implements the go-micro store interface
package manager

View File

@@ -3,6 +3,7 @@ package service
import (
"context"
"github.com/google/uuid"
"github.com/owncloud/ocis-accounts/pkg/proto/v0"
)
@@ -15,17 +16,13 @@ func New() Service {
type Service struct{}
// Set implements the SettingsServiceHandler interface generated on accounts.pb.micro.go
func (s Service) Set(c context.Context, req *proto.SettingsRequest, res *proto.SettingsResponse) error {
res.Response = &proto.AccountSettings{
Name: req.Request.Name,
}
func (s Service) Set(c context.Context, req *proto.Record, res *proto.Record) error {
res.Id = uuid.New().String()
res.Theme = "dark"
return nil
}
// Get implements the SettingsServiceHandler interface generated on accounts.pb.micro.go
func (s Service) Get(c context.Context, req *proto.AccountQueryRequest, res *proto.SettingsResponse) error {
res.Response = &proto.AccountSettings{
Name: "hej",
}
func (s Service) Get(c context.Context, req *proto.Query, res *proto.Record) error {
return nil
}