wfz 3 лет назад
Родитель
Сommit
962bc2f53a

+ 261 - 0
api/websocket/websocket.pb.go

@@ -0,0 +1,261 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.26.0-devel
+// 	protoc        v3.15.8
+// source: websocket.proto
+
+package websocket
+
+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"
+)
+
+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 FindOnlinePersonReply struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+}
+
+func (x *FindOnlinePersonReply) Reset() {
+	*x = FindOnlinePersonReply{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_websocket_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *FindOnlinePersonReply) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*FindOnlinePersonReply) ProtoMessage() {}
+
+func (x *FindOnlinePersonReply) ProtoReflect() protoreflect.Message {
+	mi := &file_websocket_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 FindOnlinePersonReply.ProtoReflect.Descriptor instead.
+func (*FindOnlinePersonReply) Descriptor() ([]byte, []int) {
+	return file_websocket_proto_rawDescGZIP(), []int{0}
+}
+
+type TransmitMessageRequest struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+}
+
+func (x *TransmitMessageRequest) Reset() {
+	*x = TransmitMessageRequest{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_websocket_proto_msgTypes[1]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *TransmitMessageRequest) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TransmitMessageRequest) ProtoMessage() {}
+
+func (x *TransmitMessageRequest) ProtoReflect() protoreflect.Message {
+	mi := &file_websocket_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 TransmitMessageRequest.ProtoReflect.Descriptor instead.
+func (*TransmitMessageRequest) Descriptor() ([]byte, []int) {
+	return file_websocket_proto_rawDescGZIP(), []int{1}
+}
+
+type TransmitMessageReply struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+}
+
+func (x *TransmitMessageReply) Reset() {
+	*x = TransmitMessageReply{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_websocket_proto_msgTypes[2]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *TransmitMessageReply) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TransmitMessageReply) ProtoMessage() {}
+
+func (x *TransmitMessageReply) ProtoReflect() protoreflect.Message {
+	mi := &file_websocket_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 TransmitMessageReply.ProtoReflect.Descriptor instead.
+func (*TransmitMessageReply) Descriptor() ([]byte, []int) {
+	return file_websocket_proto_rawDescGZIP(), []int{2}
+}
+
+var File_websocket_proto protoreflect.FileDescriptor
+
+var file_websocket_proto_rawDesc = []byte{
+	0x0a, 0x0f, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+	0x6f, 0x12, 0x0d, 0x61, 0x70, 0x69, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74,
+	0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
+	0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x17, 0x0a,
+	0x15, 0x46, 0x69, 0x6e, 0x64, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f,
+	0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x18, 0x0a, 0x16, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d,
+	0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+	0x22, 0x16, 0x0a, 0x14, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73,
+	0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x32, 0xbc, 0x01, 0x0a, 0x09, 0x57, 0x65, 0x62,
+	0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x5d, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d,
+	0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e,
+	0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d,
+	0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+	0x1a, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74,
+	0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+	0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x50, 0x0a, 0x10, 0x46, 0x69, 0x6e, 0x64, 0x4f, 0x6e, 0x6c,
+	0x69, 0x6e, 0x65, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+	0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74,
+	0x79, 0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65,
+	0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x72, 0x73,
+	0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x4c, 0x0a, 0x0d, 0x61, 0x70, 0x69, 0x2e, 0x77,
+	0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x2e,
+	0x69, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65,
+	0x72, 0x2f, 0x70, 0x77, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x70,
+	0x69, 0x2f, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x3b, 0x77, 0x65, 0x62, 0x73,
+	0x6f, 0x63, 0x6b, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+	file_websocket_proto_rawDescOnce sync.Once
+	file_websocket_proto_rawDescData = file_websocket_proto_rawDesc
+)
+
+func file_websocket_proto_rawDescGZIP() []byte {
+	file_websocket_proto_rawDescOnce.Do(func() {
+		file_websocket_proto_rawDescData = protoimpl.X.CompressGZIP(file_websocket_proto_rawDescData)
+	})
+	return file_websocket_proto_rawDescData
+}
+
+var file_websocket_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
+var file_websocket_proto_goTypes = []interface{}{
+	(*FindOnlinePersonReply)(nil),  // 0: api.websocket.FindOnlinePersonReply
+	(*TransmitMessageRequest)(nil), // 1: api.websocket.TransmitMessageRequest
+	(*TransmitMessageReply)(nil),   // 2: api.websocket.TransmitMessageReply
+	(*emptypb.Empty)(nil),          // 3: google.protobuf.Empty
+}
+var file_websocket_proto_depIdxs = []int32{
+	1, // 0: api.websocket.Websocket.TransmitMessage:input_type -> api.websocket.TransmitMessageRequest
+	3, // 1: api.websocket.Websocket.FindOnlinePerson:input_type -> google.protobuf.Empty
+	2, // 2: api.websocket.Websocket.TransmitMessage:output_type -> api.websocket.TransmitMessageReply
+	0, // 3: api.websocket.Websocket.FindOnlinePerson:output_type -> api.websocket.FindOnlinePersonReply
+	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_websocket_proto_init() }
+func file_websocket_proto_init() {
+	if File_websocket_proto != nil {
+		return
+	}
+	if !protoimpl.UnsafeEnabled {
+		file_websocket_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*FindOnlinePersonReply); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_websocket_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*TransmitMessageRequest); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_websocket_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*TransmitMessageReply); 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_websocket_proto_rawDesc,
+			NumEnums:      0,
+			NumMessages:   3,
+			NumExtensions: 0,
+			NumServices:   1,
+		},
+		GoTypes:           file_websocket_proto_goTypes,
+		DependencyIndexes: file_websocket_proto_depIdxs,
+		MessageInfos:      file_websocket_proto_msgTypes,
+	}.Build()
+	File_websocket_proto = out.File
+	file_websocket_proto_rawDesc = nil
+	file_websocket_proto_goTypes = nil
+	file_websocket_proto_depIdxs = nil
+}

