forked from p93542168/wheat-cache
feat(storage): update server
This commit is contained in:
parent
a9ab92c16a
commit
cc57179c11
|
@ -2,10 +2,7 @@ package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
"errors"
|
|
||||||
|
|
||||||
"gitee.com/timedb/wheatCache/pkg/proto"
|
"gitee.com/timedb/wheatCache/pkg/proto"
|
||||||
"gitee.com/timedb/wheatCache/pkg/structure/stringx"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type server struct {
|
type server struct {
|
||||||
|
@ -20,41 +17,28 @@ func (s *server) Get(
|
||||||
cxt context.Context,
|
cxt context.Context,
|
||||||
req *proto.GetRequest,
|
req *proto.GetRequest,
|
||||||
) (*proto.CommendResponse, error) {
|
) (*proto.CommendResponse, error) {
|
||||||
|
panic("implement me")
|
||||||
var value interface{}
|
|
||||||
|
|
||||||
switch value.(type) {
|
|
||||||
case *stringx.StringX:
|
|
||||||
default:
|
|
||||||
return nil, errors.New("awdwd")
|
|
||||||
}
|
|
||||||
|
|
||||||
result, err := value.(*stringx.StringX).Get(req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return &proto.CommendResponse{
|
|
||||||
Result: result,
|
|
||||||
}, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) Set(
|
func (s *server) Set(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
req *proto.SetRequest,
|
req *proto.SetRequest,
|
||||||
) (*proto.CommendResponse, error) {
|
) (*proto.CommendResponse, error) {
|
||||||
var value interface{}
|
panic("implement me")
|
||||||
|
}
|
||||||
switch value.(type) {
|
|
||||||
case *stringx.StringX:
|
func (s *server) Add(ctx context.Context, request *proto.AddRequest) (*proto.CommendResponse, error) {
|
||||||
default:
|
panic("implement me")
|
||||||
return nil, errors.New("awdwd")
|
}
|
||||||
}
|
|
||||||
|
func (s *server) Reduce(ctx context.Context, request *proto.ReduceRequest) (*proto.CommendResponse, error) {
|
||||||
result, err := value.(*stringx.StringX).Set(req)
|
panic("implement me")
|
||||||
if err != nil {
|
}
|
||||||
return nil, err
|
|
||||||
}
|
func (s *server) Setbit(ctx context.Context, request *proto.SetbitRequest) (*proto.CommendResponse, error) {
|
||||||
return &proto.CommendResponse{
|
panic("implement me")
|
||||||
Result: result,
|
}
|
||||||
}, nil
|
|
||||||
|
func (s *server) Getbit(ctx context.Context, request *proto.GetbitRequest) (*proto.CommendResponse, error) {
|
||||||
|
panic("implement me")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue