working mvp + manager
This commit is contained in:
@@ -4,6 +4,7 @@ go 1.13
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/golang/protobuf v1.3.2
|
github.com/golang/protobuf v1.3.2
|
||||||
|
github.com/google/uuid v1.1.1
|
||||||
github.com/micro/cli v0.2.0
|
github.com/micro/cli v0.2.0
|
||||||
github.com/micro/go-micro v1.18.0
|
github.com/micro/go-micro v1.18.0
|
||||||
github.com/oklog/run v1.1.0
|
github.com/oklog/run v1.1.0
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
// package manager implements the go-micro store interface
|
||||||
|
package manager
|
||||||
@@ -3,6 +3,7 @@ package service
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
"github.com/owncloud/ocis-accounts/pkg/proto/v0"
|
"github.com/owncloud/ocis-accounts/pkg/proto/v0"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -15,17 +16,13 @@ func New() Service {
|
|||||||
type Service struct{}
|
type Service struct{}
|
||||||
|
|
||||||
// Set implements the SettingsServiceHandler interface generated on accounts.pb.micro.go
|
// 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 {
|
func (s Service) Set(c context.Context, req *proto.Record, res *proto.Record) error {
|
||||||
res.Response = &proto.AccountSettings{
|
res.Id = uuid.New().String()
|
||||||
Name: req.Request.Name,
|
res.Theme = "dark"
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get implements the SettingsServiceHandler interface generated on accounts.pb.micro.go
|
// 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 {
|
func (s Service) Get(c context.Context, req *proto.Query, res *proto.Record) error {
|
||||||
res.Response = &proto.AccountSettings{
|
|
||||||
Name: "hej",
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user