diff --git a/api/configuration/configuration.go b/api/configuration/configuration.go index 52f6ec35..3e96d4c0 100644 --- a/api/configuration/configuration.go +++ b/api/configuration/configuration.go @@ -8,7 +8,7 @@ type SecretKeys struct { // Configuration interface type Configuration struct { - BackendAddress string `toml:"backend_address,omitempty" mapstructure:"backend_addr,omitempty"` + BackendAddress string `toml:"backend_address,omitempty" mapstructure:"backend_address,omitempty"` Keys SecretKeys AccessToken string `toml:"access_token,omitempty" mapstructure:"access_token,omitempty"` EnvName string `toml:"envName,omitempty" mapstructure:"envName,omitempty"` diff --git a/cmd/describe/describe.go b/cmd/describe/describe.go new file mode 100644 index 00000000..cee8807c --- /dev/null +++ b/cmd/describe/describe.go @@ -0,0 +1,16 @@ +package describe + +import ( + "github.com/dream11/odin/cmd" + "github.com/spf13/cobra" +) + +var describeCmd = &cobra.Command{ + Use: "describe", + Short: "Describe resources", + Long: `Describe resources`, +} + +func init() { + cmd.RootCmd.AddCommand(describeCmd) +} diff --git a/cmd/describe/service.go b/cmd/describe/service.go new file mode 100644 index 00000000..214053a8 --- /dev/null +++ b/cmd/describe/service.go @@ -0,0 +1,118 @@ +package describe + +import ( + "encoding/json" + "fmt" + "strconv" + + serviceBackend "github.com/dream11/odin/internal/service" + service "github.com/dream11/odin/proto/gen/go/dream11/od/service/v1" + log "github.com/sirupsen/logrus" + "github.com/spf13/cobra" + "github.com/iancoleman/orderedmap" +) + +var serviceName string +var serviceVersion string +var labelsJSON string +var labels map[string]string +var component string +var verbose bool + +var serviceClient = serviceBackend.Service{} +var serviceCmd = &cobra.Command{ + Use: "service", + Short: "Describe service", + Args: func(cmd *cobra.Command, args []string) error { + return cobra.NoArgs(cmd, args) + }, + Long: `Describe definition and provisionig files of a service`, + Run: func(cmd *cobra.Command, args []string) { + execute(cmd) + }, +} + +func init() { + serviceCmd.Flags().StringVar(&serviceName, "name", "", "name of the service") + serviceCmd.Flags().StringVar(&serviceVersion, "version", "", "version of the service") + serviceCmd.Flags().StringVar(&labelsJSON, "labels", "", "labels of the service in the artifactory") + serviceCmd.Flags().StringVar(&component, "component", "", "Display the config of a specific component only") + serviceCmd.Flags().BoolVarP(&verbose, "verbose", "V", false, "display provisioning files data") + describeCmd.AddCommand(serviceCmd) +} + +func execute(cmd *cobra.Command) { + + validateFlags() + + params := map[string]string{ + "verbose": strconv.FormatBool(verbose), + } + + if component != "" { + params["component"] = component + } + + ctx := cmd.Context() + response, err := serviceClient.DescribeService(&ctx, &service.DescribeServiceRequest{ + ServiceName: serviceName, + Version: serviceVersion, + Labels: labels, + Params: params, + }) + + if err != nil { + log.Fatal("Failed to describe service: ", err) + } + + writeAsJSON(response) +} + +func validateFlags() { + + if serviceName == "" { + log.Fatal("Please pass the --name flag") + } + + if serviceVersion == "" && labelsJSON == "" { + log.Fatal("Please pass either --version flag or --labels flag") + } + + if serviceVersion != "" && labelsJSON != "" { + log.Fatal("Please pass either --version flag or --labels flag but not both") + } + + if labelsJSON != "" { + err := json.Unmarshal([]byte(labelsJSON), &labels) + if err != nil { + log.Fatal("Error parsing JSON, the the key and values should be strings: ", err) + } + } +} + +func writeAsJSON(response *service.DescribeServiceResponse) { + serviceData := orderedmap.New() + serviceData.Set("name", response.Service.Name) + + if response.Service.Version != nil && *response.Service.Version != "" { + serviceData.Set("version", *response.Service.Version) + } + if response.Service.Versions != nil && len(response.Service.Versions) > 0 { + serviceData.Set("versions", response.Service.Versions) + } + if response.Service.Labels != nil { + serviceData.Set("labels", response.Service.Labels) + } + if response.Service.ServiceDefinition != nil && len(response.Service.ServiceDefinition.GetFields()) > 0 { + serviceData.Set("definition", response.Service.ServiceDefinition) + } + if response.Service.ProvisioningConfigFiles != nil && len(response.Service.ProvisioningConfigFiles) > 0 { + serviceData.Set("provision", response.Service.ProvisioningConfigFiles) + } + + output, err := json.MarshalIndent(serviceData, "", " ") + if err != nil { + log.Fatal("Error marshaling JSON:", err) + } + fmt.Println(string(output)) +} diff --git a/go.mod b/go.mod index 64011b44..03680b57 100644 --- a/go.mod +++ b/go.mod @@ -26,6 +26,7 @@ require ( ) require ( + github.com/iancoleman/orderedmap v0.3.0 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.7.0 github.com/spf13/viper v1.16.0 diff --git a/go.sum b/go.sum index 9edc7789..25af0d15 100644 --- a/go.sum +++ b/go.sum @@ -1009,6 +1009,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= +github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc= +github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= diff --git a/internal/service/service.go b/internal/service/service.go new file mode 100644 index 00000000..36758bb0 --- /dev/null +++ b/internal/service/service.go @@ -0,0 +1,25 @@ +package service + +import ( + "context" + + service "github.com/dream11/odin/proto/gen/go/dream11/od/service/v1" +) + +// Service performs operation on service like list, describe +type Service struct{} + +// DescribeSerice Describe service +func (e *Service) DescribeService(ctx *context.Context, request *service.DescribeServiceRequest) (*service.DescribeServiceResponse, error) { + conn, requestCtx, err := grpcClient(ctx) + if err != nil { + return nil, err + } + client := service.NewServiceServiceClient(conn) + response, err := client.DescribeService(*requestCtx, request) + if err != nil { + return nil, err + } + + return response, nil +} diff --git a/main.go b/main.go index ea848a6a..41c9b205 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ package main import ( "github.com/dream11/odin/cmd" _ "github.com/dream11/odin/cmd/list" + _ "github.com/dream11/odin/cmd/describe" _ "github.com/dream11/odin/cmd/configure" _ "github.com/dream11/odin/internal/ui" ) diff --git a/proto/dream11/od/dto/v1/service.proto b/proto/dream11/od/dto/v1/service.proto new file mode 100644 index 00000000..7f75521f --- /dev/null +++ b/proto/dream11/od/dto/v1/service.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package dream11.od.dto.v1; + +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/dream11/odin/proto/gen/go/dream11/od/dto/v1"; + +message Service { + optional string name = 1; + optional string version = 2; + optional google.protobuf.Timestamp created_at = 3; + optional google.protobuf.Timestamp updated_at = 4; + optional string created_by = 5; + optional string updated_by = 6; + optional google.protobuf.Struct labels = 7; + optional google.protobuf.Struct service_definition = 8; + repeated google.protobuf.Struct provisioning_config_files = 9; + repeated string versions = 10; +} diff --git a/proto/dream11/od/service/v1/service.proto b/proto/dream11/od/service/v1/service.proto new file mode 100644 index 00000000..cbe8b0d0 --- /dev/null +++ b/proto/dream11/od/service/v1/service.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +package dream11.od.service.v1; + +import "dream11/od/dto/v1/service.proto"; + +option go_package = "github.com/dream11/odin/proto/gen/go/dream11/od/service/v1"; + +service ServiceService { + rpc DescribeService(DescribeServiceRequest) returns (DescribeServiceResponse) {} +} + +message DescribeServiceRequest { + string service_name = 1; + string version = 2; + map labels = 3; + map params = 4; +} + +message DescribeServiceResponse { + dream11.od.dto.v1.Service service = 1; +} diff --git a/proto/gen/go/dream11/od/dto/v1/service.pb.go b/proto/gen/go/dream11/od/dto/v1/service.pb.go new file mode 100644 index 00000000..0c4390a3 --- /dev/null +++ b/proto/gen/go/dream11/od/dto/v1/service.pb.go @@ -0,0 +1,269 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: dream11/od/dto/v1/service.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + 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 Service struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name *string `protobuf:"bytes,1,opt,name=name,proto3,oneof" json:"name,omitempty"` + Version *string `protobuf:"bytes,2,opt,name=version,proto3,oneof" json:"version,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3,oneof" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"` + CreatedBy *string `protobuf:"bytes,5,opt,name=created_by,json=createdBy,proto3,oneof" json:"created_by,omitempty"` + UpdatedBy *string `protobuf:"bytes,6,opt,name=updated_by,json=updatedBy,proto3,oneof" json:"updated_by,omitempty"` + Labels *structpb.Struct `protobuf:"bytes,7,opt,name=labels,proto3,oneof" json:"labels,omitempty"` + ServiceDefinition *structpb.Struct `protobuf:"bytes,8,opt,name=service_definition,json=serviceDefinition,proto3,oneof" json:"service_definition,omitempty"` + ProvisioningConfigFiles []*structpb.Struct `protobuf:"bytes,9,rep,name=provisioning_config_files,json=provisioningConfigFiles,proto3" json:"provisioning_config_files,omitempty"` + Versions []string `protobuf:"bytes,10,rep,name=versions,proto3" json:"versions,omitempty"` +} + +func (x *Service) Reset() { + *x = Service{} + if protoimpl.UnsafeEnabled { + mi := &file_dream11_od_dto_v1_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Service) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Service) ProtoMessage() {} + +func (x *Service) ProtoReflect() protoreflect.Message { + mi := &file_dream11_od_dto_v1_service_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 Service.ProtoReflect.Descriptor instead. +func (*Service) Descriptor() ([]byte, []int) { + return file_dream11_od_dto_v1_service_proto_rawDescGZIP(), []int{0} +} + +func (x *Service) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *Service) GetVersion() string { + if x != nil && x.Version != nil { + return *x.Version + } + return "" +} + +func (x *Service) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Service) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *Service) GetCreatedBy() string { + if x != nil && x.CreatedBy != nil { + return *x.CreatedBy + } + return "" +} + +func (x *Service) GetUpdatedBy() string { + if x != nil && x.UpdatedBy != nil { + return *x.UpdatedBy + } + return "" +} + +func (x *Service) GetLabels() *structpb.Struct { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Service) GetServiceDefinition() *structpb.Struct { + if x != nil { + return x.ServiceDefinition + } + return nil +} + +func (x *Service) GetProvisioningConfigFiles() []*structpb.Struct { + if x != nil { + return x.ProvisioningConfigFiles + } + return nil +} + +func (x *Service) GetVersions() []string { + if x != nil { + return x.Versions + } + return nil +} + +var File_dream11_od_dto_v1_service_proto protoreflect.FileDescriptor + +var file_dream11_od_dto_v1_service_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x64, 0x72, 0x65, 0x61, 0x6d, 0x31, 0x31, 0x2f, 0x6f, 0x64, 0x2f, 0x64, 0x74, 0x6f, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x11, 0x64, 0x72, 0x65, 0x61, 0x6d, 0x31, 0x31, 0x2e, 0x6f, 0x64, 0x2e, 0x64, 0x74, + 0x6f, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xf0, 0x04, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x3e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x02, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x88, 0x01, 0x01, 0x12, 0x3e, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x88, 0x01, 0x01, 0x12, 0x22, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x09, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x88, 0x01, 0x01, 0x12, 0x22, 0x0a, 0x0a, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x05, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x88, 0x01, 0x01, 0x12, + 0x34, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x06, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x88, 0x01, 0x01, 0x12, 0x4b, 0x0a, 0x12, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x07, 0x52, 0x11, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x88, + 0x01, 0x01, 0x12, 0x53, 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, + 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, + 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x17, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0a, 0x0a, 0x08, + 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x62, 0x79, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x62, 0x79, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x42, + 0x15, 0x0a, 0x13, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x72, 0x65, 0x61, 0x6d, 0x31, 0x31, 0x2f, 0x6f, 0x64, 0x69, + 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x64, + 0x72, 0x65, 0x61, 0x6d, 0x31, 0x31, 0x2f, 0x6f, 0x64, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x76, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_dream11_od_dto_v1_service_proto_rawDescOnce sync.Once + file_dream11_od_dto_v1_service_proto_rawDescData = file_dream11_od_dto_v1_service_proto_rawDesc +) + +func file_dream11_od_dto_v1_service_proto_rawDescGZIP() []byte { + file_dream11_od_dto_v1_service_proto_rawDescOnce.Do(func() { + file_dream11_od_dto_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_dream11_od_dto_v1_service_proto_rawDescData) + }) + return file_dream11_od_dto_v1_service_proto_rawDescData +} + +var file_dream11_od_dto_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_dream11_od_dto_v1_service_proto_goTypes = []interface{}{ + (*Service)(nil), // 0: dream11.od.dto.v1.Service + (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp + (*structpb.Struct)(nil), // 2: google.protobuf.Struct +} +var file_dream11_od_dto_v1_service_proto_depIdxs = []int32{ + 1, // 0: dream11.od.dto.v1.Service.created_at:type_name -> google.protobuf.Timestamp + 1, // 1: dream11.od.dto.v1.Service.updated_at:type_name -> google.protobuf.Timestamp + 2, // 2: dream11.od.dto.v1.Service.labels:type_name -> google.protobuf.Struct + 2, // 3: dream11.od.dto.v1.Service.service_definition:type_name -> google.protobuf.Struct + 2, // 4: dream11.od.dto.v1.Service.provisioning_config_files:type_name -> google.protobuf.Struct + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_dream11_od_dto_v1_service_proto_init() } +func file_dream11_od_dto_v1_service_proto_init() { + if File_dream11_od_dto_v1_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_dream11_od_dto_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Service); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_dream11_od_dto_v1_service_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_dream11_od_dto_v1_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_dream11_od_dto_v1_service_proto_goTypes, + DependencyIndexes: file_dream11_od_dto_v1_service_proto_depIdxs, + MessageInfos: file_dream11_od_dto_v1_service_proto_msgTypes, + }.Build() + File_dream11_od_dto_v1_service_proto = out.File + file_dream11_od_dto_v1_service_proto_rawDesc = nil + file_dream11_od_dto_v1_service_proto_goTypes = nil + file_dream11_od_dto_v1_service_proto_depIdxs = nil +} diff --git a/proto/gen/go/dream11/od/service/v1/service.pb.go b/proto/gen/go/dream11/od/service/v1/service.pb.go new file mode 100644 index 00000000..9e8da05f --- /dev/null +++ b/proto/gen/go/dream11/od/service/v1/service.pb.go @@ -0,0 +1,276 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.4 +// source: dream11/od/service/v1/service.proto + +package v1 + +import ( + v1 "github.com/dream11/odin/proto/gen/go/dream11/od/dto/v1" + 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 DescribeServiceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Params map[string]string `protobuf:"bytes,4,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *DescribeServiceRequest) Reset() { + *x = DescribeServiceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_dream11_od_service_v1_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DescribeServiceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeServiceRequest) ProtoMessage() {} + +func (x *DescribeServiceRequest) ProtoReflect() protoreflect.Message { + mi := &file_dream11_od_service_v1_service_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 DescribeServiceRequest.ProtoReflect.Descriptor instead. +func (*DescribeServiceRequest) Descriptor() ([]byte, []int) { + return file_dream11_od_service_v1_service_proto_rawDescGZIP(), []int{0} +} + +func (x *DescribeServiceRequest) GetServiceName() string { + if x != nil { + return x.ServiceName + } + return "" +} + +func (x *DescribeServiceRequest) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *DescribeServiceRequest) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *DescribeServiceRequest) GetParams() map[string]string { + if x != nil { + return x.Params + } + return nil +} + +type DescribeServiceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Service *v1.Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` +} + +func (x *DescribeServiceResponse) Reset() { + *x = DescribeServiceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_dream11_od_service_v1_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DescribeServiceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeServiceResponse) ProtoMessage() {} + +func (x *DescribeServiceResponse) ProtoReflect() protoreflect.Message { + mi := &file_dream11_od_service_v1_service_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 DescribeServiceResponse.ProtoReflect.Descriptor instead. +func (*DescribeServiceResponse) Descriptor() ([]byte, []int) { + return file_dream11_od_service_v1_service_proto_rawDescGZIP(), []int{1} +} + +func (x *DescribeServiceResponse) GetService() *v1.Service { + if x != nil { + return x.Service + } + return nil +} + +var File_dream11_od_service_v1_service_proto protoreflect.FileDescriptor + +var file_dream11_od_service_v1_service_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x64, 0x72, 0x65, 0x61, 0x6d, 0x31, 0x31, 0x2f, 0x6f, 0x64, 0x2f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x64, 0x72, 0x65, 0x61, 0x6d, 0x31, 0x31, 0x2e, 0x6f, + 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x64, 0x72, + 0x65, 0x61, 0x6d, 0x31, 0x31, 0x2f, 0x6f, 0x64, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf1, 0x02, + 0x0a, 0x16, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x64, 0x72, 0x65, 0x61, 0x6d, 0x31, 0x31, 0x2e, + 0x6f, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x51, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x64, 0x72, 0x65, 0x61, 0x6d, + 0x31, 0x31, 0x2e, 0x6f, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0x4f, 0x0a, 0x17, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x07, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x64, 0x72, 0x65, 0x61, 0x6d, 0x31, 0x31, 0x2e, 0x6f, 0x64, 0x2e, 0x64, 0x74, 0x6f, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x32, 0x84, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x72, 0x0a, 0x0f, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2d, 0x2e, 0x64, 0x72, 0x65, 0x61, 0x6d, + 0x31, 0x31, 0x2e, 0x6f, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x64, 0x72, 0x65, 0x61, 0x6d, 0x31, + 0x31, 0x2e, 0x6f, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x72, 0x65, 0x61, 0x6d, 0x31, 0x31, 0x2f, + 0x6f, 0x64, 0x69, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, + 0x6f, 0x2f, 0x64, 0x72, 0x65, 0x61, 0x6d, 0x31, 0x31, 0x2f, 0x6f, 0x64, 0x2f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_dream11_od_service_v1_service_proto_rawDescOnce sync.Once + file_dream11_od_service_v1_service_proto_rawDescData = file_dream11_od_service_v1_service_proto_rawDesc +) + +func file_dream11_od_service_v1_service_proto_rawDescGZIP() []byte { + file_dream11_od_service_v1_service_proto_rawDescOnce.Do(func() { + file_dream11_od_service_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_dream11_od_service_v1_service_proto_rawDescData) + }) + return file_dream11_od_service_v1_service_proto_rawDescData +} + +var file_dream11_od_service_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_dream11_od_service_v1_service_proto_goTypes = []interface{}{ + (*DescribeServiceRequest)(nil), // 0: dream11.od.service.v1.DescribeServiceRequest + (*DescribeServiceResponse)(nil), // 1: dream11.od.service.v1.DescribeServiceResponse + nil, // 2: dream11.od.service.v1.DescribeServiceRequest.LabelsEntry + nil, // 3: dream11.od.service.v1.DescribeServiceRequest.ParamsEntry + (*v1.Service)(nil), // 4: dream11.od.dto.v1.Service +} +var file_dream11_od_service_v1_service_proto_depIdxs = []int32{ + 2, // 0: dream11.od.service.v1.DescribeServiceRequest.labels:type_name -> dream11.od.service.v1.DescribeServiceRequest.LabelsEntry + 3, // 1: dream11.od.service.v1.DescribeServiceRequest.params:type_name -> dream11.od.service.v1.DescribeServiceRequest.ParamsEntry + 4, // 2: dream11.od.service.v1.DescribeServiceResponse.service:type_name -> dream11.od.dto.v1.Service + 0, // 3: dream11.od.service.v1.ServiceService.DescribeService:input_type -> dream11.od.service.v1.DescribeServiceRequest + 1, // 4: dream11.od.service.v1.ServiceService.DescribeService:output_type -> dream11.od.service.v1.DescribeServiceResponse + 4, // [4:5] is the sub-list for method output_type + 3, // [3:4] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_dream11_od_service_v1_service_proto_init() } +func file_dream11_od_service_v1_service_proto_init() { + if File_dream11_od_service_v1_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_dream11_od_service_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DescribeServiceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_dream11_od_service_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DescribeServiceResponse); 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_dream11_od_service_v1_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_dream11_od_service_v1_service_proto_goTypes, + DependencyIndexes: file_dream11_od_service_v1_service_proto_depIdxs, + MessageInfos: file_dream11_od_service_v1_service_proto_msgTypes, + }.Build() + File_dream11_od_service_v1_service_proto = out.File + file_dream11_od_service_v1_service_proto_rawDesc = nil + file_dream11_od_service_v1_service_proto_goTypes = nil + file_dream11_od_service_v1_service_proto_depIdxs = nil +} diff --git a/proto/gen/go/dream11/od/service/v1/service_grpc.pb.go b/proto/gen/go/dream11/od/service/v1/service_grpc.pb.go new file mode 100644 index 00000000..510de94a --- /dev/null +++ b/proto/gen/go/dream11/od/service/v1/service_grpc.pb.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.4 +// source: dream11/od/service/v1/service.proto + +package v1 + +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 ( + ServiceService_DescribeService_FullMethodName = "/dream11.od.service.v1.ServiceService/DescribeService" +) + +// ServiceServiceClient is the client API for ServiceService 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 ServiceServiceClient interface { + DescribeService(ctx context.Context, in *DescribeServiceRequest, opts ...grpc.CallOption) (*DescribeServiceResponse, error) +} + +type serviceServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewServiceServiceClient(cc grpc.ClientConnInterface) ServiceServiceClient { + return &serviceServiceClient{cc} +} + +func (c *serviceServiceClient) DescribeService(ctx context.Context, in *DescribeServiceRequest, opts ...grpc.CallOption) (*DescribeServiceResponse, error) { + out := new(DescribeServiceResponse) + err := c.cc.Invoke(ctx, ServiceService_DescribeService_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ServiceServiceServer is the server API for ServiceService service. +// All implementations must embed UnimplementedServiceServiceServer +// for forward compatibility +type ServiceServiceServer interface { + DescribeService(context.Context, *DescribeServiceRequest) (*DescribeServiceResponse, error) + mustEmbedUnimplementedServiceServiceServer() +} + +// UnimplementedServiceServiceServer must be embedded to have forward compatible implementations. +type UnimplementedServiceServiceServer struct { +} + +func (UnimplementedServiceServiceServer) DescribeService(context.Context, *DescribeServiceRequest) (*DescribeServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DescribeService not implemented") +} +func (UnimplementedServiceServiceServer) mustEmbedUnimplementedServiceServiceServer() {} + +// UnsafeServiceServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ServiceServiceServer will +// result in compilation errors. +type UnsafeServiceServiceServer interface { + mustEmbedUnimplementedServiceServiceServer() +} + +func RegisterServiceServiceServer(s grpc.ServiceRegistrar, srv ServiceServiceServer) { + s.RegisterService(&ServiceService_ServiceDesc, srv) +} + +func _ServiceService_DescribeService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DescribeServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServiceServer).DescribeService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceService_DescribeService_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServiceServer).DescribeService(ctx, req.(*DescribeServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ServiceService_ServiceDesc is the grpc.ServiceDesc for ServiceService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ServiceService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "dream11.od.service.v1.ServiceService", + HandlerType: (*ServiceServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "DescribeService", + Handler: _ServiceService_DescribeService_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "dream11/od/service/v1/service.proto", +}