add Delete

This commit is contained in:
2023-04-19 21:09:07 +08:00
parent 31b16fe2d2
commit 1b6648fdda
10 changed files with 285 additions and 2 deletions

25
kv/PrefixCodec.go Normal file
View File

@@ -0,0 +1,25 @@
package kv
import (
"github.com/tursom/GoCollections/exceptions"
"github.com/tursom/GoCollections/lang"
)
type (
prefixCodec struct {
lang.BaseObject
prefix string
}
)
func PrefixCodec(prefix string) Codec[string, string] {
return &prefixCodec{prefix: prefix}
}
func (p *prefixCodec) Encode(v2 string) string {
return p.prefix + v2
}
func (p *prefixCodec) Decode(v1 string) string {
panic(exceptions.NewIllegalAccessException("unsupported method", nil))
}