From: Dan Fuhry Date: Thu, 23 Jul 2026 03:15:49 +0000 (-0400) Subject: generate all .pb.go with bazel, with packages driver for completion X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=82921462e1790ec2c4f97dfbddf0f6ebcea529e0;p=runtime.git generate all .pb.go with bazel, with packages driver for completion --- diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c2b1b05 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,44 @@ +{ + "makefile.configureOnOpen": false, + + // Settings for go/bazel are based on editor setup instructions at + // https://github.com/bazelbuild/rules_go/wiki/Editor-setup#visual-studio-code + "go.goroot": "${workspaceFolder}/bazel-${workspaceFolderBasename}/external/rules_go++go_sdk+main___download_0_linux_amd64/", + "go.enableCodeLens": { + "runtest": false + }, + "gopls": { + "build.workspaceFiles": [ + "**/BUILD", + "**/WORKSPACE", + "**/*.{bzl,bazel}", + ], + "build.directoryFilters": [ + "-bazel-bin", + "-bazel-out", + "-bazel-testlogs", + "-bazel-mypkg", + ], + "formatting.gofumpt": true, + "formatting.local": "go.fuhry.dev/runtime", + "ui.completion.usePlaceholders": true, + "ui.semanticTokens": true, + "ui.codelenses": { + "gc_details": false, + "regenerate_cgo": false, + "generate": false, + "test": false, + "tidy": false, + "upgrade_dependency": false, + "vendor": false + }, + }, + "go.useLanguageServer": true, + "go.buildOnSave": "off", + "go.lintOnSave": "off", + "go.vetOnSave": "off", + "go.toolsEnvVars": { + "GOPACKAGESDRIVER": "${workspaceFolder}/bazel/go-packages-driver" + }, + "go.buildTags": "pkcs11" +} diff --git a/bazel/go-packages-driver b/bazel/go-packages-driver new file mode 100755 index 0000000..8fde2fe --- /dev/null +++ b/bazel/go-packages-driver @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +exec bazel run @rules_go//go/tools/gopackagesdriver -- "$@" \ No newline at end of file diff --git a/cmd/echo_client/BUILD.bazel b/cmd/echo_client/BUILD.bazel index 0f6a746..ef7de92 100644 --- a/cmd/echo_client/BUILD.bazel +++ b/cmd/echo_client/BUILD.bazel @@ -9,7 +9,7 @@ go_multi_library( "//grpc", "//mint", "//mtls", - "//proto/service/echo", + "//proto/service/echo:echo_go_proto", "//utils/context", "//utils/log", ], diff --git a/cmd/echo_server/BUILD.bazel b/cmd/echo_server/BUILD.bazel index bba3355..b95a2b2 100644 --- a/cmd/echo_server/BUILD.bazel +++ b/cmd/echo_server/BUILD.bazel @@ -10,7 +10,7 @@ go_multi_library( "//grpc", "//mint", "//mtls", - "//proto/service/echo", + "//proto/service/echo:echo_go_proto", "//utils/context", "@org_golang_google_grpc//:grpc", ], diff --git a/cmd/ephs_server/BUILD.bazel b/cmd/ephs_server/BUILD.bazel index 9ae3d8e..c10d787 100644 --- a/cmd/ephs_server/BUILD.bazel +++ b/cmd/ephs_server/BUILD.bazel @@ -10,7 +10,7 @@ go_multi_library( "//grpc", "//mint", "//mtls", - "//proto/service/ephs", + "//proto/service/ephs:ephs_go_proto", "//utils/context", "//utils/log", "@org_golang_google_grpc//:grpc", diff --git a/cmd/mint_server/BUILD.bazel b/cmd/mint_server/BUILD.bazel index 98c3e06..0d7e966 100644 --- a/cmd/mint_server/BUILD.bazel +++ b/cmd/mint_server/BUILD.bazel @@ -9,7 +9,7 @@ go_multi_library( "//grpc", "//mint/servicer", "//mtls", - "//proto/service/mint", + "//proto/service/mint:mint_go_proto", "//utils/context", "//utils/log", "@org_golang_google_grpc//:grpc", diff --git a/cmd/mtls_exporter/BUILD.bazel b/cmd/mtls_exporter/BUILD.bazel index 1f4b6ec..a68278f 100644 --- a/cmd/mtls_exporter/BUILD.bazel +++ b/cmd/mtls_exporter/BUILD.bazel @@ -21,14 +21,14 @@ go_multi_binary( systemd_service( name = "mtls-exporter", + args = [ + "--mtls.id=node-exporter", + ], description = "mtls-exporter exports metrics for health and remaining lifetime of mTLS certificates", exe = "mtls_exporter", group = "root", type = "notify", user = "root", - args = [ - "--mtls.id=node-exporter", - ], deps = [ "${const:ExePrefix}metric-collector.service", ], diff --git a/echo/BUILD.bazel b/echo/BUILD.bazel index 8803580..6f94f5c 100644 --- a/echo/BUILD.bazel +++ b/echo/BUILD.bazel @@ -7,7 +7,7 @@ go_multi_library( visibility = ["//visibility:public"], deps = [ "//grpc", - "//proto/service/echo", + "//proto/service/echo:echo_go_proto", "@org_golang_x_text//cases", "@org_golang_x_text//language", ], diff --git a/ephs/BUILD.bazel b/ephs/BUILD.bazel index 3e9dbe1..1a574dc 100644 --- a/ephs/BUILD.bazel +++ b/ephs/BUILD.bazel @@ -11,7 +11,7 @@ go_multi_library( deps = [ "//grpc/client_nodep", "//mtls", - "//proto/service/ephs", + "//proto/service/ephs:ephs_go_proto", "//utils/context", "//utils/hostname", "//utils/log", diff --git a/ephs/ephsll/BUILD.bazel b/ephs/ephsll/BUILD.bazel index 14cc990..5fb1392 100644 --- a/ephs/ephsll/BUILD.bazel +++ b/ephs/ephsll/BUILD.bazel @@ -16,7 +16,7 @@ go_multi_library( "//constants", "//ephs", "//mtls", - "//proto/service/ephs", + "//proto/service/ephs:ephs_go_proto", "//sd", "//utils/context", "//utils/log", diff --git a/ephs/servicer/BUILD.bazel b/ephs/servicer/BUILD.bazel index aa1329d..7fd841c 100644 --- a/ephs/servicer/BUILD.bazel +++ b/ephs/servicer/BUILD.bazel @@ -16,7 +16,7 @@ go_multi_library( "//grpc", "//mtls", "//mtls/fsnotify", - "//proto/service/ephs", + "//proto/service/ephs:ephs_go_proto", "//utils/context", "//utils/log", "//utils/option", diff --git a/mint/BUILD.bazel b/mint/BUILD.bazel index 77af573..42a9886 100644 --- a/mint/BUILD.bazel +++ b/mint/BUILD.bazel @@ -12,7 +12,7 @@ go_multi_library( "//grpc", "//mtls", "//mtls/certutil", - "//proto/service/mint", + "//proto/service/mint:mint_go_proto", "//utils/context", "//utils/hostname", "//utils/log", diff --git a/mint/servicer/BUILD.bazel b/mint/servicer/BUILD.bazel index bb3880f..6845917 100644 --- a/mint/servicer/BUILD.bazel +++ b/mint/servicer/BUILD.bazel @@ -19,7 +19,7 @@ go_multi_library( "//mint/remote_signer", "//mtls", "//mtls/certutil", - "//proto/service/mint", + "//proto/service/mint:mint_go_proto", "//utils/context", "//utils/hostname", "//utils/log", diff --git a/proto/service/echo/BUILD.bazel b/proto/service/echo/BUILD.bazel index afa070e..bf5c62a 100644 --- a/proto/service/echo/BUILD.bazel +++ b/proto/service/echo/BUILD.bazel @@ -1,24 +1,21 @@ -load("//bazel:go.bzl", "go_multi_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@rules_go//proto:def.bzl", "go_proto_library") -filegroup( - name = "go_default_library_protos", +# gazelle:proto package + +proto_library( + name = "echo_proto", srcs = ["echo_server.proto"], visibility = ["//visibility:public"], ) -go_multi_library( - name = "echo", - srcs = [ - "echo_server.pb.go", - "echo_server_grpc.pb.go", +go_proto_library( + name = "echo_go_proto", + compilers = [ + "@rules_go//proto:go_proto", + "@rules_go//proto:go_grpc_v2", ], importpath = "go.fuhry.dev/runtime/proto/service/echo", + proto = ":echo_proto", visibility = ["//visibility:public"], - deps = [ - "@org_golang_google_grpc//:grpc", - "@org_golang_google_grpc//codes", - "@org_golang_google_grpc//status", - "@org_golang_google_protobuf//reflect/protoreflect", - "@org_golang_google_protobuf//runtime/protoimpl", - ], ) diff --git a/proto/service/echo/echo_server.pb.go b/proto/service/echo/echo_server.pb.go deleted file mode 100644 index 17772bd..0000000 --- a/proto/service/echo/echo_server.pb.go +++ /dev/null @@ -1,338 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v4.25.1 -// source: echo_server.proto - -package echo - -import ( - 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) -) - -type EchoRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *EchoRequest) Reset() { - *x = EchoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_echo_server_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EchoRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EchoRequest) ProtoMessage() {} - -func (x *EchoRequest) ProtoReflect() protoreflect.Message { - mi := &file_echo_server_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 EchoRequest.ProtoReflect.Descriptor instead. -func (*EchoRequest) Descriptor() ([]byte, []int) { - return file_echo_server_proto_rawDescGZIP(), []int{0} -} - -func (x *EchoRequest) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type EchoReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *EchoReply) Reset() { - *x = EchoReply{} - if protoimpl.UnsafeEnabled { - mi := &file_echo_server_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EchoReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EchoReply) ProtoMessage() {} - -func (x *EchoReply) ProtoReflect() protoreflect.Message { - mi := &file_echo_server_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 EchoReply.ProtoReflect.Descriptor instead. -func (*EchoReply) Descriptor() ([]byte, []int) { - return file_echo_server_proto_rawDescGZIP(), []int{1} -} - -func (x *EchoReply) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type GreetRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *GreetRequest) Reset() { - *x = GreetRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_echo_server_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GreetRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GreetRequest) ProtoMessage() {} - -func (x *GreetRequest) ProtoReflect() protoreflect.Message { - mi := &file_echo_server_proto_msgTypes[2] - 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 GreetRequest.ProtoReflect.Descriptor instead. -func (*GreetRequest) Descriptor() ([]byte, []int) { - return file_echo_server_proto_rawDescGZIP(), []int{2} -} - -type GreetReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *GreetReply) Reset() { - *x = GreetReply{} - if protoimpl.UnsafeEnabled { - mi := &file_echo_server_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GreetReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GreetReply) ProtoMessage() {} - -func (x *GreetReply) ProtoReflect() protoreflect.Message { - mi := &file_echo_server_proto_msgTypes[3] - 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 GreetReply.ProtoReflect.Descriptor instead. -func (*GreetReply) Descriptor() ([]byte, []int) { - return file_echo_server_proto_rawDescGZIP(), []int{3} -} - -func (x *GreetReply) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -var File_echo_server_proto protoreflect.FileDescriptor - -var file_echo_server_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x65, 0x63, 0x68, 0x6f, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x66, 0x75, 0x68, 0x72, 0x79, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, - 0x6d, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x63, 0x68, 0x6f, 0x22, - 0x27, 0x0a, 0x0b, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x25, 0x0a, 0x09, 0x45, 0x63, 0x68, 0x6f, - 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, - 0x0e, 0x0a, 0x0c, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x26, 0x0a, 0x0a, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0xbd, 0x01, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, - 0x12, 0x58, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x27, 0x2e, 0x66, 0x75, 0x68, 0x72, 0x79, - 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x65, 0x63, 0x68, 0x6f, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x25, 0x2e, 0x66, 0x75, 0x68, 0x72, 0x79, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, - 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x63, 0x68, 0x6f, 0x2e, 0x45, - 0x63, 0x68, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x05, 0x47, 0x72, - 0x65, 0x65, 0x74, 0x12, 0x28, 0x2e, 0x66, 0x75, 0x68, 0x72, 0x79, 0x2e, 0x72, 0x75, 0x6e, 0x74, - 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x63, 0x68, 0x6f, - 0x2e, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, - 0x66, 0x75, 0x68, 0x72, 0x79, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x65, 0x63, 0x68, 0x6f, 0x2e, 0x47, 0x72, 0x65, 0x65, 0x74, - 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x29, 0x5a, 0x27, 0x67, 0x6f, 0x2e, 0x66, 0x75, - 0x68, 0x72, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x65, 0x63, - 0x68, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_echo_server_proto_rawDescOnce sync.Once - file_echo_server_proto_rawDescData = file_echo_server_proto_rawDesc -) - -func file_echo_server_proto_rawDescGZIP() []byte { - file_echo_server_proto_rawDescOnce.Do(func() { - file_echo_server_proto_rawDescData = protoimpl.X.CompressGZIP(file_echo_server_proto_rawDescData) - }) - return file_echo_server_proto_rawDescData -} - -var file_echo_server_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_echo_server_proto_goTypes = []interface{}{ - (*EchoRequest)(nil), // 0: fuhry.runtime.service.echo.EchoRequest - (*EchoReply)(nil), // 1: fuhry.runtime.service.echo.EchoReply - (*GreetRequest)(nil), // 2: fuhry.runtime.service.echo.GreetRequest - (*GreetReply)(nil), // 3: fuhry.runtime.service.echo.GreetReply -} -var file_echo_server_proto_depIdxs = []int32{ - 0, // 0: fuhry.runtime.service.echo.Echo.Echo:input_type -> fuhry.runtime.service.echo.EchoRequest - 2, // 1: fuhry.runtime.service.echo.Echo.Greet:input_type -> fuhry.runtime.service.echo.GreetRequest - 1, // 2: fuhry.runtime.service.echo.Echo.Echo:output_type -> fuhry.runtime.service.echo.EchoReply - 3, // 3: fuhry.runtime.service.echo.Echo.Greet:output_type -> fuhry.runtime.service.echo.GreetReply - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] 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_echo_server_proto_init() } -func file_echo_server_proto_init() { - if File_echo_server_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_echo_server_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EchoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_echo_server_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EchoReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_echo_server_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GreetRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_echo_server_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GreetReply); 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_echo_server_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_echo_server_proto_goTypes, - DependencyIndexes: file_echo_server_proto_depIdxs, - MessageInfos: file_echo_server_proto_msgTypes, - }.Build() - File_echo_server_proto = out.File - file_echo_server_proto_rawDesc = nil - file_echo_server_proto_goTypes = nil - file_echo_server_proto_depIdxs = nil -} diff --git a/proto/service/echo/echo_server_grpc.pb.go b/proto/service/echo/echo_server_grpc.pb.go deleted file mode 100644 index e606890..0000000 --- a/proto/service/echo/echo_server_grpc.pb.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.1 -// source: echo_server.proto - -package echo - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Echo_Echo_FullMethodName = "/fuhry.runtime.service.echo.Echo/Echo" - Echo_Greet_FullMethodName = "/fuhry.runtime.service.echo.Echo/Greet" -) - -// EchoClient is the client API for Echo service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type EchoClient interface { - Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoReply, error) - Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetReply, error) -} - -type echoClient struct { - cc grpc.ClientConnInterface -} - -func NewEchoClient(cc grpc.ClientConnInterface) EchoClient { - return &echoClient{cc} -} - -func (c *echoClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoReply, error) { - out := new(EchoReply) - err := c.cc.Invoke(ctx, Echo_Echo_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *echoClient) Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetReply, error) { - out := new(GreetReply) - err := c.cc.Invoke(ctx, Echo_Greet_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// EchoServer is the server API for Echo service. -// All implementations must embed UnimplementedEchoServer -// for forward compatibility -type EchoServer interface { - Echo(context.Context, *EchoRequest) (*EchoReply, error) - Greet(context.Context, *GreetRequest) (*GreetReply, error) - mustEmbedUnimplementedEchoServer() -} - -// UnimplementedEchoServer must be embedded to have forward compatible implementations. -type UnimplementedEchoServer struct { -} - -func (UnimplementedEchoServer) Echo(context.Context, *EchoRequest) (*EchoReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") -} -func (UnimplementedEchoServer) Greet(context.Context, *GreetRequest) (*GreetReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Greet not implemented") -} -func (UnimplementedEchoServer) mustEmbedUnimplementedEchoServer() {} - -// UnsafeEchoServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to EchoServer will -// result in compilation errors. -type UnsafeEchoServer interface { - mustEmbedUnimplementedEchoServer() -} - -func RegisterEchoServer(s grpc.ServiceRegistrar, srv EchoServer) { - s.RegisterService(&Echo_ServiceDesc, srv) -} - -func _Echo_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EchoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EchoServer).Echo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Echo_Echo_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EchoServer).Echo(ctx, req.(*EchoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Echo_Greet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GreetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EchoServer).Greet(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Echo_Greet_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EchoServer).Greet(ctx, req.(*GreetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Echo_ServiceDesc is the grpc.ServiceDesc for Echo service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Echo_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "fuhry.runtime.service.echo.Echo", - HandlerType: (*EchoServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Echo", - Handler: _Echo_Echo_Handler, - }, - { - MethodName: "Greet", - Handler: _Echo_Greet_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "echo_server.proto", -} diff --git a/proto/service/ephs/BUILD.bazel b/proto/service/ephs/BUILD.bazel index 6d06eea..6fb9575 100644 --- a/proto/service/ephs/BUILD.bazel +++ b/proto/service/ephs/BUILD.bazel @@ -1,30 +1,28 @@ -load("//bazel:go.bzl", "go_multi_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@rules_go//proto:def.bzl", "go_proto_library") -filegroup( - name = "go_default_library_protos", +# gazelle:proto package + +proto_library( + name = "ephs_proto", srcs = [ "ephs_service.proto", "ephs_types.proto", ], visibility = ["//visibility:public"], + deps = [ + "@com_google_protobuf//:empty_proto", + "@com_google_protobuf//:timestamp_proto", + ], ) -go_multi_library( - name = "ephs", - srcs = [ - "ephs_service.pb.go", - "ephs_service_grpc.pb.go", - "ephs_types.pb.go", +go_proto_library( + name = "ephs_go_proto", + compilers = [ + "@rules_go//proto:go_proto", + "@rules_go//proto:go_grpc_v2", ], importpath = "go.fuhry.dev/runtime/proto/service/ephs", + proto = ":ephs_proto", visibility = ["//visibility:public"], - deps = [ - "@org_golang_google_grpc//:grpc", - "@org_golang_google_grpc//codes", - "@org_golang_google_grpc//status", - "@org_golang_google_protobuf//reflect/protoreflect", - "@org_golang_google_protobuf//runtime/protoimpl", - "@org_golang_google_protobuf//types/known/emptypb", - "@org_golang_google_protobuf//types/known/timestamppb", - ], ) diff --git a/proto/service/ephs/ephs_service.pb.go b/proto/service/ephs/ephs_service.pb.go deleted file mode 100644 index 359d038..0000000 --- a/proto/service/ephs/ephs_service.pb.go +++ /dev/null @@ -1,559 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.0 -// source: ephs_service.proto - -package ephs - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -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) -) - -type WatchResponse_Event int32 - -const ( - WatchResponse_UNKNOWN WatchResponse_Event = 0 - WatchResponse_CREATE WatchResponse_Event = 1 - WatchResponse_MODIFY WatchResponse_Event = 2 - WatchResponse_DELETE WatchResponse_Event = 3 -) - -// Enum value maps for WatchResponse_Event. -var ( - WatchResponse_Event_name = map[int32]string{ - 0: "UNKNOWN", - 1: "CREATE", - 2: "MODIFY", - 3: "DELETE", - } - WatchResponse_Event_value = map[string]int32{ - "UNKNOWN": 0, - "CREATE": 1, - "MODIFY": 2, - "DELETE": 3, - } -) - -func (x WatchResponse_Event) Enum() *WatchResponse_Event { - p := new(WatchResponse_Event) - *p = x - return p -} - -func (x WatchResponse_Event) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (WatchResponse_Event) Descriptor() protoreflect.EnumDescriptor { - return file_ephs_service_proto_enumTypes[0].Descriptor() -} - -func (WatchResponse_Event) Type() protoreflect.EnumType { - return &file_ephs_service_proto_enumTypes[0] -} - -func (x WatchResponse_Event) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use WatchResponse_Event.Descriptor instead. -func (WatchResponse_Event) EnumDescriptor() ([]byte, []int) { - return file_ephs_service_proto_rawDescGZIP(), []int{6, 0} -} - -type GetRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetRequest) Reset() { - *x = GetRequest{} - mi := &file_ephs_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRequest) ProtoMessage() {} - -func (x *GetRequest) ProtoReflect() protoreflect.Message { - mi := &file_ephs_service_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. -func (*GetRequest) Descriptor() ([]byte, []int) { - return file_ephs_service_proto_rawDescGZIP(), []int{0} -} - -func (x *GetRequest) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -type DeleteRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Recursive bool `protobuf:"varint,2,opt,name=recursive,proto3" json:"recursive,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteRequest) Reset() { - *x = DeleteRequest{} - mi := &file_ephs_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRequest) ProtoMessage() {} - -func (x *DeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_ephs_service_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. -func (*DeleteRequest) Descriptor() ([]byte, []int) { - return file_ephs_service_proto_rawDescGZIP(), []int{1} -} - -func (x *DeleteRequest) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *DeleteRequest) GetRecursive() bool { - if x != nil { - return x.Recursive - } - return false -} - -type MkDirRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Recursive bool `protobuf:"varint,2,opt,name=recursive,proto3" json:"recursive,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MkDirRequest) Reset() { - *x = MkDirRequest{} - mi := &file_ephs_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MkDirRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MkDirRequest) ProtoMessage() {} - -func (x *MkDirRequest) ProtoReflect() protoreflect.Message { - mi := &file_ephs_service_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MkDirRequest.ProtoReflect.Descriptor instead. -func (*MkDirRequest) Descriptor() ([]byte, []int) { - return file_ephs_service_proto_rawDescGZIP(), []int{2} -} - -func (x *MkDirRequest) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *MkDirRequest) GetRecursive() bool { - if x != nil { - return x.Recursive - } - return false -} - -type GetResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Entry *FsEntry `protobuf:"bytes,1,opt,name=entry,proto3" json:"entry,omitempty"` - Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetResponse) Reset() { - *x = GetResponse{} - mi := &file_ephs_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResponse) ProtoMessage() {} - -func (x *GetResponse) ProtoReflect() protoreflect.Message { - mi := &file_ephs_service_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. -func (*GetResponse) Descriptor() ([]byte, []int) { - return file_ephs_service_proto_rawDescGZIP(), []int{3} -} - -func (x *GetResponse) GetEntry() *FsEntry { - if x != nil { - return x.Entry - } - return nil -} - -func (x *GetResponse) GetChunk() []byte { - if x != nil { - return x.Chunk - } - return nil -} - -type StatResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Entry *FsEntry `protobuf:"bytes,1,opt,name=entry,proto3" json:"entry,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StatResponse) Reset() { - *x = StatResponse{} - mi := &file_ephs_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StatResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatResponse) ProtoMessage() {} - -func (x *StatResponse) ProtoReflect() protoreflect.Message { - mi := &file_ephs_service_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StatResponse.ProtoReflect.Descriptor instead. -func (*StatResponse) Descriptor() ([]byte, []int) { - return file_ephs_service_proto_rawDescGZIP(), []int{4} -} - -func (x *StatResponse) GetEntry() *FsEntry { - if x != nil { - return x.Entry - } - return nil -} - -type PutRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` - Size uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` - Chunk []byte `protobuf:"bytes,4,opt,name=chunk,proto3" json:"chunk,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PutRequest) Reset() { - *x = PutRequest{} - mi := &file_ephs_service_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PutRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PutRequest) ProtoMessage() {} - -func (x *PutRequest) ProtoReflect() protoreflect.Message { - mi := &file_ephs_service_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PutRequest.ProtoReflect.Descriptor instead. -func (*PutRequest) Descriptor() ([]byte, []int) { - return file_ephs_service_proto_rawDescGZIP(), []int{5} -} - -func (x *PutRequest) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *PutRequest) GetVersion() uint64 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *PutRequest) GetSize() uint64 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *PutRequest) GetChunk() []byte { - if x != nil { - return x.Chunk - } - return nil -} - -type WatchResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Entry *FsEntry `protobuf:"bytes,1,opt,name=entry,proto3" json:"entry,omitempty"` - Event WatchResponse_Event `protobuf:"varint,2,opt,name=event,proto3,enum=fuhry.runtime.service.ephs.WatchResponse_Event" json:"event,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *WatchResponse) Reset() { - *x = WatchResponse{} - mi := &file_ephs_service_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *WatchResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WatchResponse) ProtoMessage() {} - -func (x *WatchResponse) ProtoReflect() protoreflect.Message { - mi := &file_ephs_service_proto_msgTypes[6] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WatchResponse.ProtoReflect.Descriptor instead. -func (*WatchResponse) Descriptor() ([]byte, []int) { - return file_ephs_service_proto_rawDescGZIP(), []int{6} -} - -func (x *WatchResponse) GetEntry() *FsEntry { - if x != nil { - return x.Entry - } - return nil -} - -func (x *WatchResponse) GetEvent() WatchResponse_Event { - if x != nil { - return x.Event - } - return WatchResponse_UNKNOWN -} - -var File_ephs_service_proto protoreflect.FileDescriptor - -const file_ephs_service_proto_rawDesc = "" + - "\n" + - "\x12ephs_service.proto\x12\x1afuhry.runtime.service.ephs\x1a\x1bgoogle/protobuf/empty.proto\x1a\x10ephs_types.proto\" \n" + - "\n" + - "GetRequest\x12\x12\n" + - "\x04path\x18\x01 \x01(\tR\x04path\"A\n" + - "\rDeleteRequest\x12\x12\n" + - "\x04path\x18\x01 \x01(\tR\x04path\x12\x1c\n" + - "\trecursive\x18\x02 \x01(\bR\trecursive\"@\n" + - "\fMkDirRequest\x12\x12\n" + - "\x04path\x18\x01 \x01(\tR\x04path\x12\x1c\n" + - "\trecursive\x18\x02 \x01(\bR\trecursive\"^\n" + - "\vGetResponse\x129\n" + - "\x05entry\x18\x01 \x01(\v2#.fuhry.runtime.service.ephs.FsEntryR\x05entry\x12\x14\n" + - "\x05chunk\x18\x02 \x01(\fR\x05chunk\"I\n" + - "\fStatResponse\x129\n" + - "\x05entry\x18\x01 \x01(\v2#.fuhry.runtime.service.ephs.FsEntryR\x05entry\"d\n" + - "\n" + - "PutRequest\x12\x12\n" + - "\x04path\x18\x01 \x01(\tR\x04path\x12\x18\n" + - "\aversion\x18\x02 \x01(\x04R\aversion\x12\x12\n" + - "\x04size\x18\x03 \x01(\x04R\x04size\x12\x14\n" + - "\x05chunk\x18\x04 \x01(\fR\x05chunk\"\xcb\x01\n" + - "\rWatchResponse\x129\n" + - "\x05entry\x18\x01 \x01(\v2#.fuhry.runtime.service.ephs.FsEntryR\x05entry\x12E\n" + - "\x05event\x18\x02 \x01(\x0e2/.fuhry.runtime.service.ephs.WatchResponse.EventR\x05event\"8\n" + - "\x05Event\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\n" + - "\n" + - "\x06CREATE\x10\x01\x12\n" + - "\n" + - "\x06MODIFY\x10\x02\x12\n" + - "\n" + - "\x06DELETE\x10\x032\x97\x04\n" + - "\x04Ephs\x12Z\n" + - "\x03Get\x12&.fuhry.runtime.service.ephs.GetRequest\x1a'.fuhry.runtime.service.ephs.GetResponse\"\x000\x01\x12[\n" + - "\x03Put\x12&.fuhry.runtime.service.ephs.PutRequest\x1a(.fuhry.runtime.service.ephs.StatResponse\"\x00(\x01\x12Z\n" + - "\x04Stat\x12&.fuhry.runtime.service.ephs.GetRequest\x1a(.fuhry.runtime.service.ephs.StatResponse\"\x00\x12^\n" + - "\x05Watch\x12&.fuhry.runtime.service.ephs.GetRequest\x1a).fuhry.runtime.service.ephs.WatchResponse\"\x000\x01\x12K\n" + - "\x05MkDir\x12(.fuhry.runtime.service.ephs.MkDirRequest\x1a\x16.google.protobuf.Empty\"\x00\x12M\n" + - "\x06Delete\x12).fuhry.runtime.service.ephs.DeleteRequest\x1a\x16.google.protobuf.Empty\"\x00B)Z'go.fuhry.dev/runtime/proto/service/ephsb\x06proto3" - -var ( - file_ephs_service_proto_rawDescOnce sync.Once - file_ephs_service_proto_rawDescData []byte -) - -func file_ephs_service_proto_rawDescGZIP() []byte { - file_ephs_service_proto_rawDescOnce.Do(func() { - file_ephs_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ephs_service_proto_rawDesc), len(file_ephs_service_proto_rawDesc))) - }) - return file_ephs_service_proto_rawDescData -} - -var file_ephs_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_ephs_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_ephs_service_proto_goTypes = []any{ - (WatchResponse_Event)(0), // 0: fuhry.runtime.service.ephs.WatchResponse.Event - (*GetRequest)(nil), // 1: fuhry.runtime.service.ephs.GetRequest - (*DeleteRequest)(nil), // 2: fuhry.runtime.service.ephs.DeleteRequest - (*MkDirRequest)(nil), // 3: fuhry.runtime.service.ephs.MkDirRequest - (*GetResponse)(nil), // 4: fuhry.runtime.service.ephs.GetResponse - (*StatResponse)(nil), // 5: fuhry.runtime.service.ephs.StatResponse - (*PutRequest)(nil), // 6: fuhry.runtime.service.ephs.PutRequest - (*WatchResponse)(nil), // 7: fuhry.runtime.service.ephs.WatchResponse - (*FsEntry)(nil), // 8: fuhry.runtime.service.ephs.FsEntry - (*emptypb.Empty)(nil), // 9: google.protobuf.Empty -} -var file_ephs_service_proto_depIdxs = []int32{ - 8, // 0: fuhry.runtime.service.ephs.GetResponse.entry:type_name -> fuhry.runtime.service.ephs.FsEntry - 8, // 1: fuhry.runtime.service.ephs.StatResponse.entry:type_name -> fuhry.runtime.service.ephs.FsEntry - 8, // 2: fuhry.runtime.service.ephs.WatchResponse.entry:type_name -> fuhry.runtime.service.ephs.FsEntry - 0, // 3: fuhry.runtime.service.ephs.WatchResponse.event:type_name -> fuhry.runtime.service.ephs.WatchResponse.Event - 1, // 4: fuhry.runtime.service.ephs.Ephs.Get:input_type -> fuhry.runtime.service.ephs.GetRequest - 6, // 5: fuhry.runtime.service.ephs.Ephs.Put:input_type -> fuhry.runtime.service.ephs.PutRequest - 1, // 6: fuhry.runtime.service.ephs.Ephs.Stat:input_type -> fuhry.runtime.service.ephs.GetRequest - 1, // 7: fuhry.runtime.service.ephs.Ephs.Watch:input_type -> fuhry.runtime.service.ephs.GetRequest - 3, // 8: fuhry.runtime.service.ephs.Ephs.MkDir:input_type -> fuhry.runtime.service.ephs.MkDirRequest - 2, // 9: fuhry.runtime.service.ephs.Ephs.Delete:input_type -> fuhry.runtime.service.ephs.DeleteRequest - 4, // 10: fuhry.runtime.service.ephs.Ephs.Get:output_type -> fuhry.runtime.service.ephs.GetResponse - 5, // 11: fuhry.runtime.service.ephs.Ephs.Put:output_type -> fuhry.runtime.service.ephs.StatResponse - 5, // 12: fuhry.runtime.service.ephs.Ephs.Stat:output_type -> fuhry.runtime.service.ephs.StatResponse - 7, // 13: fuhry.runtime.service.ephs.Ephs.Watch:output_type -> fuhry.runtime.service.ephs.WatchResponse - 9, // 14: fuhry.runtime.service.ephs.Ephs.MkDir:output_type -> google.protobuf.Empty - 9, // 15: fuhry.runtime.service.ephs.Ephs.Delete:output_type -> google.protobuf.Empty - 10, // [10:16] is the sub-list for method output_type - 4, // [4:10] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_ephs_service_proto_init() } -func file_ephs_service_proto_init() { - if File_ephs_service_proto != nil { - return - } - file_ephs_types_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_ephs_service_proto_rawDesc), len(file_ephs_service_proto_rawDesc)), - NumEnums: 1, - NumMessages: 7, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_ephs_service_proto_goTypes, - DependencyIndexes: file_ephs_service_proto_depIdxs, - EnumInfos: file_ephs_service_proto_enumTypes, - MessageInfos: file_ephs_service_proto_msgTypes, - }.Build() - File_ephs_service_proto = out.File - file_ephs_service_proto_goTypes = nil - file_ephs_service_proto_depIdxs = nil -} diff --git a/proto/service/ephs/ephs_service.proto b/proto/service/ephs/ephs_service.proto index 3203f04..a5713e0 100644 --- a/proto/service/ephs/ephs_service.proto +++ b/proto/service/ephs/ephs_service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package fuhry.runtime.service.ephs; import "google/protobuf/empty.proto"; -import "ephs_types.proto"; +import "proto/service/ephs/ephs_types.proto"; option go_package = "go.fuhry.dev/runtime/proto/service/ephs"; diff --git a/proto/service/ephs/ephs_service_grpc.pb.go b/proto/service/ephs/ephs_service_grpc.pb.go deleted file mode 100644 index 4b55260..0000000 --- a/proto/service/ephs/ephs_service_grpc.pb.go +++ /dev/null @@ -1,384 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v6.33.0 -// source: ephs_service.proto - -package ephs - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Ephs_Get_FullMethodName = "/fuhry.runtime.service.ephs.Ephs/Get" - Ephs_Put_FullMethodName = "/fuhry.runtime.service.ephs.Ephs/Put" - Ephs_Stat_FullMethodName = "/fuhry.runtime.service.ephs.Ephs/Stat" - Ephs_Watch_FullMethodName = "/fuhry.runtime.service.ephs.Ephs/Watch" - Ephs_MkDir_FullMethodName = "/fuhry.runtime.service.ephs.Ephs/MkDir" - Ephs_Delete_FullMethodName = "/fuhry.runtime.service.ephs.Ephs/Delete" -) - -// EphsClient is the client API for Ephs service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type EphsClient interface { - Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (Ephs_GetClient, error) - Put(ctx context.Context, opts ...grpc.CallOption) (Ephs_PutClient, error) - Stat(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*StatResponse, error) - Watch(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (Ephs_WatchClient, error) - MkDir(ctx context.Context, in *MkDirRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type ephsClient struct { - cc grpc.ClientConnInterface -} - -func NewEphsClient(cc grpc.ClientConnInterface) EphsClient { - return &ephsClient{cc} -} - -func (c *ephsClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (Ephs_GetClient, error) { - stream, err := c.cc.NewStream(ctx, &Ephs_ServiceDesc.Streams[0], Ephs_Get_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &ephsGetClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Ephs_GetClient interface { - Recv() (*GetResponse, error) - grpc.ClientStream -} - -type ephsGetClient struct { - grpc.ClientStream -} - -func (x *ephsGetClient) Recv() (*GetResponse, error) { - m := new(GetResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *ephsClient) Put(ctx context.Context, opts ...grpc.CallOption) (Ephs_PutClient, error) { - stream, err := c.cc.NewStream(ctx, &Ephs_ServiceDesc.Streams[1], Ephs_Put_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &ephsPutClient{stream} - return x, nil -} - -type Ephs_PutClient interface { - Send(*PutRequest) error - CloseAndRecv() (*StatResponse, error) - grpc.ClientStream -} - -type ephsPutClient struct { - grpc.ClientStream -} - -func (x *ephsPutClient) Send(m *PutRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *ephsPutClient) CloseAndRecv() (*StatResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(StatResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *ephsClient) Stat(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*StatResponse, error) { - out := new(StatResponse) - err := c.cc.Invoke(ctx, Ephs_Stat_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ephsClient) Watch(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (Ephs_WatchClient, error) { - stream, err := c.cc.NewStream(ctx, &Ephs_ServiceDesc.Streams[2], Ephs_Watch_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &ephsWatchClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Ephs_WatchClient interface { - Recv() (*WatchResponse, error) - grpc.ClientStream -} - -type ephsWatchClient struct { - grpc.ClientStream -} - -func (x *ephsWatchClient) Recv() (*WatchResponse, error) { - m := new(WatchResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *ephsClient) MkDir(ctx context.Context, in *MkDirRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, Ephs_MkDir_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ephsClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, Ephs_Delete_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// EphsServer is the server API for Ephs service. -// All implementations must embed UnimplementedEphsServer -// for forward compatibility -type EphsServer interface { - Get(*GetRequest, Ephs_GetServer) error - Put(Ephs_PutServer) error - Stat(context.Context, *GetRequest) (*StatResponse, error) - Watch(*GetRequest, Ephs_WatchServer) error - MkDir(context.Context, *MkDirRequest) (*emptypb.Empty, error) - Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error) - mustEmbedUnimplementedEphsServer() -} - -// UnimplementedEphsServer must be embedded to have forward compatible implementations. -type UnimplementedEphsServer struct { -} - -func (UnimplementedEphsServer) Get(*GetRequest, Ephs_GetServer) error { - return status.Errorf(codes.Unimplemented, "method Get not implemented") -} -func (UnimplementedEphsServer) Put(Ephs_PutServer) error { - return status.Errorf(codes.Unimplemented, "method Put not implemented") -} -func (UnimplementedEphsServer) Stat(context.Context, *GetRequest) (*StatResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Stat not implemented") -} -func (UnimplementedEphsServer) Watch(*GetRequest, Ephs_WatchServer) error { - return status.Errorf(codes.Unimplemented, "method Watch not implemented") -} -func (UnimplementedEphsServer) MkDir(context.Context, *MkDirRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method MkDir not implemented") -} -func (UnimplementedEphsServer) Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") -} -func (UnimplementedEphsServer) mustEmbedUnimplementedEphsServer() {} - -// UnsafeEphsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to EphsServer will -// result in compilation errors. -type UnsafeEphsServer interface { - mustEmbedUnimplementedEphsServer() -} - -func RegisterEphsServer(s grpc.ServiceRegistrar, srv EphsServer) { - s.RegisterService(&Ephs_ServiceDesc, srv) -} - -func _Ephs_Get_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(GetRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(EphsServer).Get(m, &ephsGetServer{stream}) -} - -type Ephs_GetServer interface { - Send(*GetResponse) error - grpc.ServerStream -} - -type ephsGetServer struct { - grpc.ServerStream -} - -func (x *ephsGetServer) Send(m *GetResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Ephs_Put_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(EphsServer).Put(&ephsPutServer{stream}) -} - -type Ephs_PutServer interface { - SendAndClose(*StatResponse) error - Recv() (*PutRequest, error) - grpc.ServerStream -} - -type ephsPutServer struct { - grpc.ServerStream -} - -func (x *ephsPutServer) SendAndClose(m *StatResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *ephsPutServer) Recv() (*PutRequest, error) { - m := new(PutRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Ephs_Stat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EphsServer).Stat(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Ephs_Stat_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EphsServer).Stat(ctx, req.(*GetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Ephs_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(GetRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(EphsServer).Watch(m, &ephsWatchServer{stream}) -} - -type Ephs_WatchServer interface { - Send(*WatchResponse) error - grpc.ServerStream -} - -type ephsWatchServer struct { - grpc.ServerStream -} - -func (x *ephsWatchServer) Send(m *WatchResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Ephs_MkDir_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MkDirRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EphsServer).MkDir(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Ephs_MkDir_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EphsServer).MkDir(ctx, req.(*MkDirRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Ephs_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EphsServer).Delete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Ephs_Delete_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EphsServer).Delete(ctx, req.(*DeleteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Ephs_ServiceDesc is the grpc.ServiceDesc for Ephs service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Ephs_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "fuhry.runtime.service.ephs.Ephs", - HandlerType: (*EphsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Stat", - Handler: _Ephs_Stat_Handler, - }, - { - MethodName: "MkDir", - Handler: _Ephs_MkDir_Handler, - }, - { - MethodName: "Delete", - Handler: _Ephs_Delete_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Get", - Handler: _Ephs_Get_Handler, - ServerStreams: true, - }, - { - StreamName: "Put", - Handler: _Ephs_Put_Handler, - ClientStreams: true, - }, - { - StreamName: "Watch", - Handler: _Ephs_Watch_Handler, - ServerStreams: true, - }, - }, - Metadata: "ephs_service.proto", -} diff --git a/proto/service/ephs/ephs_types.pb.go b/proto/service/ephs/ephs_types.pb.go deleted file mode 100644 index b0e281c..0000000 --- a/proto/service/ephs/ephs_types.pb.go +++ /dev/null @@ -1,545 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.0 -// source: ephs_types.proto - -package ephs - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -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) -) - -type FsEntry_File_Compression int32 - -const ( - FsEntry_File_UNCOMPRESSED FsEntry_File_Compression = 0 - FsEntry_File_GZIP FsEntry_File_Compression = 1 -) - -// Enum value maps for FsEntry_File_Compression. -var ( - FsEntry_File_Compression_name = map[int32]string{ - 0: "UNCOMPRESSED", - 1: "GZIP", - } - FsEntry_File_Compression_value = map[string]int32{ - "UNCOMPRESSED": 0, - "GZIP": 1, - } -) - -func (x FsEntry_File_Compression) Enum() *FsEntry_File_Compression { - p := new(FsEntry_File_Compression) - *p = x - return p -} - -func (x FsEntry_File_Compression) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (FsEntry_File_Compression) Descriptor() protoreflect.EnumDescriptor { - return file_ephs_types_proto_enumTypes[0].Descriptor() -} - -func (FsEntry_File_Compression) Type() protoreflect.EnumType { - return &file_ephs_types_proto_enumTypes[0] -} - -func (x FsEntry_File_Compression) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use FsEntry_File_Compression.Descriptor instead. -func (FsEntry_File_Compression) EnumDescriptor() ([]byte, []int) { - return file_ephs_types_proto_rawDescGZIP(), []int{0, 1, 0} -} - -type FsEntry struct { - state protoimpl.MessageState `protogen:"open.v1"` - Created *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=created,proto3" json:"created,omitempty"` - Modified *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=modified,proto3" json:"modified,omitempty"` - Version uint64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` - Size uint64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` - Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"` - Content *FsEntry_Content `protobuf:"bytes,6,opt,name=content,proto3" json:"content,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FsEntry) Reset() { - *x = FsEntry{} - mi := &file_ephs_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FsEntry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FsEntry) ProtoMessage() {} - -func (x *FsEntry) ProtoReflect() protoreflect.Message { - mi := &file_ephs_types_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FsEntry.ProtoReflect.Descriptor instead. -func (*FsEntry) Descriptor() ([]byte, []int) { - return file_ephs_types_proto_rawDescGZIP(), []int{0} -} - -func (x *FsEntry) GetCreated() *timestamppb.Timestamp { - if x != nil { - return x.Created - } - return nil -} - -func (x *FsEntry) GetModified() *timestamppb.Timestamp { - if x != nil { - return x.Modified - } - return nil -} - -func (x *FsEntry) GetVersion() uint64 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *FsEntry) GetSize() uint64 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *FsEntry) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *FsEntry) GetContent() *FsEntry_Content { - if x != nil { - return x.Content - } - return nil -} - -type FsEntry_Directory struct { - state protoimpl.MessageState `protogen:"open.v1"` - Entries []*FsEntry_Directory_DirectoryEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FsEntry_Directory) Reset() { - *x = FsEntry_Directory{} - mi := &file_ephs_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FsEntry_Directory) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FsEntry_Directory) ProtoMessage() {} - -func (x *FsEntry_Directory) ProtoReflect() protoreflect.Message { - mi := &file_ephs_types_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FsEntry_Directory.ProtoReflect.Descriptor instead. -func (*FsEntry_Directory) Descriptor() ([]byte, []int) { - return file_ephs_types_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *FsEntry_Directory) GetEntries() []*FsEntry_Directory_DirectoryEntry { - if x != nil { - return x.Entries - } - return nil -} - -type FsEntry_File struct { - state protoimpl.MessageState `protogen:"open.v1"` - Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` - Compression FsEntry_File_Compression `protobuf:"varint,2,opt,name=compression,proto3,enum=fuhry.runtime.service.ephs.FsEntry_File_Compression" json:"compression,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FsEntry_File) Reset() { - *x = FsEntry_File{} - mi := &file_ephs_types_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FsEntry_File) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FsEntry_File) ProtoMessage() {} - -func (x *FsEntry_File) ProtoReflect() protoreflect.Message { - mi := &file_ephs_types_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FsEntry_File.ProtoReflect.Descriptor instead. -func (*FsEntry_File) Descriptor() ([]byte, []int) { - return file_ephs_types_proto_rawDescGZIP(), []int{0, 1} -} - -func (x *FsEntry_File) GetContent() []byte { - if x != nil { - return x.Content - } - return nil -} - -func (x *FsEntry_File) GetCompression() FsEntry_File_Compression { - if x != nil { - return x.Compression - } - return FsEntry_File_UNCOMPRESSED -} - -type FsEntry_LargeFile struct { - state protoimpl.MessageState `protogen:"open.v1"` - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FsEntry_LargeFile) Reset() { - *x = FsEntry_LargeFile{} - mi := &file_ephs_types_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FsEntry_LargeFile) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FsEntry_LargeFile) ProtoMessage() {} - -func (x *FsEntry_LargeFile) ProtoReflect() protoreflect.Message { - mi := &file_ephs_types_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FsEntry_LargeFile.ProtoReflect.Descriptor instead. -func (*FsEntry_LargeFile) Descriptor() ([]byte, []int) { - return file_ephs_types_proto_rawDescGZIP(), []int{0, 2} -} - -func (x *FsEntry_LargeFile) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -type FsEntry_Content struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Content: - // - // *FsEntry_Content_Directory - // *FsEntry_Content_File - // *FsEntry_Content_LargeFile - Content isFsEntry_Content_Content `protobuf_oneof:"content"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FsEntry_Content) Reset() { - *x = FsEntry_Content{} - mi := &file_ephs_types_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FsEntry_Content) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FsEntry_Content) ProtoMessage() {} - -func (x *FsEntry_Content) ProtoReflect() protoreflect.Message { - mi := &file_ephs_types_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FsEntry_Content.ProtoReflect.Descriptor instead. -func (*FsEntry_Content) Descriptor() ([]byte, []int) { - return file_ephs_types_proto_rawDescGZIP(), []int{0, 3} -} - -func (x *FsEntry_Content) GetContent() isFsEntry_Content_Content { - if x != nil { - return x.Content - } - return nil -} - -func (x *FsEntry_Content) GetDirectory() *FsEntry_Directory { - if x != nil { - if x, ok := x.Content.(*FsEntry_Content_Directory); ok { - return x.Directory - } - } - return nil -} - -func (x *FsEntry_Content) GetFile() *FsEntry_File { - if x != nil { - if x, ok := x.Content.(*FsEntry_Content_File); ok { - return x.File - } - } - return nil -} - -func (x *FsEntry_Content) GetLargeFile() *FsEntry_LargeFile { - if x != nil { - if x, ok := x.Content.(*FsEntry_Content_LargeFile); ok { - return x.LargeFile - } - } - return nil -} - -type isFsEntry_Content_Content interface { - isFsEntry_Content_Content() -} - -type FsEntry_Content_Directory struct { - Directory *FsEntry_Directory `protobuf:"bytes,1,opt,name=directory,proto3,oneof"` -} - -type FsEntry_Content_File struct { - File *FsEntry_File `protobuf:"bytes,2,opt,name=file,proto3,oneof"` -} - -type FsEntry_Content_LargeFile struct { - LargeFile *FsEntry_LargeFile `protobuf:"bytes,3,opt,name=large_file,json=largeFile,proto3,oneof"` -} - -func (*FsEntry_Content_Directory) isFsEntry_Content_Content() {} - -func (*FsEntry_Content_File) isFsEntry_Content_Content() {} - -func (*FsEntry_Content_LargeFile) isFsEntry_Content_Content() {} - -type FsEntry_Directory_DirectoryEntry struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Directory bool `protobuf:"varint,2,opt,name=directory,proto3" json:"directory,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FsEntry_Directory_DirectoryEntry) Reset() { - *x = FsEntry_Directory_DirectoryEntry{} - mi := &file_ephs_types_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FsEntry_Directory_DirectoryEntry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FsEntry_Directory_DirectoryEntry) ProtoMessage() {} - -func (x *FsEntry_Directory_DirectoryEntry) ProtoReflect() protoreflect.Message { - mi := &file_ephs_types_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FsEntry_Directory_DirectoryEntry.ProtoReflect.Descriptor instead. -func (*FsEntry_Directory_DirectoryEntry) Descriptor() ([]byte, []int) { - return file_ephs_types_proto_rawDescGZIP(), []int{0, 0, 0} -} - -func (x *FsEntry_Directory_DirectoryEntry) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *FsEntry_Directory_DirectoryEntry) GetDirectory() bool { - if x != nil { - return x.Directory - } - return false -} - -var File_ephs_types_proto protoreflect.FileDescriptor - -const file_ephs_types_proto_rawDesc = "" + - "\n" + - "\x10ephs_types.proto\x12\x1afuhry.runtime.service.ephs\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe7\x06\n" + - "\aFsEntry\x124\n" + - "\acreated\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\acreated\x126\n" + - "\bmodified\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\bmodified\x12\x18\n" + - "\aversion\x18\x03 \x01(\x04R\aversion\x12\x12\n" + - "\x04size\x18\x04 \x01(\x04R\x04size\x12\x14\n" + - "\x05owner\x18\x05 \x01(\tR\x05owner\x12E\n" + - "\acontent\x18\x06 \x01(\v2+.fuhry.runtime.service.ephs.FsEntry.ContentR\acontent\x1a\xa7\x01\n" + - "\tDirectory\x12V\n" + - "\aentries\x18\x01 \x03(\v2<.fuhry.runtime.service.ephs.FsEntry.Directory.DirectoryEntryR\aentries\x1aB\n" + - "\x0eDirectoryEntry\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x1c\n" + - "\tdirectory\x18\x02 \x01(\bR\tdirectory\x1a\xa3\x01\n" + - "\x04File\x12\x18\n" + - "\acontent\x18\x01 \x01(\fR\acontent\x12V\n" + - "\vcompression\x18\x02 \x01(\x0e24.fuhry.runtime.service.ephs.FsEntry.File.CompressionR\vcompression\")\n" + - "\vCompression\x12\x10\n" + - "\fUNCOMPRESSED\x10\x00\x12\b\n" + - "\x04GZIP\x10\x01\x1a\x1d\n" + - "\tLargeFile\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x1a\xf3\x01\n" + - "\aContent\x12M\n" + - "\tdirectory\x18\x01 \x01(\v2-.fuhry.runtime.service.ephs.FsEntry.DirectoryH\x00R\tdirectory\x12>\n" + - "\x04file\x18\x02 \x01(\v2(.fuhry.runtime.service.ephs.FsEntry.FileH\x00R\x04file\x12N\n" + - "\n" + - "large_file\x18\x03 \x01(\v2-.fuhry.runtime.service.ephs.FsEntry.LargeFileH\x00R\tlargeFileB\t\n" + - "\acontentB)Z'go.fuhry.dev/runtime/proto/service/ephsb\x06proto3" - -var ( - file_ephs_types_proto_rawDescOnce sync.Once - file_ephs_types_proto_rawDescData []byte -) - -func file_ephs_types_proto_rawDescGZIP() []byte { - file_ephs_types_proto_rawDescOnce.Do(func() { - file_ephs_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ephs_types_proto_rawDesc), len(file_ephs_types_proto_rawDesc))) - }) - return file_ephs_types_proto_rawDescData -} - -var file_ephs_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_ephs_types_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_ephs_types_proto_goTypes = []any{ - (FsEntry_File_Compression)(0), // 0: fuhry.runtime.service.ephs.FsEntry.File.Compression - (*FsEntry)(nil), // 1: fuhry.runtime.service.ephs.FsEntry - (*FsEntry_Directory)(nil), // 2: fuhry.runtime.service.ephs.FsEntry.Directory - (*FsEntry_File)(nil), // 3: fuhry.runtime.service.ephs.FsEntry.File - (*FsEntry_LargeFile)(nil), // 4: fuhry.runtime.service.ephs.FsEntry.LargeFile - (*FsEntry_Content)(nil), // 5: fuhry.runtime.service.ephs.FsEntry.Content - (*FsEntry_Directory_DirectoryEntry)(nil), // 6: fuhry.runtime.service.ephs.FsEntry.Directory.DirectoryEntry - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp -} -var file_ephs_types_proto_depIdxs = []int32{ - 7, // 0: fuhry.runtime.service.ephs.FsEntry.created:type_name -> google.protobuf.Timestamp - 7, // 1: fuhry.runtime.service.ephs.FsEntry.modified:type_name -> google.protobuf.Timestamp - 5, // 2: fuhry.runtime.service.ephs.FsEntry.content:type_name -> fuhry.runtime.service.ephs.FsEntry.Content - 6, // 3: fuhry.runtime.service.ephs.FsEntry.Directory.entries:type_name -> fuhry.runtime.service.ephs.FsEntry.Directory.DirectoryEntry - 0, // 4: fuhry.runtime.service.ephs.FsEntry.File.compression:type_name -> fuhry.runtime.service.ephs.FsEntry.File.Compression - 2, // 5: fuhry.runtime.service.ephs.FsEntry.Content.directory:type_name -> fuhry.runtime.service.ephs.FsEntry.Directory - 3, // 6: fuhry.runtime.service.ephs.FsEntry.Content.file:type_name -> fuhry.runtime.service.ephs.FsEntry.File - 4, // 7: fuhry.runtime.service.ephs.FsEntry.Content.large_file:type_name -> fuhry.runtime.service.ephs.FsEntry.LargeFile - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_ephs_types_proto_init() } -func file_ephs_types_proto_init() { - if File_ephs_types_proto != nil { - return - } - file_ephs_types_proto_msgTypes[4].OneofWrappers = []any{ - (*FsEntry_Content_Directory)(nil), - (*FsEntry_Content_File)(nil), - (*FsEntry_Content_LargeFile)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_ephs_types_proto_rawDesc), len(file_ephs_types_proto_rawDesc)), - NumEnums: 1, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_ephs_types_proto_goTypes, - DependencyIndexes: file_ephs_types_proto_depIdxs, - EnumInfos: file_ephs_types_proto_enumTypes, - MessageInfos: file_ephs_types_proto_msgTypes, - }.Build() - File_ephs_types_proto = out.File - file_ephs_types_proto_goTypes = nil - file_ephs_types_proto_depIdxs = nil -} diff --git a/proto/service/mint/BUILD.bazel b/proto/service/mint/BUILD.bazel index a4f208e..06c67db 100644 --- a/proto/service/mint/BUILD.bazel +++ b/proto/service/mint/BUILD.bazel @@ -1,9 +1,10 @@ -load("//bazel:go.bzl", "go_multi_library") +load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@rules_go//proto:def.bzl", "go_proto_library") -# gazelle:proto legacy +# gazelle:proto package -filegroup( - name = "go_default_library_protos", +proto_library( + name = "mint_proto", srcs = [ "mint_service.proto", "mint_types.proto", @@ -11,20 +12,13 @@ filegroup( visibility = ["//visibility:public"], ) -go_multi_library( - name = "mint", - srcs = [ - "mint_service.pb.go", - "mint_service_grpc.pb.go", - "mint_types.pb.go", +go_proto_library( + name = "mint_go_proto", + compilers = [ + "@rules_go//proto:go_proto", + "@rules_go//proto:go_grpc_v2", ], importpath = "go.fuhry.dev/runtime/proto/service/mint", + proto = ":mint_proto", visibility = ["//visibility:public"], - deps = [ - "@org_golang_google_grpc//:grpc", - "@org_golang_google_grpc//codes", - "@org_golang_google_grpc//status", - "@org_golang_google_protobuf//reflect/protoreflect", - "@org_golang_google_protobuf//runtime/protoimpl", - ], ) diff --git a/proto/service/mint/mint_service.pb.go b/proto/service/mint/mint_service.pb.go deleted file mode 100644 index 2d7ea73..0000000 --- a/proto/service/mint/mint_service.pb.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.0 -// source: mint_service.proto - -package mint - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - unsafe "unsafe" -) - -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) -) - -var File_mint_service_proto protoreflect.FileDescriptor - -const file_mint_service_proto_rawDesc = "" + - "\n" + - "\x12mint_service.proto\x12\x1afuhry.runtime.service.mint\x1a\x10mint_types.proto2\xfd\x01\n" + - "\x04Mint\x12~\n" + - "\x12RequestCertificate\x12..fuhry.runtime.service.mint.CertificateRequest\x1a6.fuhry.runtime.service.mint.CertificatePreSignResponse\"\x00\x12u\n" + - "\x13FinalizeCertificate\x12+.fuhry.runtime.service.mint.FinalizeRequest\x1a/.fuhry.runtime.service.mint.CertificateResponse\"\x00B)Z'go.fuhry.dev/runtime/proto/service/mintb\x06proto3" - -var file_mint_service_proto_goTypes = []any{ - (*CertificateRequest)(nil), // 0: fuhry.runtime.service.mint.CertificateRequest - (*FinalizeRequest)(nil), // 1: fuhry.runtime.service.mint.FinalizeRequest - (*CertificatePreSignResponse)(nil), // 2: fuhry.runtime.service.mint.CertificatePreSignResponse - (*CertificateResponse)(nil), // 3: fuhry.runtime.service.mint.CertificateResponse -} -var file_mint_service_proto_depIdxs = []int32{ - 0, // 0: fuhry.runtime.service.mint.Mint.RequestCertificate:input_type -> fuhry.runtime.service.mint.CertificateRequest - 1, // 1: fuhry.runtime.service.mint.Mint.FinalizeCertificate:input_type -> fuhry.runtime.service.mint.FinalizeRequest - 2, // 2: fuhry.runtime.service.mint.Mint.RequestCertificate:output_type -> fuhry.runtime.service.mint.CertificatePreSignResponse - 3, // 3: fuhry.runtime.service.mint.Mint.FinalizeCertificate:output_type -> fuhry.runtime.service.mint.CertificateResponse - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] 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_mint_service_proto_init() } -func file_mint_service_proto_init() { - if File_mint_service_proto != nil { - return - } - file_mint_types_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_mint_service_proto_rawDesc), len(file_mint_service_proto_rawDesc)), - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_mint_service_proto_goTypes, - DependencyIndexes: file_mint_service_proto_depIdxs, - }.Build() - File_mint_service_proto = out.File - file_mint_service_proto_goTypes = nil - file_mint_service_proto_depIdxs = nil -} diff --git a/proto/service/mint/mint_service.proto b/proto/service/mint/mint_service.proto index 8d2671a..94ebc30 100644 --- a/proto/service/mint/mint_service.proto +++ b/proto/service/mint/mint_service.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package fuhry.runtime.service.mint; -import "mint_types.proto"; +import "proto/service/mint/mint_types.proto"; option go_package = "go.fuhry.dev/runtime/proto/service/mint"; diff --git a/proto/service/mint/mint_service_grpc.pb.go b/proto/service/mint/mint_service_grpc.pb.go deleted file mode 100644 index 1ccf2d4..0000000 --- a/proto/service/mint/mint_service_grpc.pb.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v6.33.0 -// source: mint_service.proto - -package mint - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Mint_RequestCertificate_FullMethodName = "/fuhry.runtime.service.mint.Mint/RequestCertificate" - Mint_FinalizeCertificate_FullMethodName = "/fuhry.runtime.service.mint.Mint/FinalizeCertificate" -) - -// MintClient is the client API for Mint service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type MintClient interface { - RequestCertificate(ctx context.Context, in *CertificateRequest, opts ...grpc.CallOption) (*CertificatePreSignResponse, error) - FinalizeCertificate(ctx context.Context, in *FinalizeRequest, opts ...grpc.CallOption) (*CertificateResponse, error) -} - -type mintClient struct { - cc grpc.ClientConnInterface -} - -func NewMintClient(cc grpc.ClientConnInterface) MintClient { - return &mintClient{cc} -} - -func (c *mintClient) RequestCertificate(ctx context.Context, in *CertificateRequest, opts ...grpc.CallOption) (*CertificatePreSignResponse, error) { - out := new(CertificatePreSignResponse) - err := c.cc.Invoke(ctx, Mint_RequestCertificate_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *mintClient) FinalizeCertificate(ctx context.Context, in *FinalizeRequest, opts ...grpc.CallOption) (*CertificateResponse, error) { - out := new(CertificateResponse) - err := c.cc.Invoke(ctx, Mint_FinalizeCertificate_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MintServer is the server API for Mint service. -// All implementations must embed UnimplementedMintServer -// for forward compatibility -type MintServer interface { - RequestCertificate(context.Context, *CertificateRequest) (*CertificatePreSignResponse, error) - FinalizeCertificate(context.Context, *FinalizeRequest) (*CertificateResponse, error) - mustEmbedUnimplementedMintServer() -} - -// UnimplementedMintServer must be embedded to have forward compatible implementations. -type UnimplementedMintServer struct { -} - -func (UnimplementedMintServer) RequestCertificate(context.Context, *CertificateRequest) (*CertificatePreSignResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RequestCertificate not implemented") -} -func (UnimplementedMintServer) FinalizeCertificate(context.Context, *FinalizeRequest) (*CertificateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FinalizeCertificate not implemented") -} -func (UnimplementedMintServer) mustEmbedUnimplementedMintServer() {} - -// UnsafeMintServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MintServer will -// result in compilation errors. -type UnsafeMintServer interface { - mustEmbedUnimplementedMintServer() -} - -func RegisterMintServer(s grpc.ServiceRegistrar, srv MintServer) { - s.RegisterService(&Mint_ServiceDesc, srv) -} - -func _Mint_RequestCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CertificateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MintServer).RequestCertificate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Mint_RequestCertificate_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MintServer).RequestCertificate(ctx, req.(*CertificateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Mint_FinalizeCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FinalizeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MintServer).FinalizeCertificate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Mint_FinalizeCertificate_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MintServer).FinalizeCertificate(ctx, req.(*FinalizeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Mint_ServiceDesc is the grpc.ServiceDesc for Mint service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Mint_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "fuhry.runtime.service.mint.Mint", - HandlerType: (*MintServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "RequestCertificate", - Handler: _Mint_RequestCertificate_Handler, - }, - { - MethodName: "FinalizeCertificate", - Handler: _Mint_FinalizeCertificate_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "mint_service.proto", -} diff --git a/proto/service/mint/mint_types.pb.go b/proto/service/mint/mint_types.pb.go deleted file mode 100644 index 8bf8328..0000000 --- a/proto/service/mint/mint_types.pb.go +++ /dev/null @@ -1,375 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.10 -// protoc v6.33.0 -// source: mint_types.proto - -package mint - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -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) -) - -type CertificateRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - RequestedIdentity string `protobuf:"bytes,1,opt,name=requested_identity,json=requestedIdentity,proto3" json:"requested_identity,omitempty"` - PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - HostInfo *CertificateRequest_HostInfo `protobuf:"bytes,3,opt,name=host_info,json=hostInfo,proto3" json:"host_info,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CertificateRequest) Reset() { - *x = CertificateRequest{} - mi := &file_mint_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CertificateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CertificateRequest) ProtoMessage() {} - -func (x *CertificateRequest) ProtoReflect() protoreflect.Message { - mi := &file_mint_types_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CertificateRequest.ProtoReflect.Descriptor instead. -func (*CertificateRequest) Descriptor() ([]byte, []int) { - return file_mint_types_proto_rawDescGZIP(), []int{0} -} - -func (x *CertificateRequest) GetRequestedIdentity() string { - if x != nil { - return x.RequestedIdentity - } - return "" -} - -func (x *CertificateRequest) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *CertificateRequest) GetHostInfo() *CertificateRequest_HostInfo { - if x != nil { - return x.HostInfo - } - return nil -} - -type CertificatePreSignResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Digest []byte `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` - Hash int32 `protobuf:"varint,2,opt,name=hash,proto3" json:"hash,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CertificatePreSignResponse) Reset() { - *x = CertificatePreSignResponse{} - mi := &file_mint_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CertificatePreSignResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CertificatePreSignResponse) ProtoMessage() {} - -func (x *CertificatePreSignResponse) ProtoReflect() protoreflect.Message { - mi := &file_mint_types_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CertificatePreSignResponse.ProtoReflect.Descriptor instead. -func (*CertificatePreSignResponse) Descriptor() ([]byte, []int) { - return file_mint_types_proto_rawDescGZIP(), []int{1} -} - -func (x *CertificatePreSignResponse) GetDigest() []byte { - if x != nil { - return x.Digest - } - return nil -} - -func (x *CertificatePreSignResponse) GetHash() int32 { - if x != nil { - return x.Hash - } - return 0 -} - -type FinalizeRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Digest []byte `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - Hash int32 `protobuf:"varint,3,opt,name=hash,proto3" json:"hash,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FinalizeRequest) Reset() { - *x = FinalizeRequest{} - mi := &file_mint_types_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FinalizeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FinalizeRequest) ProtoMessage() {} - -func (x *FinalizeRequest) ProtoReflect() protoreflect.Message { - mi := &file_mint_types_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FinalizeRequest.ProtoReflect.Descriptor instead. -func (*FinalizeRequest) Descriptor() ([]byte, []int) { - return file_mint_types_proto_rawDescGZIP(), []int{2} -} - -func (x *FinalizeRequest) GetDigest() []byte { - if x != nil { - return x.Digest - } - return nil -} - -func (x *FinalizeRequest) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -func (x *FinalizeRequest) GetHash() int32 { - if x != nil { - return x.Hash - } - return 0 -} - -type CertificateResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Leaf []byte `protobuf:"bytes,1,opt,name=leaf,proto3" json:"leaf,omitempty"` - Intermediates [][]byte `protobuf:"bytes,2,rep,name=intermediates,proto3" json:"intermediates,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CertificateResponse) Reset() { - *x = CertificateResponse{} - mi := &file_mint_types_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CertificateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CertificateResponse) ProtoMessage() {} - -func (x *CertificateResponse) ProtoReflect() protoreflect.Message { - mi := &file_mint_types_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CertificateResponse.ProtoReflect.Descriptor instead. -func (*CertificateResponse) Descriptor() ([]byte, []int) { - return file_mint_types_proto_rawDescGZIP(), []int{3} -} - -func (x *CertificateResponse) GetLeaf() []byte { - if x != nil { - return x.Leaf - } - return nil -} - -func (x *CertificateResponse) GetIntermediates() [][]byte { - if x != nil { - return x.Intermediates - } - return nil -} - -type CertificateRequest_HostInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"` - Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CertificateRequest_HostInfo) Reset() { - *x = CertificateRequest_HostInfo{} - mi := &file_mint_types_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CertificateRequest_HostInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CertificateRequest_HostInfo) ProtoMessage() {} - -func (x *CertificateRequest_HostInfo) ProtoReflect() protoreflect.Message { - mi := &file_mint_types_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CertificateRequest_HostInfo.ProtoReflect.Descriptor instead. -func (*CertificateRequest_HostInfo) Descriptor() ([]byte, []int) { - return file_mint_types_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *CertificateRequest_HostInfo) GetHostname() string { - if x != nil { - return x.Hostname - } - return "" -} - -func (x *CertificateRequest_HostInfo) GetDomain() string { - if x != nil { - return x.Domain - } - return "" -} - -var File_mint_types_proto protoreflect.FileDescriptor - -const file_mint_types_proto_rawDesc = "" + - "\n" + - "\x10mint_types.proto\x12\x1afuhry.runtime.service.mint\"\xf8\x01\n" + - "\x12CertificateRequest\x12-\n" + - "\x12requested_identity\x18\x01 \x01(\tR\x11requestedIdentity\x12\x1d\n" + - "\n" + - "public_key\x18\x02 \x01(\fR\tpublicKey\x12T\n" + - "\thost_info\x18\x03 \x01(\v27.fuhry.runtime.service.mint.CertificateRequest.HostInfoR\bhostInfo\x1a>\n" + - "\bHostInfo\x12\x1a\n" + - "\bhostname\x18\x01 \x01(\tR\bhostname\x12\x16\n" + - "\x06domain\x18\x02 \x01(\tR\x06domain\"H\n" + - "\x1aCertificatePreSignResponse\x12\x16\n" + - "\x06digest\x18\x01 \x01(\fR\x06digest\x12\x12\n" + - "\x04hash\x18\x02 \x01(\x05R\x04hash\"[\n" + - "\x0fFinalizeRequest\x12\x16\n" + - "\x06digest\x18\x01 \x01(\fR\x06digest\x12\x1c\n" + - "\tsignature\x18\x02 \x01(\fR\tsignature\x12\x12\n" + - "\x04hash\x18\x03 \x01(\x05R\x04hash\"O\n" + - "\x13CertificateResponse\x12\x12\n" + - "\x04leaf\x18\x01 \x01(\fR\x04leaf\x12$\n" + - "\rintermediates\x18\x02 \x03(\fR\rintermediatesB)Z'go.fuhry.dev/runtime/proto/service/mintb\x06proto3" - -var ( - file_mint_types_proto_rawDescOnce sync.Once - file_mint_types_proto_rawDescData []byte -) - -func file_mint_types_proto_rawDescGZIP() []byte { - file_mint_types_proto_rawDescOnce.Do(func() { - file_mint_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_mint_types_proto_rawDesc), len(file_mint_types_proto_rawDesc))) - }) - return file_mint_types_proto_rawDescData -} - -var file_mint_types_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_mint_types_proto_goTypes = []any{ - (*CertificateRequest)(nil), // 0: fuhry.runtime.service.mint.CertificateRequest - (*CertificatePreSignResponse)(nil), // 1: fuhry.runtime.service.mint.CertificatePreSignResponse - (*FinalizeRequest)(nil), // 2: fuhry.runtime.service.mint.FinalizeRequest - (*CertificateResponse)(nil), // 3: fuhry.runtime.service.mint.CertificateResponse - (*CertificateRequest_HostInfo)(nil), // 4: fuhry.runtime.service.mint.CertificateRequest.HostInfo -} -var file_mint_types_proto_depIdxs = []int32{ - 4, // 0: fuhry.runtime.service.mint.CertificateRequest.host_info:type_name -> fuhry.runtime.service.mint.CertificateRequest.HostInfo - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_mint_types_proto_init() } -func file_mint_types_proto_init() { - if File_mint_types_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_mint_types_proto_rawDesc), len(file_mint_types_proto_rawDesc)), - NumEnums: 0, - NumMessages: 5, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_mint_types_proto_goTypes, - DependencyIndexes: file_mint_types_proto_depIdxs, - MessageInfos: file_mint_types_proto_msgTypes, - }.Build() - File_mint_types_proto = out.File - file_mint_types_proto_goTypes = nil - file_mint_types_proto_depIdxs = nil -}