diff --git a/pkg/structure/define.go b/pkg/structure/define.go new file mode 100644 index 0000000..6fe4564 --- /dev/null +++ b/pkg/structure/define.go @@ -0,0 +1 @@ +package structure diff --git a/pkg/structure/define/define.go b/pkg/structure/define/define.go deleted file mode 100644 index 57c3969..0000000 --- a/pkg/structure/define/define.go +++ /dev/null @@ -1 +0,0 @@ -package define diff --git a/pkg/structure/define/interface.go b/pkg/structure/interface.go similarity index 72% rename from pkg/structure/define/interface.go rename to pkg/structure/interface.go index 2d308cf..78fdfcb 100644 --- a/pkg/structure/define/interface.go +++ b/pkg/structure/interface.go @@ -1,4 +1,4 @@ -package define +package structure type CacheValue interface { LengthByte() int64 @@ -9,9 +9,11 @@ type ParseComm func(comm string) ([]string, error) type CacheStruct interface { SizeByte() int64 - // RollBack 事务相关 + // TODO RollBack 事务相关, V2 实现 RollBack() error + // Begin 事务相关, V2 实现 Begin() error + // Comment 事务相关, V2 实现 Comment() error ParseCommend(comm ParseComm) ([]string, error) diff --git a/pkg/structure/stringx/option.go b/pkg/structure/stringx/option.go new file mode 100644 index 0000000..653ddc2 --- /dev/null +++ b/pkg/structure/stringx/option.go @@ -0,0 +1 @@ +package stringx diff --git a/pkg/structure/stringx/string.go b/pkg/structure/stringx/string.go new file mode 100644 index 0000000..6b5b3a4 --- /dev/null +++ b/pkg/structure/stringx/string.go @@ -0,0 +1,57 @@ +package stringx + +import ( + "unsafe" + + structure "gitee.com/timedb/wheatCache/pkg/structure/define" +) + +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) GetValue(opt ...string) structure.CacheValue { + panic("not implemented") // TODO: Implement +} + +func (s *Stringx) SetValue(opt ...string) error { + panic("not implemented") // TODO: Implement +} + +func (s *Stringx) Encode() ([]byte, error) { + panic("not implemented") // TODO: Implement +}