From 46da529bbb29cbc21477cbf7c015f5078a7b9f9e Mon Sep 17 00:00:00 2001 From: yitter Date: Sun, 4 Apr 2021 12:29:46 +0800 Subject: [PATCH] auto commit --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 55f827e..4415b59 100644 --- a/README.md +++ b/README.md @@ -175,14 +175,17 @@ SeqBitLength = 6 🔍 本算法提供一个开源的动态库(go语言实现),能在容器 k8s(或其它容器化集群) 环境下,通过 redis 自动注册 WorkerId。动态库提供的C接口方法有: ``` -// 注册一个新的WorkerId -extern __declspec(dllexport) GoInt RegisterWorkerId(char* ip, GoInt port, char* password, GoInt maxWorkerId); +// 注册一个 WorkerId,会先注销所有本机已注册的记录 +extern __declspec(dllexport) GoInt32 RegisterOne(char* ip, GoInt32 port, char* password, GoInt32 maxWorkerId); -// 注销WorkerId -extern __declspec(dllexport) void UnRegisterWorkerId(); +// 注册多个 WorkerId,会先注销所有本机已注册的记录 +extern __declspec(dllexport) int* RegisterMany(char* ip, GoInt32 port, char* password, GoInt32 maxWorkerId, GoInt32 totalCount); -// 检查本地WorkerId是否有效 -extern __declspec(dllexport) GoUint8 ValidateLocalWorkerId(GoInt workerId); +// 注销本机已注册的 WorkerId +extern __declspec(dllexport) void UnRegister(); + +// 检查本地WorkerId是否有效(0-有效,其它-无效) +extern __declspec(dllexport) GoInt32 Validate(GoInt32 workerId); ``` #### redis作用