+ 28 - 0
api/websocket/websocket.proto

@@ -0,0 +1,28 @@
+syntax = "proto3";
+
+package api.websocket;
+
+//import "google/api/annotations.proto";
+//import "google/protobuf/struct.proto";
+import "google/protobuf/empty.proto";
+
+option go_package = "git.ikuban.com/server/pw-protobuf/api/websocket;websocket";
+option java_multiple_files = true;
+option java_package = "api.websocket";
+
+service Websocket {
+  rpc TransmitMessage (TransmitMessageRequest) returns (TransmitMessageReply);
+  rpc FindOnlinePerson (google.protobuf.Empty) returns (FindOnlinePersonReply);
+}
+
+message FindOnlinePersonReply{
+
+}
+
+message TransmitMessageRequest{
+
+}
+
+message TransmitMessageReply{
+
+}

+ 138 - 0
api/websocket/websocket_grpc.pb.go

@@ -0,0 +1,138 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+
+package websocket
+
+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
+
+// WebsocketClient is the client API for Websocket 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 WebsocketClient interface {
+	TransmitMessage(ctx context.Context, in *TransmitMessageRequest, opts ...grpc.CallOption) (*TransmitMessageReply, error)
+	FindOnlinePerson(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*FindOnlinePersonReply, error)
+}
+
+type websocketClient struct {
+	cc grpc.ClientConnInterface
+}
+
+func NewWebsocketClient(cc grpc.ClientConnInterface) WebsocketClient {
+	return &websocketClient{cc}
+}
+
+func (c *websocketClient) TransmitMessage(ctx context.Context, in *TransmitMessageRequest, opts ...grpc.CallOption) (*TransmitMessageReply, error) {
+	out := new(TransmitMessageReply)
+	err := c.cc.Invoke(ctx, "/api.websocket.Websocket/TransmitMessage", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *websocketClient) FindOnlinePerson(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*FindOnlinePersonReply, error) {
+	out := new(FindOnlinePersonReply)
+	err := c.cc.Invoke(ctx, "/api.websocket.Websocket/FindOnlinePerson", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+// WebsocketServer is the server API for Websocket service.
+// All implementations must embed UnimplementedWebsocketServer
+// for forward compatibility
+type WebsocketServer interface {
+	TransmitMessage(context.Context, *TransmitMessageRequest) (*TransmitMessageReply, error)
+	FindOnlinePerson(context.Context, *emptypb.Empty) (*FindOnlinePersonReply, error)
+	mustEmbedUnimplementedWebsocketServer()
+}
+
+// UnimplementedWebsocketServer must be embedded to have forward compatible implementations.
+type UnimplementedWebsocketServer struct {
+}
+
+func (UnimplementedWebsocketServer) TransmitMessage(context.Context, *TransmitMessageRequest) (*TransmitMessageReply, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method TransmitMessage not implemented")
+}
+func (UnimplementedWebsocketServer) FindOnlinePerson(context.Context, *emptypb.Empty) (*FindOnlinePersonReply, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method FindOnlinePerson not implemented")
+}
+func (UnimplementedWebsocketServer) mustEmbedUnimplementedWebsocketServer() {}
+
+// UnsafeWebsocketServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to WebsocketServer will
+// result in compilation errors.
+type UnsafeWebsocketServer interface {
+	mustEmbedUnimplementedWebsocketServer()
+}
+
+func RegisterWebsocketServer(s grpc.ServiceRegistrar, srv WebsocketServer) {
+	s.RegisterService(&Websocket_ServiceDesc, srv)
+}
+
+func _Websocket_TransmitMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(TransmitMessageRequest)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(WebsocketServer).TransmitMessage(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.websocket.Websocket/TransmitMessage",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(WebsocketServer).TransmitMessage(ctx, req.(*TransmitMessageRequest))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Websocket_FindOnlinePerson_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(emptypb.Empty)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(WebsocketServer).FindOnlinePerson(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/api.websocket.Websocket/FindOnlinePerson",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(WebsocketServer).FindOnlinePerson(ctx, req.(*emptypb.Empty))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+// Websocket_ServiceDesc is the grpc.ServiceDesc for Websocket service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var Websocket_ServiceDesc = grpc.ServiceDesc{
+	ServiceName: "api.websocket.Websocket",
+	HandlerType: (*WebsocketServer)(nil),
+	Methods: []grpc.MethodDesc{
+		{
+			MethodName: "TransmitMessage",
+			Handler:    _Websocket_TransmitMessage_Handler,
+		},
+		{
+			MethodName: "FindOnlinePerson",
+			Handler:    _Websocket_FindOnlinePerson_Handler,
+		},
+	},
+	Streams:  []grpc.StreamDesc{},
+	Metadata: "websocket.proto",
+}

+ 7 - 0
js/api/websocket/websocket_pb.ts

@@ -0,0 +1,7 @@
+export interface FindOnlinePersonReply{
+}
+export interface TransmitMessageRequest{
+}
+export interface TransmitMessageReply{
+}
+