initial commit
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.12
|
||||
// protoc v7.36.0
|
||||
// source: api/messages/message.proto
|
||||
|
||||
package messages
|
||||
|
||||
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 Message struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Message) Reset() {
|
||||
*x = Message{}
|
||||
mi := &file_api_messages_message_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Message) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Message) ProtoMessage() {}
|
||||
|
||||
func (x *Message) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_messages_message_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 Message.ProtoReflect.Descriptor instead.
|
||||
func (*Message) Descriptor() ([]byte, []int) {
|
||||
return file_api_messages_message_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
var File_api_messages_message_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_api_messages_message_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x1aapi/messages/message.proto\x12\fapi.messages\"\t\n" +
|
||||
"\aMessageB\x15Z\x13pkg/pb/api/messagesb\x06proto3"
|
||||
|
||||
var (
|
||||
file_api_messages_message_proto_rawDescOnce sync.Once
|
||||
file_api_messages_message_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_api_messages_message_proto_rawDescGZIP() []byte {
|
||||
file_api_messages_message_proto_rawDescOnce.Do(func() {
|
||||
file_api_messages_message_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_messages_message_proto_rawDesc), len(file_api_messages_message_proto_rawDesc)))
|
||||
})
|
||||
return file_api_messages_message_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_messages_message_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_api_messages_message_proto_goTypes = []any{
|
||||
(*Message)(nil), // 0: api.messages.Message
|
||||
}
|
||||
var file_api_messages_message_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_messages_message_proto_init() }
|
||||
func file_api_messages_message_proto_init() {
|
||||
if File_api_messages_message_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_messages_message_proto_rawDesc), len(file_api_messages_message_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_api_messages_message_proto_goTypes,
|
||||
DependencyIndexes: file_api_messages_message_proto_depIdxs,
|
||||
MessageInfos: file_api_messages_message_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_messages_message_proto = out.File
|
||||
file_api_messages_message_proto_goTypes = nil
|
||||
file_api_messages_message_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.12
|
||||
// protoc v7.36.0
|
||||
// source: api/services/core.proto
|
||||
|
||||
package services
|
||||
|
||||
import (
|
||||
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
|
||||
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_api_services_core_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_api_services_core_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x17api/services/core.proto\x12\fapi.services\x1a.protoc-gen-openapiv2/options/annotations.protoB4\x92A\x1c\x12\x18\n" +
|
||||
"\vApplication2\t%version%Z\x00Z\x13pkg/pb/api/servicesb\x06proto3"
|
||||
|
||||
var file_api_services_core_proto_goTypes = []any{}
|
||||
var file_api_services_core_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_services_core_proto_init() }
|
||||
func file_api_services_core_proto_init() {
|
||||
if File_api_services_core_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_services_core_proto_rawDesc), len(file_api_services_core_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_api_services_core_proto_goTypes,
|
||||
DependencyIndexes: file_api_services_core_proto_depIdxs,
|
||||
}.Build()
|
||||
File_api_services_core_proto = out.File
|
||||
file_api_services_core_proto_goTypes = nil
|
||||
file_api_services_core_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.12
|
||||
// protoc v7.36.0
|
||||
// source: api/services/debug_service.proto
|
||||
|
||||
package services
|
||||
|
||||
import (
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
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 GetVersion struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetVersion) Reset() {
|
||||
*x = GetVersion{}
|
||||
mi := &file_api_services_debug_service_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetVersion) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetVersion) ProtoMessage() {}
|
||||
|
||||
func (x *GetVersion) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_services_debug_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 GetVersion.ProtoReflect.Descriptor instead.
|
||||
func (*GetVersion) Descriptor() ([]byte, []int) {
|
||||
return file_api_services_debug_service_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type GetVersion_Request struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetVersion_Request) Reset() {
|
||||
*x = GetVersion_Request{}
|
||||
mi := &file_api_services_debug_service_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetVersion_Request) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetVersion_Request) ProtoMessage() {}
|
||||
|
||||
func (x *GetVersion_Request) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_services_debug_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 GetVersion_Request.ProtoReflect.Descriptor instead.
|
||||
func (*GetVersion_Request) Descriptor() ([]byte, []int) {
|
||||
return file_api_services_debug_service_proto_rawDescGZIP(), []int{0, 0}
|
||||
}
|
||||
|
||||
type GetVersion_Response struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetVersion_Response) Reset() {
|
||||
*x = GetVersion_Response{}
|
||||
mi := &file_api_services_debug_service_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetVersion_Response) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetVersion_Response) ProtoMessage() {}
|
||||
|
||||
func (x *GetVersion_Response) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_services_debug_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 GetVersion_Response.ProtoReflect.Descriptor instead.
|
||||
func (*GetVersion_Response) Descriptor() ([]byte, []int) {
|
||||
return file_api_services_debug_service_proto_rawDescGZIP(), []int{0, 1}
|
||||
}
|
||||
|
||||
func (x *GetVersion_Response) GetVersion() string {
|
||||
if x != nil {
|
||||
return x.Version
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_api_services_debug_service_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_api_services_debug_service_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
" api/services/debug_service.proto\x12\fapi.services\x1a\x1cgoogle/api/annotations.proto\"=\n" +
|
||||
"\n" +
|
||||
"GetVersion\x1a\t\n" +
|
||||
"\aRequest\x1a$\n" +
|
||||
"\bResponse\x12\x18\n" +
|
||||
"\aversion\x18\x01 \x01(\tR\aversion2v\n" +
|
||||
"\bDebugAPI\x12j\n" +
|
||||
"\n" +
|
||||
"GetVersion\x12 .api.services.GetVersion.Request\x1a!.api.services.GetVersion.Response\"\x17\x82\xd3\xe4\x93\x02\x11\x12\x0f/api/v1/versionB\x15Z\x13pkg/pb/api/servicesb\x06proto3"
|
||||
|
||||
var (
|
||||
file_api_services_debug_service_proto_rawDescOnce sync.Once
|
||||
file_api_services_debug_service_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_api_services_debug_service_proto_rawDescGZIP() []byte {
|
||||
file_api_services_debug_service_proto_rawDescOnce.Do(func() {
|
||||
file_api_services_debug_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_services_debug_service_proto_rawDesc), len(file_api_services_debug_service_proto_rawDesc)))
|
||||
})
|
||||
return file_api_services_debug_service_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_services_debug_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_api_services_debug_service_proto_goTypes = []any{
|
||||
(*GetVersion)(nil), // 0: api.services.GetVersion
|
||||
(*GetVersion_Request)(nil), // 1: api.services.GetVersion.Request
|
||||
(*GetVersion_Response)(nil), // 2: api.services.GetVersion.Response
|
||||
}
|
||||
var file_api_services_debug_service_proto_depIdxs = []int32{
|
||||
1, // 0: api.services.DebugAPI.GetVersion:input_type -> api.services.GetVersion.Request
|
||||
2, // 1: api.services.DebugAPI.GetVersion:output_type -> api.services.GetVersion.Response
|
||||
1, // [1:2] is the sub-list for method output_type
|
||||
0, // [0:1] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_services_debug_service_proto_init() }
|
||||
func file_api_services_debug_service_proto_init() {
|
||||
if File_api_services_debug_service_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_services_debug_service_proto_rawDesc), len(file_api_services_debug_service_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_api_services_debug_service_proto_goTypes,
|
||||
DependencyIndexes: file_api_services_debug_service_proto_depIdxs,
|
||||
MessageInfos: file_api_services_debug_service_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_services_debug_service_proto = out.File
|
||||
file_api_services_debug_service_proto_goTypes = nil
|
||||
file_api_services_debug_service_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: api/services/debug_service.proto
|
||||
|
||||
/*
|
||||
Package services is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package services
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var (
|
||||
_ codes.Code
|
||||
_ io.Reader
|
||||
_ status.Status
|
||||
_ = errors.New
|
||||
_ = runtime.String
|
||||
_ = utilities.NewDoubleArray
|
||||
_ = metadata.Join
|
||||
)
|
||||
|
||||
func request_DebugAPI_GetVersion_0(ctx context.Context, marshaler runtime.Marshaler, client DebugAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq GetVersion_Request
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if req.Body != nil {
|
||||
_, _ = io.Copy(io.Discard, req.Body)
|
||||
}
|
||||
msg, err := client.GetVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
func local_request_DebugAPI_GetVersion_0(ctx context.Context, marshaler runtime.Marshaler, server DebugAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq GetVersion_Request
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
msg, err := server.GetVersion(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
}
|
||||
|
||||
// RegisterDebugAPIHandlerServer registers the http handlers for service DebugAPI to "mux".
|
||||
// UnaryRPC :call DebugAPIServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDebugAPIHandlerFromEndpoint instead.
|
||||
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
|
||||
func RegisterDebugAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DebugAPIServer) error {
|
||||
mux.Handle(http.MethodGet, pattern_DebugAPI_GetVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/api.services.DebugAPI/GetVersion", runtime.WithHTTPPathPattern("/api/v1/version"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_DebugAPI_GetVersion_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_DebugAPI_GetVersion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterDebugAPIHandlerFromEndpoint is same as RegisterDebugAPIHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterDebugAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.NewClient(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
return RegisterDebugAPIHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterDebugAPIHandler registers the http handlers for service DebugAPI to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterDebugAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterDebugAPIHandlerClient(ctx, mux, NewDebugAPIClient(conn))
|
||||
}
|
||||
|
||||
// RegisterDebugAPIHandlerClient registers the http handlers for service DebugAPI
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DebugAPIClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DebugAPIClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "DebugAPIClient" to call the correct interceptors. This client ignores the HTTP middlewares.
|
||||
func RegisterDebugAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DebugAPIClient) error {
|
||||
mux.Handle(http.MethodGet, pattern_DebugAPI_GetVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/api.services.DebugAPI/GetVersion", runtime.WithHTTPPathPattern("/api/v1/version"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_DebugAPI_GetVersion_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
forward_DebugAPI_GetVersion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_DebugAPI_GetVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "version"}, ""))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_DebugAPI_GetVersion_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
@@ -0,0 +1,121 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc v7.36.0
|
||||
// source: api/services/debug_service.proto
|
||||
|
||||
package services
|
||||
|
||||
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.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
DebugAPI_GetVersion_FullMethodName = "/api.services.DebugAPI/GetVersion"
|
||||
)
|
||||
|
||||
// DebugAPIClient is the client API for DebugAPI 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 DebugAPIClient interface {
|
||||
GetVersion(ctx context.Context, in *GetVersion_Request, opts ...grpc.CallOption) (*GetVersion_Response, error)
|
||||
}
|
||||
|
||||
type debugAPIClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewDebugAPIClient(cc grpc.ClientConnInterface) DebugAPIClient {
|
||||
return &debugAPIClient{cc}
|
||||
}
|
||||
|
||||
func (c *debugAPIClient) GetVersion(ctx context.Context, in *GetVersion_Request, opts ...grpc.CallOption) (*GetVersion_Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetVersion_Response)
|
||||
err := c.cc.Invoke(ctx, DebugAPI_GetVersion_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// DebugAPIServer is the server API for DebugAPI service.
|
||||
// All implementations must embed UnimplementedDebugAPIServer
|
||||
// for forward compatibility.
|
||||
type DebugAPIServer interface {
|
||||
GetVersion(context.Context, *GetVersion_Request) (*GetVersion_Response, error)
|
||||
mustEmbedUnimplementedDebugAPIServer()
|
||||
}
|
||||
|
||||
// UnimplementedDebugAPIServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedDebugAPIServer struct{}
|
||||
|
||||
func (UnimplementedDebugAPIServer) GetVersion(context.Context, *GetVersion_Request) (*GetVersion_Response, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetVersion not implemented")
|
||||
}
|
||||
func (UnimplementedDebugAPIServer) mustEmbedUnimplementedDebugAPIServer() {}
|
||||
func (UnimplementedDebugAPIServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeDebugAPIServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to DebugAPIServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeDebugAPIServer interface {
|
||||
mustEmbedUnimplementedDebugAPIServer()
|
||||
}
|
||||
|
||||
func RegisterDebugAPIServer(s grpc.ServiceRegistrar, srv DebugAPIServer) {
|
||||
// If the following call panics, it indicates UnimplementedDebugAPIServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&DebugAPI_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _DebugAPI_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetVersion_Request)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DebugAPIServer).GetVersion(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: DebugAPI_GetVersion_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DebugAPIServer).GetVersion(ctx, req.(*GetVersion_Request))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// DebugAPI_ServiceDesc is the grpc.ServiceDesc for DebugAPI service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var DebugAPI_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "api.services.DebugAPI",
|
||||
HandlerType: (*DebugAPIServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetVersion",
|
||||
Handler: _DebugAPI_GetVersion_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/services/debug_service.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user