diff options
| author | Nicolas Paul <n@nc0.fr> | 2023-04-07 01:13:39 +0200 |
|---|---|---|
| committer | Nicolas Paul <nicolaspaul45400@gmail.com> | 2023-04-07 01:18:36 +0200 |
| commit | 2e4db08bc6360a13e167ad9eca7f21dc8a2f89a9 (patch) | |
| tree | 6d0678bd90e720d5b418a6a646286f8280b65a01 | |
| parent | 7a57d144103b133ec5165bca19dff244f63ba215 (diff) | |
Update module import path
| -rw-r--r-- | api/nc0/clawflake/generator/v3/generator.pb.go | 242 | ||||
| -rw-r--r-- | api/nicolaspl/clawflake/generator/v3/generator.pb.go | 245 | ||||
| -rw-r--r-- | api/nicolaspl/clawflake/generator/v3/generator.proto (renamed from api/nc0/clawflake/generator/v3/generator.proto) | 8 | ||||
| -rw-r--r-- | api/nicolaspl/clawflake/generator/v3/generator_grpc.pb.go (renamed from api/nc0/clawflake/generator/v3/generator_grpc.pb.go) | 10 | ||||
| -rw-r--r-- | cmd/generator/generator.go | 4 | ||||
| -rw-r--r-- | cmd/generator/main.go | 2 | ||||
| -rw-r--r-- | cmd/testclient/main.go | 2 | ||||
| -rw-r--r-- | go.mod | 2 | ||||
| -rw-r--r-- | website/README.md | 2 | ||||
| -rw-r--r-- | website/src/index.html | 90 |
10 files changed, 307 insertions, 300 deletions
diff --git a/api/nc0/clawflake/generator/v3/generator.pb.go b/api/nc0/clawflake/generator/v3/generator.pb.go deleted file mode 100644 index 37e1d04..0000000 --- a/api/nc0/clawflake/generator/v3/generator.pb.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.12 -// source: api/nc0/clawflake/generator/v3/generator.proto - -package v3 - -import ( - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// The request of a Generate RPC. -type GenerateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The amount of ID numbers to generate. - // The value should be in the interval [1, 4096]. - // Values not in the interval will not be coerced and the request will be - // aborted. - Amount uint32 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"` -} - -func (x *GenerateRequest) Reset() { - *x = GenerateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_api_nc0_clawflake_generator_v3_generator_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenerateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateRequest) ProtoMessage() {} - -func (x *GenerateRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_nc0_clawflake_generator_v3_generator_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GenerateRequest.ProtoReflect.Descriptor instead. -func (*GenerateRequest) Descriptor() ([]byte, []int) { - return file_api_nc0_clawflake_generator_v3_generator_proto_rawDescGZIP(), []int{0} -} - -func (x *GenerateRequest) GetAmount() uint32 { - if x != nil { - return x.Amount - } - return 0 -} - -// The response of a Generate RPC. -type GenerateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The generate ID numbers. - IdNumbers []string `protobuf:"bytes,1,rep,name=id_numbers,json=idNumbers,proto3" json:"id_numbers,omitempty"` -} - -func (x *GenerateResponse) Reset() { - *x = GenerateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_api_nc0_clawflake_generator_v3_generator_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenerateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateResponse) ProtoMessage() {} - -func (x *GenerateResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_nc0_clawflake_generator_v3_generator_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GenerateResponse.ProtoReflect.Descriptor instead. -func (*GenerateResponse) Descriptor() ([]byte, []int) { - return file_api_nc0_clawflake_generator_v3_generator_proto_rawDescGZIP(), []int{1} -} - -func (x *GenerateResponse) GetIdNumbers() []string { - if x != nil { - return x.IdNumbers - } - return nil -} - -var File_api_nc0_clawflake_generator_v3_generator_proto protoreflect.FileDescriptor - -var file_api_nc0_clawflake_generator_v3_generator_proto_rawDesc = []byte{ - 0x0a, 0x2e, 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x63, 0x30, 0x2f, 0x63, 0x6c, 0x61, 0x77, 0x66, 0x6c, - 0x61, 0x6b, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x76, 0x33, - 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x1a, 0x6e, 0x63, 0x30, 0x2e, 0x63, 0x6c, 0x61, 0x77, 0x66, 0x6c, 0x61, 0x6b, 0x65, 0x2e, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x33, 0x1a, 0x1c, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2e, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x36, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x69, 0x64, 0x5f, 0x6e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, - 0x06, 0x52, 0x09, 0x69, 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x32, 0xa0, 0x01, 0x0a, - 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x8b, 0x01, 0x0a, 0x08, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x12, 0x2b, - 0x2e, 0x6e, 0x63, 0x30, 0x2e, 0x63, 0x6c, 0x61, 0x77, 0x66, 0x6c, 0x61, 0x6b, 0x65, 0x2e, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6e, 0x63, - 0x30, 0x2e, 0x63, 0x6c, 0x61, 0x77, 0x66, 0x6c, 0x61, 0x6b, 0x65, 0x2e, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x15, 0x22, 0x10, 0x2f, 0x76, 0x33, 0x2f, 0x69, 0x64, 0x73, 0x3a, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x3a, 0x01, 0x2a, 0xda, 0x41, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, - 0x82, 0x01, 0x0a, 0x1d, 0x66, 0x72, 0x2e, 0x6e, 0x63, 0x30, 0x2e, 0x63, 0x6c, 0x61, 0x77, 0x66, - 0x6c, 0x61, 0x6b, 0x65, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, - 0x33, 0x42, 0x0e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x6f, 0x2e, 0x6e, 0x63, 0x30, 0x2e, 0x66, 0x72, 0x2f, 0x63, - 0x6c, 0x61, 0x77, 0x66, 0x6c, 0x61, 0x6b, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x63, 0x30, - 0x2f, 0x63, 0x6c, 0x61, 0x77, 0x66, 0x6c, 0x61, 0x6b, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x76, 0x33, 0xaa, 0x02, 0x1a, 0x4e, 0x63, 0x30, 0x2e, 0x43, 0x6c, - 0x61, 0x77, 0x66, 0x6c, 0x61, 0x6b, 0x65, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x2e, 0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_api_nc0_clawflake_generator_v3_generator_proto_rawDescOnce sync.Once - file_api_nc0_clawflake_generator_v3_generator_proto_rawDescData = file_api_nc0_clawflake_generator_v3_generator_proto_rawDesc -) - -func file_api_nc0_clawflake_generator_v3_generator_proto_rawDescGZIP() []byte { - file_api_nc0_clawflake_generator_v3_generator_proto_rawDescOnce.Do(func() { - file_api_nc0_clawflake_generator_v3_generator_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_nc0_clawflake_generator_v3_generator_proto_rawDescData) - }) - return file_api_nc0_clawflake_generator_v3_generator_proto_rawDescData -} - -var file_api_nc0_clawflake_generator_v3_generator_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_api_nc0_clawflake_generator_v3_generator_proto_goTypes = []interface{}{ - (*GenerateRequest)(nil), // 0: nc0.clawflake.generator.v3.GenerateRequest - (*GenerateResponse)(nil), // 1: nc0.clawflake.generator.v3.GenerateResponse -} -var file_api_nc0_clawflake_generator_v3_generator_proto_depIdxs = []int32{ - 0, // 0: nc0.clawflake.generator.v3.GeneratorService.Generate:input_type -> nc0.clawflake.generator.v3.GenerateRequest - 1, // 1: nc0.clawflake.generator.v3.GeneratorService.Generate:output_type -> nc0.clawflake.generator.v3.GenerateResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_api_nc0_clawflake_generator_v3_generator_proto_init() } -func file_api_nc0_clawflake_generator_v3_generator_proto_init() { - if File_api_nc0_clawflake_generator_v3_generator_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_api_nc0_clawflake_generator_v3_generator_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenerateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_nc0_clawflake_generator_v3_generator_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenerateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_api_nc0_clawflake_generator_v3_generator_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_api_nc0_clawflake_generator_v3_generator_proto_goTypes, - DependencyIndexes: file_api_nc0_clawflake_generator_v3_generator_proto_depIdxs, - MessageInfos: file_api_nc0_clawflake_generator_v3_generator_proto_msgTypes, - }.Build() - File_api_nc0_clawflake_generator_v3_generator_proto = out.File - file_api_nc0_clawflake_generator_v3_generator_proto_rawDesc = nil - file_api_nc0_clawflake_generator_v3_generator_proto_goTypes = nil - file_api_nc0_clawflake_generator_v3_generator_proto_depIdxs = nil -} diff --git a/api/nicolaspl/clawflake/generator/v3/generator.pb.go b/api/nicolaspl/clawflake/generator/v3/generator.pb.go new file mode 100644 index 0000000..d02f45c --- /dev/null +++ b/api/nicolaspl/clawflake/generator/v3/generator.pb.go @@ -0,0 +1,245 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.12 +// source: api/nicolaspl/clawflake/generator/v3/generator.proto + +package v3 + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The request of a Generate RPC. +type GenerateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The amount of ID numbers to generate. + // The value should be in the interval [1, 4096]. + // Values not in the interval will not be coerced and the request will be + // aborted. + Amount uint32 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *GenerateRequest) Reset() { + *x = GenerateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_nicolaspl_clawflake_generator_v3_generator_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenerateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateRequest) ProtoMessage() {} + +func (x *GenerateRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_nicolaspl_clawflake_generator_v3_generator_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GenerateRequest.ProtoReflect.Descriptor instead. +func (*GenerateRequest) Descriptor() ([]byte, []int) { + return file_api_nicolaspl_clawflake_generator_v3_generator_proto_rawDescGZIP(), []int{0} +} + +func (x *GenerateRequest) GetAmount() uint32 { + if x != nil { + return x.Amount + } + return 0 +} + +// The response of a Generate RPC. +type GenerateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The generate ID numbers. + IdNumbers []string `protobuf:"bytes,1,rep,name=id_numbers,json=idNumbers,proto3" json:"id_numbers,omitempty"` +} + +func (x *GenerateResponse) Reset() { + *x = GenerateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_nicolaspl_clawflake_generator_v3_generator_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenerateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateResponse) ProtoMessage() {} + +func (x *GenerateResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_nicolaspl_clawflake_generator_v3_generator_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GenerateResponse.ProtoReflect.Descriptor instead. +func (*GenerateResponse) Descriptor() ([]byte, []int) { + return file_api_nicolaspl_clawflake_generator_v3_generator_proto_rawDescGZIP(), []int{1} +} + +func (x *GenerateResponse) GetIdNumbers() []string { + if x != nil { + return x.IdNumbers + } + return nil +} + +var File_api_nicolaspl_clawflake_generator_v3_generator_proto protoreflect.FileDescriptor + +var file_api_nicolaspl_clawflake_generator_v3_generator_proto_rawDesc = []byte{ + 0x0a, 0x34, 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x69, 0x63, 0x6f, 0x6c, 0x61, 0x73, 0x70, 0x6c, 0x2f, + 0x63, 0x6c, 0x61, 0x77, 0x66, 0x6c, 0x61, 0x6b, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x20, 0x6e, 0x69, 0x63, 0x6f, 0x6c, 0x61, 0x73, 0x70, + 0x6c, 0x2e, 0x63, 0x6c, 0x61, 0x77, 0x66, 0x6c, 0x61, 0x6b, 0x65, 0x2e, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x33, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x2e, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x22, 0x36, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x69, 0x64, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x06, 0x52, 0x09, 0x69, + 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x32, 0xac, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x97, 0x01, + 0x0a, 0x08, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x12, 0x31, 0x2e, 0x6e, 0x69, 0x63, + 0x6f, 0x6c, 0x61, 0x73, 0x70, 0x6c, 0x2e, 0x63, 0x6c, 0x61, 0x77, 0x66, 0x6c, 0x61, 0x6b, 0x65, + 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, + 0x6e, 0x69, 0x63, 0x6f, 0x6c, 0x61, 0x73, 0x70, 0x6c, 0x2e, 0x63, 0x6c, 0x61, 0x77, 0x66, 0x6c, + 0x61, 0x6b, 0x65, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x33, + 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x76, 0x33, 0x2f, 0x69, + 0x64, 0x73, 0x3a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x3a, 0x01, 0x2a, 0xda, 0x41, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x96, 0x01, 0x0a, 0x24, 0x63, 0x6f, 0x6d, 0x2e, + 0x6e, 0x69, 0x63, 0x6f, 0x6c, 0x61, 0x73, 0x70, 0x6c, 0x2e, 0x63, 0x6c, 0x61, 0x77, 0x66, 0x6c, + 0x61, 0x6b, 0x65, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x33, + 0x42, 0x0e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x39, 0x67, 0x6f, 0x2e, 0x6e, 0x69, 0x63, 0x6f, 0x6c, 0x61, 0x73, 0x70, 0x6c, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x61, 0x77, 0x66, 0x6c, 0x61, 0x6b, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x6e, 0x63, 0x30, 0x2f, 0x63, 0x6c, 0x61, 0x77, 0x66, 0x6c, 0x61, 0x6b, 0x65, + 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x76, 0x33, 0xaa, 0x02, 0x20, + 0x4e, 0x69, 0x63, 0x6f, 0x6c, 0x61, 0x73, 0x50, 0x6c, 0x2e, 0x43, 0x6c, 0x61, 0x77, 0x66, 0x6c, + 0x61, 0x6b, 0x65, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x56, 0x33, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_api_nicolaspl_clawflake_generator_v3_generator_proto_rawDescOnce sync.Once + file_api_nicolaspl_clawflake_generator_v3_generator_proto_rawDescData = file_api_nicolaspl_clawflake_generator_v3_generator_proto_rawDesc +) + +func file_api_nicolaspl_clawflake_generator_v3_generator_proto_rawDescGZIP() []byte { + file_api_nicolaspl_clawflake_generator_v3_generator_proto_rawDescOnce.Do(func() { + file_api_nicolaspl_clawflake_generator_v3_generator_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_nicolaspl_clawflake_generator_v3_generator_proto_rawDescData) + }) + return file_api_nicolaspl_clawflake_generator_v3_generator_proto_rawDescData +} + +var file_api_nicolaspl_clawflake_generator_v3_generator_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_api_nicolaspl_clawflake_generator_v3_generator_proto_goTypes = []interface{}{ + (*GenerateRequest)(nil), // 0: nicolaspl.clawflake.generator.v3.GenerateRequest + (*GenerateResponse)(nil), // 1: nicolaspl.clawflake.generator.v3.GenerateResponse +} +var file_api_nicolaspl_clawflake_generator_v3_generator_proto_depIdxs = []int32{ + 0, // 0: nicolaspl.clawflake.generator.v3.GeneratorService.Generate:input_type -> nicolaspl.clawflake.generator.v3.GenerateRequest + 1, // 1: nicolaspl.clawflake.generator.v3.GeneratorService.Generate:output_type -> nicolaspl.clawflake.generator.v3.GenerateResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_api_nicolaspl_clawflake_generator_v3_generator_proto_init() } +func file_api_nicolaspl_clawflake_generator_v3_generator_proto_init() { + if File_api_nicolaspl_clawflake_generator_v3_generator_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_api_nicolaspl_clawflake_generator_v3_generator_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenerateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_nicolaspl_clawflake_generator_v3_generator_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenerateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_nicolaspl_clawflake_generator_v3_generator_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_nicolaspl_clawflake_generator_v3_generator_proto_goTypes, + DependencyIndexes: file_api_nicolaspl_clawflake_generator_v3_generator_proto_depIdxs, + MessageInfos: file_api_nicolaspl_clawflake_generator_v3_generator_proto_msgTypes, + }.Build() + File_api_nicolaspl_clawflake_generator_v3_generator_proto = out.File + file_api_nicolaspl_clawflake_generator_v3_generator_proto_rawDesc = nil + file_api_nicolaspl_clawflake_generator_v3_generator_proto_goTypes = nil + file_api_nicolaspl_clawflake_generator_v3_generator_proto_depIdxs = nil +} diff --git a/api/nc0/clawflake/generator/v3/generator.proto b/api/nicolaspl/clawflake/generator/v3/generator.proto index 605790c..ce41d85 100644 --- a/api/nc0/clawflake/generator/v3/generator.proto +++ b/api/nicolaspl/clawflake/generator/v3/generator.proto @@ -1,14 +1,14 @@ syntax = "proto3"; -package nc0.clawflake.generator.v3; +package nicolaspl.clawflake.generator.v3; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; -option csharp_namespace = "Nc0.Clawflake.Generator.V3"; -option go_package = "go.nc0.fr/clawflake/api/nc0/clawflake/generator/v3"; -option java_package = "fr.nc0.clawflake.generator.v3"; +option csharp_namespace = "NicolasPl.Clawflake.Generator.V3"; +option go_package = "go.nicolaspl.com/clawflake/api/nc0/clawflake/generator/v3"; +option java_package = "com.nicolaspl.clawflake.generator.v3"; option java_multiple_files = true; option java_outer_classname = "GeneratorProto"; diff --git a/api/nc0/clawflake/generator/v3/generator_grpc.pb.go b/api/nicolaspl/clawflake/generator/v3/generator_grpc.pb.go index fe9432a..3b5e79e 100644 --- a/api/nc0/clawflake/generator/v3/generator_grpc.pb.go +++ b/api/nicolaspl/clawflake/generator/v3/generator_grpc.pb.go @@ -2,7 +2,7 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.21.12 -// source: api/nc0/clawflake/generator/v3/generator.proto +// source: api/nicolaspl/clawflake/generator/v3/generator.proto package v3 @@ -36,7 +36,7 @@ func NewGeneratorServiceClient(cc grpc.ClientConnInterface) GeneratorServiceClie func (c *generatorServiceClient) Generate(ctx context.Context, in *GenerateRequest, opts ...grpc.CallOption) (*GenerateResponse, error) { out := new(GenerateResponse) - err := c.cc.Invoke(ctx, "/nc0.clawflake.generator.v3.GeneratorService/Generate", in, out, opts...) + err := c.cc.Invoke(ctx, "/nicolaspl.clawflake.generator.v3.GeneratorService/Generate", in, out, opts...) if err != nil { return nil, err } @@ -82,7 +82,7 @@ func _GeneratorService_Generate_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/nc0.clawflake.generator.v3.GeneratorService/Generate", + FullMethod: "/nicolaspl.clawflake.generator.v3.GeneratorService/Generate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GeneratorServiceServer).Generate(ctx, req.(*GenerateRequest)) @@ -94,7 +94,7 @@ func _GeneratorService_Generate_Handler(srv interface{}, ctx context.Context, de // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var GeneratorService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "nc0.clawflake.generator.v3.GeneratorService", + ServiceName: "nicolaspl.clawflake.generator.v3.GeneratorService", HandlerType: (*GeneratorServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -103,5 +103,5 @@ var GeneratorService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "api/nc0/clawflake/generator/v3/generator.proto", + Metadata: "api/nicolaspl/clawflake/generator/v3/generator.proto", } diff --git a/cmd/generator/generator.go b/cmd/generator/generator.go index 901a9c6..ab331ed 100644 --- a/cmd/generator/generator.go +++ b/cmd/generator/generator.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/google/uuid" - generatorpb "go.nc0.fr/clawflake/api/nc0/clawflake/generator/v3" + generatorpb "go.nicolaspl.com/clawflake/api/nicolaspl/clawflake/generator/v3" "go.uber.org/zap" "google.golang.org/genproto/googleapis/rpc/errdetails" "google.golang.org/grpc/codes" @@ -47,7 +47,7 @@ func (g *GeneratorServiceServer) Generate(ctx context.Context, req *generatorpb. s := status.New(codes.Internal, "internal error") s.WithDetails(&errdetails.ErrorInfo{ Reason: "INTERNAL", - Domain: "generator.clawflake.nc0.fr", + Domain: "generator.clawflake.nicolaspl.fr", }) return nil, s.Err() } diff --git a/cmd/generator/main.go b/cmd/generator/main.go index 22165a1..4815a95 100644 --- a/cmd/generator/main.go +++ b/cmd/generator/main.go @@ -6,7 +6,7 @@ import ( "flag" "net" - generatorpb "go.nc0.fr/clawflake/api/nc0/clawflake/generator/v3" + generatorpb "go.nicolaspl.com/clawflake/api/nicolaspl/clawflake/generator/v3" "go.uber.org/zap" "google.golang.org/grpc" diff --git a/cmd/testclient/main.go b/cmd/testclient/main.go index 135cc3f..802e794 100644 --- a/cmd/testclient/main.go +++ b/cmd/testclient/main.go @@ -5,7 +5,7 @@ import ( "flag" "fmt" - generatorpb "go.nc0.fr/clawflake/api/nc0/clawflake/generator/v3" + generatorpb "go.nicolaspl.com/clawflake/api/nicolaspl/clawflake/generator/v3" "go.uber.org/zap" "google.golang.org/grpc" @@ -1,4 +1,4 @@ -module go.nc0.fr/clawflake +module go.nicolaspl.com/clawflake go 1.19 diff --git a/website/README.md b/website/README.md index 68422a6..30631ea 100644 --- a/website/README.md +++ b/website/README.md @@ -1,3 +1,3 @@ # Clawflake's Website -The website for the Clawflake project, available at <https://clawflake.nc0.fr>. +The website for the Clawflake project, available at <https://clawflake.nicolaspl.fr>. diff --git a/website/src/index.html b/website/src/index.html index 70fdc85..f33c47c 100644 --- a/website/src/index.html +++ b/website/src/index.html @@ -1,5 +1,6 @@ <!DOCTYPE html> <html lang="en"> + <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> @@ -9,15 +10,15 @@ <link rel="icon" type="image/png" sizes="32x32" href="/assets/img/crab.png"> <title>Clawflake | Distributed ID Generator</title> <!-- OpenGraph --> - <meta property="og:title" content="Clawflake"/> + <meta property="og:title" content="Clawflake" /> <meta property="og:type" content="website" /> <meta property="og:description" content="Clawflake is a distributed ID generator system." /> <meta property="og:determiner" content="" /> - <meta property="og:site_name" content="nc0" /> + <meta property="og:site_name" content="Nicolas Paul" /> <meta property="og:locale" content="en_US" /> <!-- Twitter Cards --> <meta name="twitter:card" content="summary"> - <meta name="twitter:site" content="n1c00o"> + <meta name="twitter:site" content="@ncs_pl"> <meta name="twitter:title" content="Clawflake"> <meta name="twitter:description" content="Clawflake is a distributed ID generator system."> <!-- Hypermedia --> @@ -28,15 +29,16 @@ <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/languages/bash.min.js"></script> <script>hljs.highlightAll();</script> </head> + <body> <nav class="container"> <ul> <li><img src="/assets/img/crab.png" alt="crab" height="80" width="80"></li> </ul> <ul> - <li><a href="https://nicolaspl.com" role="button">nc0</a></li> + <li><a href="https://nicolaspl.com" role="button">Nicolas Paul</a></li> <li><a href="/license.txt" role="button"> - License</a></li> + License</a></li> <li><a href="https://github.com/n1c00o/clawflake" role="button">Source</a></li> </ul> </nav> @@ -44,17 +46,17 @@ <main class="container"> <h1>Clawflake</h1> - <p>Clawflake is a distributed ID number generation system inspired from + <p>Clawflake is a distributed ID number generation system inspired from <a href="https://github.com/twitter-archive/snowflake/tree/snowflake-2010"> Twitter's Snowflake</a>. </p> - - <p> The goal of Clawflake is to be hosted as a distributed system with + + <p> The goal of Clawflake is to be hosted as a distributed system with all workers being isolated from each others apart from the machine ID. </p> - + <h2>Format</h2> - + <p> Unlike Snowflake, the composition of a Clawflake uses all 64 bits. </p> @@ -93,28 +95,28 @@ <p> Therefore, Clawflake ID numbers gives <mark>2<sup>45</sup> - 1 = 1115.7</mark> years of safety from the configured epoch. - Thanks to the sequence number, a worker can handle <mark>2<sup>12</sup> = 4069</mark> + Thanks to the sequence number, a worker can handle <mark>2<sup>12</sup> = 4069</mark> generations per milliseconds at peak. - The system can accept a maximum of <mark>2<sup>7</sup> = 128</mark> machines for a + The system can accept a maximum of <mark>2<sup>7</sup> = 128</mark> machines for a given epoch. - </p> - + </p> + <cite> - Since Clawflake uses the most significant bit, converting a Clawflake ID + Since Clawflake uses the most significant bit, converting a Clawflake ID from <i>uint64</i> to <i>int64</i> is not safe. </cite> - + <h2>Usage</h2> <p> - Before launching any worker, you need to determine the following + Before launching any worker, you need to determine the following information: - <ul> - <li><i>epoch</i>: corresponds to the epoch workers will be using to - generate IDs.</li> - <li><i>machine</i>: the identifier for the machine.</li> - </ul> + <ul> + <li><i>epoch</i>: corresponds to the epoch workers will be using to + generate IDs.</li> + <li><i>machine</i>: the identifier for the machine.</li> + </ul> </p> <p> @@ -123,55 +125,56 @@ </p> <p> - You can compile the worker by running - - <pre><code lang="language-bash">make generator</code></pre> + You can compile the worker by running - This will generate an executable named <code>generator</code> inside the - <code>bin</code> directory. + <pre><code lang="language-bash">make generator</code></pre> + + This will generate an executable named <code>generator</code> inside the + <code>bin</code> directory. </p> - + <p> You can then start the worker by running: - <pre><code class="language-bash"> + <pre><code class="language-bash"> export MACHINE_ID= # Worker ID, between 0 and 127 export EPOCH= # Epoch to use in ID generation ./bin/generator -machine_id=$MACHINE_ID -epoch=$EPOCH -grpc_host=":5000" </code></pre> - <strong>TIP:</strong> Use the flag <code>-help</code> to view the - documentation for the flags. + <strong>TIP:</strong> Use the flag <code>-help</code> to view the + documentation for the flags. </p> - + <p> A worker should be running on port <code>5000</code>. You can try generating some Clawflake ID numbers using the - <a href="https://github.com/n1c00o/clawflake/blob/master/api/nc0/clawflake/generator/v3/generator.proto"> + <a href="https://github.com/n1c00o/clawflake/blob/master/api/nicolaspl/clawflake/generator/v3/generator.proto"> Generator API </a>. </p> - <p>A test client is available in <a - href="https://github.com/n1c00o/clawflake/blob/master/cmd/testclient/main.go" - >cmd/testclient/main.go</a>.</p> - - <h2>License</h2> - + <p>A test client is available in <a + href="https://github.com/n1c00o/clawflake/blob/master/cmd/testclient/main.go">cmd/testclient/main.go</a>.</p> + + <h2>License</h2> + <p> Clawflake is governed by a BSD-style license that can be found in the <a href="https://github.com/n1c00o/clawflake/blob/master/LICENSE"><code>LICENSE</code></a> file. </p> - + <p> - Older codebase was licensed by the Apache License, Version 2.0, however + Older codebase was licensed by the Apache License, Version 2.0, however none of the old code still exists. </p> </main> <footer class="container"> <div class="grid"> - <div><p><strong>© 2022. Nicolas "nc0" P.</strong></p></div> + <div> + <p><strong>© 2022. Nicolas "nc0" P.</strong></p> + </div> <div> <h3>Links</h3> <ul> @@ -184,4 +187,5 @@ </div> </footer> </body> -</html> + +</html>
\ No newline at end of file |
