From 06baf3993dea3105c64c19542cf46ef2923b2c26 Mon Sep 17 00:00:00 2001 From: bandl <1658002533@qq.com> Date: Fri, 5 Nov 2021 16:36:00 +0800 Subject: [PATCH] feat(hashx-interface): add hash interface --- pkg/structure/define.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/structure/define.go b/pkg/structure/define.go index 22ec2d1..375e941 100644 --- a/pkg/structure/define.go +++ b/pkg/structure/define.go @@ -53,3 +53,16 @@ type ListXInterface interface { Range(start, end int) ([]string, error) Remove(value string, count int) (int, UpdateLength) } + +type HashXInterface interface { + KeyBaseInterface + Set(key string, val string) UpdateLength + Get(key string) (string, error) + Del(key string) (UpdateLength, error) + Key() []string + Value() []string + Item() map[string]string + Add(renewal int, key ...string) (int, []string, error) // 访问影响成功的结果 + SetX(key string, val string) (bool, UpdateLength) // 不存在才插入 + Length() int +}