Skip to content

Commit 95f41bf

Browse files
修复序列化问题
1 parent 9338919 commit 95f41bf

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

cache/common.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ type Cache interface {
2121
Get(ctx context.Context, key string) (*Content, error)
2222
Delete(ctx context.Context, key string) error
2323
}
24+
type RawCache interface {
25+
Raw() Cache
26+
}
2427

2528
type CloserCache interface {
2629
Cache
@@ -32,6 +35,10 @@ type closerCache struct {
3235
closer func() error
3336
}
3437

38+
func (c closerCache) Raw() Cache {
39+
return c.Cache
40+
}
41+
3542
func (c closerCache) Close() error {
3643
return c.closer()
3744
}

kv/common.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ type KV interface {
2424
CompareAndSwap(ctx context.Context, key, oldValue, newValue string) (bool, error)
2525
}
2626

27+
type RawKV interface {
28+
Raw() KV
29+
}
2730
type CloserKV interface {
2831
KV
2932
io.Closer
@@ -38,6 +41,10 @@ func (receiver closerKV) Close() error {
3841
return receiver.closer()
3942
}
4043

44+
func (receiver closerKV) RAW() KV {
45+
return receiver.KV
46+
}
47+
4148
type PagedKV interface {
4249
KV
4350
List(ctx context.Context, prefix string) (map[string]string, error)

0 commit comments

Comments
 (0)