diff --git a/Go/source/go.mod b/Go/source/go.mod index 6de6bfa..e4e7801 100644 --- a/Go/source/go.mod +++ b/Go/source/go.mod @@ -1,5 +1,5 @@ -module yitidgen +module github.com/yitter/idgenerator-go -go 1.16 +go 1.17 require github.com/go-redis/redis/v8 v8.8.0 // indirect diff --git a/Tools/AutoRegisterWorkerId/lib/yitidgengo.h b/Tools/AutoRegisterWorkerId/lib/yitidgengo.h index 8daded8..01cad9d 100644 --- a/Tools/AutoRegisterWorkerId/lib/yitidgengo.h +++ b/Tools/AutoRegisterWorkerId/lib/yitidgengo.h @@ -68,14 +68,9 @@ typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; extern "C" { #endif -extern __declspec(dllexport) void SetOptions(GoUint16 workerId); -extern __declspec(dllexport) GoUint64 NextId(); // 注册一个 WorkerId,会先注销所有本机已注册的记录 -extern __declspec(dllexport) GoInt32 RegisterOne(char* ip, GoInt32 port, char* password, GoInt32 maxWorkerId); - -// 注册多个 WorkerId,会先注销所有本机已注册的记录 -extern __declspec(dllexport) int* RegisterMany(char* ip, GoInt32 port, char* password, GoInt32 maxWorkerId, GoInt32 totalCount); +extern __declspec(dllexport) GoInt32 RegisterOne(char* ip, GoInt32 port, char* password, GoInt32 maxWorkerId, GoInt database); // 注销本机已注册的 WorkerId extern __declspec(dllexport) void UnRegister();