mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-26 15:02:52 -05:00
working mvp + manager
This commit is contained in:
1
go.mod
1
go.mod
@@ -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
2
pkg/manager/manager.go
Normal file
@@ -0,0 +1,2 @@
|
||||
// package manager implements the go-micro store interface
|
||||
package manager
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user