!19 fix-storage-proto

Merge pull request !19 from bandl/fix-storage-proto
This commit is contained in:
bandl 2021-09-18 08:25:01 +00:00 committed by Gitee
commit 8714fc8b8f
11 changed files with 8 additions and 56 deletions

View File

@ -95,7 +95,7 @@ type CommendRequest struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Commends []*Comm `protobuf:"bytes,1,rep,name=commends,proto3" json:"commends,omitempty"` Commends *Comm `protobuf:"bytes,1,opt,name=commends,proto3" json:"commends,omitempty"`
} }
func (x *CommendRequest) Reset() { func (x *CommendRequest) Reset() {
@ -130,7 +130,7 @@ func (*CommendRequest) Descriptor() ([]byte, []int) {
return file_storage_proto_rawDescGZIP(), []int{1} return file_storage_proto_rawDescGZIP(), []int{1}
} }
func (x *CommendRequest) GetCommends() []*Comm { func (x *CommendRequest) GetCommends() *Comm {
if x != nil { if x != nil {
return x.Commends return x.Commends
} }
@ -195,7 +195,7 @@ var file_storage_proto_rawDesc = []byte{
0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x42, 0x0d, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x5f, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x42, 0x0d, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x5f,
0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x33, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x33, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e,
0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d,
0x65, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x43, 0x6f, 0x6d, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x43, 0x6f, 0x6d,
0x6d, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x73, 0x22, 0x29, 0x0a, 0x0f, 0x43, 0x6d, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x73, 0x22, 0x29, 0x0a, 0x0f, 0x43,
0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16,
0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06,

View File

@ -4,7 +4,7 @@ type CacheValue interface {
LengthByte() int64 LengthByte() int64
} }
type ParseComm func(comm string) ([]string, error) type ParseComm func(comm interface{}) ([]string, error)
type CacheStruct interface { type CacheStruct interface {
SizeByte() int64 SizeByte() int64

View File

@ -0,0 +1 @@
package stringx

View File

@ -10,7 +10,7 @@ message Comm {
} }
message CommendRequest { message CommendRequest {
repeated Comm commends = 1; Comm commends = 1;
} }
message CommendResponse { message CommendResponse {

View File

@ -10,7 +10,7 @@ import (
"syscall" "syscall"
_ "gitee.com/timedb/wheatCache/conf" _ "gitee.com/timedb/wheatCache/conf"
"gitee.com/timedb/wheatCache/storage/proto" "gitee.com/timedb/wheatCache/pkg/proto"
"gitee.com/timedb/wheatCache/storage/server" "gitee.com/timedb/wheatCache/storage/server"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"

View File

@ -2,7 +2,7 @@ package server
import ( import (
context "context" context "context"
"gitee.com/timedb/wheatCache/storage/proto" "gitee.com/timedb/wheatCache/pkg/proto"
) )
type server struct{} type server struct{}

View File

@ -1,49 +0,0 @@
package stringx
import (
"unsafe"
"gitee.com/timedb/wheatCache/structure"
)
type StringxInt struct {
val int
}
type StringxFloat struct {
val float64
}
type Stringx struct {
ValFloat StringxFloat
ValInt StringxInt
ValString string
}
func (s *Stringx) SizeByte() int64 {
size := unsafe.Sizeof(s)
return int64(size)
}
// RollBack 事务相关, V2 实现
func (s *Stringx) RollBack() error {
panic("not implemented") // TODO: Implement
}
// Begin 事务相关, V2 实现
func (s *Stringx) Begin() error {
panic("not implemented") // TODO: Implement
}
// RollBack 事务相关, V2 实现
func (s *Stringx) Comment() error {
panic("not implemented") // TODO: Implement
}
func (s *Stringx) ParseCommend(comm structure.ParseComm) ([]string, error) {
panic("not implemented") // TODO: Implement
}
func (s *Stringx) Encode() ([]byte, error) {
panic("not implemented") // TODO: Implement
}