import template code
This commit is contained in:
@@ -0,0 +1,170 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.5
|
||||
// protoc v3.21.12
|
||||
// source: mlbctl.proto
|
||||
|
||||
package mlbctl
|
||||
|
||||
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 GetHelloParams struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetHelloParams) Reset() {
|
||||
*x = GetHelloParams{}
|
||||
mi := &file_mlbctl_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetHelloParams) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetHelloParams) ProtoMessage() {}
|
||||
|
||||
func (x *GetHelloParams) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mlbctl_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 GetHelloParams.ProtoReflect.Descriptor instead.
|
||||
func (*GetHelloParams) Descriptor() ([]byte, []int) {
|
||||
return file_mlbctl_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type GetHelloResult struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetHelloResult) Reset() {
|
||||
*x = GetHelloResult{}
|
||||
mi := &file_mlbctl_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetHelloResult) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetHelloResult) ProtoMessage() {}
|
||||
|
||||
func (x *GetHelloResult) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_mlbctl_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 GetHelloResult.ProtoReflect.Descriptor instead.
|
||||
func (*GetHelloResult) Descriptor() ([]byte, []int) {
|
||||
return file_mlbctl_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetHelloResult) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_mlbctl_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_mlbctl_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x0c, 0x6d, 0x6c, 0x62, 0x63, 0x74, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06,
|
||||
0x6d, 0x6c, 0x62, 0x63, 0x74, 0x6c, 0x22, 0x10, 0x0a, 0x0e, 0x67, 0x65, 0x74, 0x48, 0x65, 0x6c,
|
||||
0x6c, 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x2a, 0x0a, 0x0e, 0x67, 0x65, 0x74, 0x48,
|
||||
0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, 0x75, 0x6c, 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, 0x32, 0x47, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12,
|
||||
0x3c, 0x0a, 0x08, 0x67, 0x65, 0x74, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x16, 0x2e, 0x6d, 0x6c,
|
||||
0x62, 0x63, 0x74, 0x6c, 0x2e, 0x67, 0x65, 0x74, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x50, 0x61, 0x72,
|
||||
0x61, 0x6d, 0x73, 0x1a, 0x16, 0x2e, 0x6d, 0x6c, 0x62, 0x63, 0x74, 0x6c, 0x2e, 0x67, 0x65, 0x74,
|
||||
0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x42, 0x0a, 0x5a,
|
||||
0x08, 0x2e, 0x3b, 0x6d, 0x6c, 0x62, 0x63, 0x74, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
})
|
||||
|
||||
var (
|
||||
file_mlbctl_proto_rawDescOnce sync.Once
|
||||
file_mlbctl_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_mlbctl_proto_rawDescGZIP() []byte {
|
||||
file_mlbctl_proto_rawDescOnce.Do(func() {
|
||||
file_mlbctl_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_mlbctl_proto_rawDesc), len(file_mlbctl_proto_rawDesc)))
|
||||
})
|
||||
return file_mlbctl_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_mlbctl_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_mlbctl_proto_goTypes = []any{
|
||||
(*GetHelloParams)(nil), // 0: mlbctl.getHelloParams
|
||||
(*GetHelloResult)(nil), // 1: mlbctl.getHelloResult
|
||||
}
|
||||
var file_mlbctl_proto_depIdxs = []int32{
|
||||
0, // 0: mlbctl.Control.getHello:input_type -> mlbctl.getHelloParams
|
||||
1, // 1: mlbctl.Control.getHello:output_type -> mlbctl.getHelloResult
|
||||
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_mlbctl_proto_init() }
|
||||
func file_mlbctl_proto_init() {
|
||||
if File_mlbctl_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_mlbctl_proto_rawDesc), len(file_mlbctl_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_mlbctl_proto_goTypes,
|
||||
DependencyIndexes: file_mlbctl_proto_depIdxs,
|
||||
MessageInfos: file_mlbctl_proto_msgTypes,
|
||||
}.Build()
|
||||
File_mlbctl_proto = out.File
|
||||
file_mlbctl_proto_goTypes = nil
|
||||
file_mlbctl_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v3.21.12
|
||||
// source: mlbctl.proto
|
||||
|
||||
package mlbctl
|
||||
|
||||
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.62.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion8
|
||||
|
||||
const (
|
||||
Control_GetHello_FullMethodName = "/mlbctl.Control/getHello"
|
||||
)
|
||||
|
||||
// ControlClient is the client API for Control 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 ControlClient interface {
|
||||
GetHello(ctx context.Context, in *GetHelloParams, opts ...grpc.CallOption) (*GetHelloResult, error)
|
||||
}
|
||||
|
||||
type controlClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewControlClient(cc grpc.ClientConnInterface) ControlClient {
|
||||
return &controlClient{cc}
|
||||
}
|
||||
|
||||
func (c *controlClient) GetHello(ctx context.Context, in *GetHelloParams, opts ...grpc.CallOption) (*GetHelloResult, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetHelloResult)
|
||||
err := c.cc.Invoke(ctx, Control_GetHello_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ControlServer is the server API for Control service.
|
||||
// All implementations must embed UnimplementedControlServer
|
||||
// for forward compatibility
|
||||
type ControlServer interface {
|
||||
GetHello(context.Context, *GetHelloParams) (*GetHelloResult, error)
|
||||
mustEmbedUnimplementedControlServer()
|
||||
}
|
||||
|
||||
// UnimplementedControlServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedControlServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedControlServer) GetHello(context.Context, *GetHelloParams) (*GetHelloResult, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetHello not implemented")
|
||||
}
|
||||
func (UnimplementedControlServer) mustEmbedUnimplementedControlServer() {}
|
||||
|
||||
// UnsafeControlServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ControlServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeControlServer interface {
|
||||
mustEmbedUnimplementedControlServer()
|
||||
}
|
||||
|
||||
func RegisterControlServer(s grpc.ServiceRegistrar, srv ControlServer) {
|
||||
s.RegisterService(&Control_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Control_GetHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetHelloParams)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ControlServer).GetHello(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Control_GetHello_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ControlServer).GetHello(ctx, req.(*GetHelloParams))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Control_ServiceDesc is the grpc.ServiceDesc for Control service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Control_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "mlbctl.Control",
|
||||
HandlerType: (*ControlServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "getHello",
|
||||
Handler: _Control_GetHello_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "mlbctl.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user