This commit is contained in:
royalcat 2025-05-05 00:13:51 +04:00
parent 5da11dc01b
commit 647d73cb0d
8 changed files with 334 additions and 340 deletions
.vscode
proto/konfa/server/v1
src/proto

13
.vscode/settings.json vendored
View file

@ -4,5 +4,16 @@
"options": [
"--proto_path=proto",
]
}
},
"sqltools.connections": [
{
"previewLimit": 50,
"server": "localhost",
"port": 5432,
"driver": "PostgreSQL",
"name": "local",
"database": "konfa",
"username": "konfa"
}
]
}

View file

@ -8,33 +8,29 @@ option go_package = "/serverv1";
import "konfa/user/v1/user.proto";
import "konfa/channel/v1/channels.proto";
service ServerService {
rpc ListServerChannels(ListServerChannelsRequest) returns (ListServerChannelsResponse) {}
rpc ListServerUsers(ListServerUsersRequest) returns (ListServerUsersResponse) {}
rpc ListServerChannels(ListServerChannelsRequest)
returns (ListServerChannelsResponse) {}
rpc ListServerUsers(ListServerUsersRequest)
returns (ListServerUsersResponse) {}
rpc GetUser(GetUserRequest) returns (GetUserResponse) {}
rpc CurrentUser(CurrentUserRequest) returns (CurrentUserResponse) {}
}
message ListServerChannelsRequest {
string server_id = 1;
}
message CurrentUserRequest {}
message CurrentUserResponse { konfa.user.v1.User user = 1; }
message ListServerChannelsRequest { string server_id = 1; }
message ListServerChannelsResponse {
repeated konfa.channel.v1.Channel channels = 1;
}
message ListServerUsersRequest {
string server_id = 1;
}
message ListServerUsersRequest { string server_id = 1; }
message ListServerUsersResponse {
repeated konfa.user.v1.User users = 1;
}
message ListServerUsersResponse { repeated konfa.user.v1.User users = 1; }
message GetUserRequest {
string user_id = 1;
}
message GetUserRequest { string user_id = 1; }
message GetUserResponse {
konfa.user.v1.User user = 1;
}
message GetUserResponse { konfa.user.v1.User user = 1; }

View file

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc-gen-go v1.36.6
// protoc (unknown)
// source: konfa/channel/v1/channels.proto
@ -11,6 +11,7 @@ import (
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
@ -224,56 +225,33 @@ func (x *VoiceChannel) GetName() string {
var File_konfa_channel_v1_channels_proto protoreflect.FileDescriptor
var file_konfa_channel_v1_channels_proto_rawDesc = []byte{
0x0a, 0x1f, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2f,
0x76, 0x31, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x10, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c,
0x2e, 0x76, 0x31, 0x22, 0x9f, 0x01, 0x0a, 0x07, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12,
0x42, 0x0a, 0x0c, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68,
0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x43, 0x68, 0x61,
0x6e, 0x6e, 0x65, 0x6c, 0x48, 0x00, 0x52, 0x0b, 0x74, 0x65, 0x78, 0x74, 0x43, 0x68, 0x61, 0x6e,
0x6e, 0x65, 0x6c, 0x12, 0x45, 0x0a, 0x0d, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x5f, 0x63, 0x68, 0x61,
0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6b, 0x6f, 0x6e,
0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f,
0x69, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x48, 0x00, 0x52, 0x0c, 0x76, 0x6f,
0x69, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x42, 0x09, 0x0a, 0x07, 0x63, 0x68,
0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x22, 0x5d, 0x0a, 0x0b, 0x54, 0x65, 0x78, 0x74, 0x43, 0x68, 0x61,
0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49,
0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64,
0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x22, 0x5e, 0x0a, 0x0c, 0x56, 0x6f, 0x69, 0x63, 0x65, 0x43, 0x68, 0x61,
0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49,
0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64,
0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x42, 0xce, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x6b, 0x6f, 0x6e,
0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x43,
0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x79, 0x61, 0x6c,
0x63, 0x61, 0x74, 0x2f, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
0x2f, 0x73, 0x72, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6b, 0x6f, 0x6e, 0x66, 0x61,
0x2f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x68, 0x61, 0x6e,
0x6e, 0x65, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4b, 0x43, 0x58, 0xaa, 0x02, 0x10, 0x4b, 0x6f,
0x6e, 0x66, 0x61, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02,
0x10, 0x4b, 0x6f, 0x6e, 0x66, 0x61, 0x5c, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5c, 0x56,
0x31, 0xe2, 0x02, 0x1c, 0x4b, 0x6f, 0x6e, 0x66, 0x61, 0x5c, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65,
0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0xea, 0x02, 0x12, 0x4b, 0x6f, 0x6e, 0x66, 0x61, 0x3a, 0x3a, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65,
0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
const file_konfa_channel_v1_channels_proto_rawDesc = "" +
"\n" +
"\x1fkonfa/channel/v1/channels.proto\x12\x10konfa.channel.v1\"\x9f\x01\n" +
"\aChannel\x12B\n" +
"\ftext_channel\x18\x01 \x01(\v2\x1d.konfa.channel.v1.TextChannelH\x00R\vtextChannel\x12E\n" +
"\rvoice_channel\x18\x02 \x01(\v2\x1e.konfa.channel.v1.VoiceChannelH\x00R\fvoiceChannelB\t\n" +
"\achannel\"]\n" +
"\vTextChannel\x12\x1b\n" +
"\tserver_id\x18\x01 \x01(\tR\bserverId\x12\x1d\n" +
"\n" +
"channel_id\x18\x02 \x01(\tR\tchannelId\x12\x12\n" +
"\x04name\x18\x03 \x01(\tR\x04name\"^\n" +
"\fVoiceChannel\x12\x1b\n" +
"\tserver_id\x18\x01 \x01(\tR\bserverId\x12\x1d\n" +
"\n" +
"channel_id\x18\x02 \x01(\tR\tchannelId\x12\x12\n" +
"\x04name\x18\x03 \x01(\tR\x04nameB\xce\x01\n" +
"\x14com.konfa.channel.v1B\rChannelsProtoP\x01ZEgithub.com/royalcat/konfa-server/src/proto/konfa/channel/v1;channelv1\xa2\x02\x03KCX\xaa\x02\x10Konfa.Channel.V1\xca\x02\x10Konfa\\Channel\\V1\xe2\x02\x1cKonfa\\Channel\\V1\\GPBMetadata\xea\x02\x12Konfa::Channel::V1b\x06proto3"
var (
file_konfa_channel_v1_channels_proto_rawDescOnce sync.Once
file_konfa_channel_v1_channels_proto_rawDescData = file_konfa_channel_v1_channels_proto_rawDesc
file_konfa_channel_v1_channels_proto_rawDescData []byte
)
func file_konfa_channel_v1_channels_proto_rawDescGZIP() []byte {
file_konfa_channel_v1_channels_proto_rawDescOnce.Do(func() {
file_konfa_channel_v1_channels_proto_rawDescData = protoimpl.X.CompressGZIP(file_konfa_channel_v1_channels_proto_rawDescData)
file_konfa_channel_v1_channels_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_konfa_channel_v1_channels_proto_rawDesc), len(file_konfa_channel_v1_channels_proto_rawDesc)))
})
return file_konfa_channel_v1_channels_proto_rawDescData
}
@ -307,7 +285,7 @@ func file_konfa_channel_v1_channels_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_konfa_channel_v1_channels_proto_rawDesc,
RawDescriptor: unsafe.Slice(unsafe.StringData(file_konfa_channel_v1_channels_proto_rawDesc), len(file_konfa_channel_v1_channels_proto_rawDesc)),
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
@ -318,7 +296,6 @@ func file_konfa_channel_v1_channels_proto_init() {
MessageInfos: file_konfa_channel_v1_channels_proto_msgTypes,
}.Build()
File_konfa_channel_v1_channels_proto = out.File
file_konfa_channel_v1_channels_proto_rawDesc = nil
file_konfa_channel_v1_channels_proto_goTypes = nil
file_konfa_channel_v1_channels_proto_depIdxs = nil
}

View file

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc-gen-go v1.36.6
// protoc (unknown)
// source: konfa/chat/v1/service.proto
@ -12,6 +12,7 @@ import (
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
@ -697,140 +698,67 @@ func (x *UploadAttachmentResponse) GetAttachmenId() string {
var File_konfa_chat_v1_service_proto protoreflect.FileDescriptor
var file_konfa_chat_v1_service_proto_rawDesc = []byte{
0x0a, 0x1b, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x2f, 0x76, 0x31, 0x2f,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x6b,
0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x76, 0x31, 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, 0x4c, 0x0a,
0x0e, 0x54, 0x65, 0x78, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x66, 0x12,
0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a,
0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x22, 0x67, 0x0a, 0x12, 0x53,
0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x37, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e,
0x76, 0x31, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65,
0x66, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f,
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e,
0x74, 0x65, 0x6e, 0x74, 0x22, 0x34, 0x0a, 0x13, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x22, 0x99, 0x01, 0x0a, 0x07, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f,
0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72,
0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x09,
0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, 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, 0x52, 0x09, 0x74, 0x69, 0x6d,
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x99, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68, 0x61,
0x74, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c,
0x52, 0x65, 0x66, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x2e, 0x0a, 0x04,
0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 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, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x22, 0x4f, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x32, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x16, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x76,
0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x73, 0x22, 0x6b, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e,
0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6b, 0x6f, 0x6e, 0x66,
0x61, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x43, 0x68,
0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x66, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65,
0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64,
0x22, 0x46, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e,
0x63, 0x68, 0x61, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52,
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x53, 0x0a, 0x18, 0x53, 0x74, 0x72, 0x65,
0x61, 0x6d, 0x4e, 0x65, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68,
0x61, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65,
0x6c, 0x52, 0x65, 0x66, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x22, 0x3a, 0x0a,
0x19, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4e, 0x65, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x22, 0x75, 0x0a, 0x17, 0x55, 0x70, 0x6c,
0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e,
0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x6c,
0x6f, 0x61, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12,
0x14, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52,
0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
0x22, 0x2a, 0x0a, 0x14, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x70,
0x6c, 0x6f, 0x61, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3d, 0x0a, 0x18,
0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x74, 0x74, 0x61,
0x63, 0x68, 0x6d, 0x65, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x49, 0x64, 0x32, 0xf9, 0x03, 0x0a, 0x0b,
0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x56, 0x0a, 0x0b, 0x53,
0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x21, 0x2e, 0x6b, 0x6f, 0x6e,
0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e,
0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65,
0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x22, 0x00, 0x12, 0x68, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x27, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61,
0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x28, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x76,
0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x69, 0x73, 0x74,
0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x53, 0x0a,
0x0a, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x20, 0x2e, 0x6b, 0x6f,
0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e,
0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65,
0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x22, 0x00, 0x12, 0x6a, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4e, 0x65, 0x77, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x27, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e,
0x63, 0x68, 0x61, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4e, 0x65,
0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x28, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x76, 0x31,
0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4e, 0x65, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x67,
0x0a, 0x10, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65,
0x6e, 0x74, 0x12, 0x26, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e,
0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d,
0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6b, 0x6f, 0x6e,
0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61,
0x64, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x42, 0xb8, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e,
0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x79, 0x61, 0x6c, 0x63,
0x61, 0x74, 0x2f, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f,
0x73, 0x72, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2f,
0x63, 0x68, 0x61, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x68, 0x61, 0x74, 0x76, 0x31, 0xa2, 0x02,
0x03, 0x4b, 0x43, 0x58, 0xaa, 0x02, 0x0d, 0x4b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x43, 0x68, 0x61,
0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4b, 0x6f, 0x6e, 0x66, 0x61, 0x5c, 0x43, 0x68, 0x61,
0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4b, 0x6f, 0x6e, 0x66, 0x61, 0x5c, 0x43, 0x68, 0x61,
0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0xea, 0x02, 0x0f, 0x4b, 0x6f, 0x6e, 0x66, 0x61, 0x3a, 0x3a, 0x43, 0x68, 0x61, 0x74, 0x3a, 0x3a,
0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
const file_konfa_chat_v1_service_proto_rawDesc = "" +
"\n" +
"\x1bkonfa/chat/v1/service.proto\x12\rkonfa.chat.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"L\n" +
"\x0eTextChannelRef\x12\x1b\n" +
"\tserver_id\x18\x01 \x01(\tR\bserverId\x12\x1d\n" +
"\n" +
"channel_id\x18\x02 \x01(\tR\tchannelId\"g\n" +
"\x12SendMessageRequest\x127\n" +
"\achannel\x18\x01 \x01(\v2\x1d.konfa.chat.v1.TextChannelRefR\achannel\x12\x18\n" +
"\acontent\x18\x02 \x01(\tR\acontent\"4\n" +
"\x13SendMessageResponse\x12\x1d\n" +
"\n" +
"message_id\x18\x01 \x01(\tR\tmessageId\"\x99\x01\n" +
"\aMessage\x12\x1d\n" +
"\n" +
"message_id\x18\x01 \x01(\tR\tmessageId\x12\x1b\n" +
"\tsender_id\x18\x04 \x01(\tR\bsenderId\x12\x18\n" +
"\acontent\x18\x05 \x01(\tR\acontent\x128\n" +
"\ttimestamp\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"\x99\x01\n" +
"\x18GetMessageHistoryRequest\x127\n" +
"\achannel\x18\x01 \x01(\v2\x1d.konfa.chat.v1.TextChannelRefR\achannel\x12.\n" +
"\x04from\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x04from\x12\x14\n" +
"\x05count\x18\x03 \x01(\x05R\x05count\"O\n" +
"\x19GetMessageHistoryResponse\x122\n" +
"\bmessages\x18\x01 \x03(\v2\x16.konfa.chat.v1.MessageR\bmessages\"k\n" +
"\x11GetMessageRequest\x127\n" +
"\achannel\x18\x01 \x01(\v2\x1d.konfa.chat.v1.TextChannelRefR\achannel\x12\x1d\n" +
"\n" +
"message_id\x18\x02 \x01(\tR\tmessageId\"F\n" +
"\x12GetMessageResponse\x120\n" +
"\amessage\x18\x01 \x01(\v2\x16.konfa.chat.v1.MessageR\amessage\"S\n" +
"\x18StreamNewMessagesRequest\x127\n" +
"\achannel\x18\x01 \x01(\v2\x1d.konfa.chat.v1.TextChannelRefR\achannel\":\n" +
"\x19StreamNewMessagesResponse\x12\x1d\n" +
"\n" +
"message_id\x18\x01 \x01(\tR\tmessageId\"u\n" +
"\x17UploadAttachmentRequest\x129\n" +
"\x04info\x18\x01 \x01(\v2#.konfa.chat.v1.AttachmentUploadInfoH\x00R\x04info\x12\x14\n" +
"\x04data\x18\x02 \x01(\fH\x00R\x04dataB\t\n" +
"\apayload\"*\n" +
"\x14AttachmentUploadInfo\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\"=\n" +
"\x18UploadAttachmentResponse\x12!\n" +
"\fattachmen_id\x18\x01 \x01(\tR\vattachmenId2\xf9\x03\n" +
"\vChatService\x12V\n" +
"\vSendMessage\x12!.konfa.chat.v1.SendMessageRequest\x1a\".konfa.chat.v1.SendMessageResponse\"\x00\x12h\n" +
"\x11GetMessageHistory\x12'.konfa.chat.v1.GetMessageHistoryRequest\x1a(.konfa.chat.v1.GetMessageHistoryResponse\"\x00\x12S\n" +
"\n" +
"GetMessage\x12 .konfa.chat.v1.GetMessageRequest\x1a!.konfa.chat.v1.GetMessageResponse\"\x00\x12j\n" +
"\x11StreamNewMessages\x12'.konfa.chat.v1.StreamNewMessagesRequest\x1a(.konfa.chat.v1.StreamNewMessagesResponse\"\x000\x01\x12g\n" +
"\x10UploadAttachment\x12&.konfa.chat.v1.UploadAttachmentRequest\x1a'.konfa.chat.v1.UploadAttachmentResponse\"\x00(\x01B\xb8\x01\n" +
"\x11com.konfa.chat.v1B\fServiceProtoP\x01Z?github.com/royalcat/konfa-server/src/proto/konfa/chat/v1;chatv1\xa2\x02\x03KCX\xaa\x02\rKonfa.Chat.V1\xca\x02\rKonfa\\Chat\\V1\xe2\x02\x19Konfa\\Chat\\V1\\GPBMetadata\xea\x02\x0fKonfa::Chat::V1b\x06proto3"
var (
file_konfa_chat_v1_service_proto_rawDescOnce sync.Once
file_konfa_chat_v1_service_proto_rawDescData = file_konfa_chat_v1_service_proto_rawDesc
file_konfa_chat_v1_service_proto_rawDescData []byte
)
func file_konfa_chat_v1_service_proto_rawDescGZIP() []byte {
file_konfa_chat_v1_service_proto_rawDescOnce.Do(func() {
file_konfa_chat_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_konfa_chat_v1_service_proto_rawDescData)
file_konfa_chat_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_konfa_chat_v1_service_proto_rawDesc), len(file_konfa_chat_v1_service_proto_rawDesc)))
})
return file_konfa_chat_v1_service_proto_rawDescData
}
@ -892,7 +820,7 @@ func file_konfa_chat_v1_service_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_konfa_chat_v1_service_proto_rawDesc,
RawDescriptor: unsafe.Slice(unsafe.StringData(file_konfa_chat_v1_service_proto_rawDesc), len(file_konfa_chat_v1_service_proto_rawDesc)),
NumEnums: 0,
NumMessages: 13,
NumExtensions: 0,
@ -903,7 +831,6 @@ func file_konfa_chat_v1_service_proto_init() {
MessageInfos: file_konfa_chat_v1_service_proto_msgTypes,
}.Build()
File_konfa_chat_v1_service_proto = out.File
file_konfa_chat_v1_service_proto_rawDesc = nil
file_konfa_chat_v1_service_proto_goTypes = nil
file_konfa_chat_v1_service_proto_depIdxs = nil
}

View file

@ -1,18 +1,19 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc-gen-go v1.36.6
// protoc (unknown)
// source: konfa/server/v1/service.proto
package serverv1
import (
v1 "github.com/royalcat/konfa-server/src/proto/konfa/channel/v1"
v11 "github.com/royalcat/konfa-server/src/proto/konfa/user/v1"
v11 "github.com/royalcat/konfa-server/src/proto/konfa/channel/v1"
v1 "github.com/royalcat/konfa-server/src/proto/konfa/user/v1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
@ -22,6 +23,86 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type CurrentUserRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CurrentUserRequest) Reset() {
*x = CurrentUserRequest{}
mi := &file_konfa_server_v1_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CurrentUserRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CurrentUserRequest) ProtoMessage() {}
func (x *CurrentUserRequest) ProtoReflect() protoreflect.Message {
mi := &file_konfa_server_v1_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 CurrentUserRequest.ProtoReflect.Descriptor instead.
func (*CurrentUserRequest) Descriptor() ([]byte, []int) {
return file_konfa_server_v1_service_proto_rawDescGZIP(), []int{0}
}
type CurrentUserResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
User *v1.User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CurrentUserResponse) Reset() {
*x = CurrentUserResponse{}
mi := &file_konfa_server_v1_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CurrentUserResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CurrentUserResponse) ProtoMessage() {}
func (x *CurrentUserResponse) ProtoReflect() protoreflect.Message {
mi := &file_konfa_server_v1_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 CurrentUserResponse.ProtoReflect.Descriptor instead.
func (*CurrentUserResponse) Descriptor() ([]byte, []int) {
return file_konfa_server_v1_service_proto_rawDescGZIP(), []int{1}
}
func (x *CurrentUserResponse) GetUser() *v1.User {
if x != nil {
return x.User
}
return nil
}
type ListServerChannelsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
ServerId string `protobuf:"bytes,1,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"`
@ -31,7 +112,7 @@ type ListServerChannelsRequest struct {
func (x *ListServerChannelsRequest) Reset() {
*x = ListServerChannelsRequest{}
mi := &file_konfa_server_v1_service_proto_msgTypes[0]
mi := &file_konfa_server_v1_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -43,7 +124,7 @@ func (x *ListServerChannelsRequest) String() string {
func (*ListServerChannelsRequest) ProtoMessage() {}
func (x *ListServerChannelsRequest) ProtoReflect() protoreflect.Message {
mi := &file_konfa_server_v1_service_proto_msgTypes[0]
mi := &file_konfa_server_v1_service_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -56,7 +137,7 @@ func (x *ListServerChannelsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListServerChannelsRequest.ProtoReflect.Descriptor instead.
func (*ListServerChannelsRequest) Descriptor() ([]byte, []int) {
return file_konfa_server_v1_service_proto_rawDescGZIP(), []int{0}
return file_konfa_server_v1_service_proto_rawDescGZIP(), []int{2}
}
func (x *ListServerChannelsRequest) GetServerId() string {
@ -68,14 +149,14 @@ func (x *ListServerChannelsRequest) GetServerId() string {
type ListServerChannelsResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Channels []*v1.Channel `protobuf:"bytes,1,rep,name=channels,proto3" json:"channels,omitempty"`
Channels []*v11.Channel `protobuf:"bytes,1,rep,name=channels,proto3" json:"channels,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListServerChannelsResponse) Reset() {
*x = ListServerChannelsResponse{}
mi := &file_konfa_server_v1_service_proto_msgTypes[1]
mi := &file_konfa_server_v1_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -87,7 +168,7 @@ func (x *ListServerChannelsResponse) String() string {
func (*ListServerChannelsResponse) ProtoMessage() {}
func (x *ListServerChannelsResponse) ProtoReflect() protoreflect.Message {
mi := &file_konfa_server_v1_service_proto_msgTypes[1]
mi := &file_konfa_server_v1_service_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -100,10 +181,10 @@ func (x *ListServerChannelsResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListServerChannelsResponse.ProtoReflect.Descriptor instead.
func (*ListServerChannelsResponse) Descriptor() ([]byte, []int) {
return file_konfa_server_v1_service_proto_rawDescGZIP(), []int{1}
return file_konfa_server_v1_service_proto_rawDescGZIP(), []int{3}
}
func (x *ListServerChannelsResponse) GetChannels() []*v1.Channel {
func (x *ListServerChannelsResponse) GetChannels() []*v11.Channel {
if x != nil {
return x.Channels
}
@ -119,7 +200,7 @@ type ListServerUsersRequest struct {
func (x *ListServerUsersRequest) Reset() {
*x = ListServerUsersRequest{}
mi := &file_konfa_server_v1_service_proto_msgTypes[2]
mi := &file_konfa_server_v1_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -131,7 +212,7 @@ func (x *ListServerUsersRequest) String() string {
func (*ListServerUsersRequest) ProtoMessage() {}
func (x *ListServerUsersRequest) ProtoReflect() protoreflect.Message {
mi := &file_konfa_server_v1_service_proto_msgTypes[2]
mi := &file_konfa_server_v1_service_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -144,7 +225,7 @@ func (x *ListServerUsersRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListServerUsersRequest.ProtoReflect.Descriptor instead.
func (*ListServerUsersRequest) Descriptor() ([]byte, []int) {
return file_konfa_server_v1_service_proto_rawDescGZIP(), []int{2}
return file_konfa_server_v1_service_proto_rawDescGZIP(), []int{4}
}
func (x *ListServerUsersRequest) GetServerId() string {
@ -156,14 +237,14 @@ func (x *ListServerUsersRequest) GetServerId() string {
type ListServerUsersResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Users []*v11.User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
Users []*v1.User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListServerUsersResponse) Reset() {
*x = ListServerUsersResponse{}
mi := &file_konfa_server_v1_service_proto_msgTypes[3]
mi := &file_konfa_server_v1_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -175,7 +256,7 @@ func (x *ListServerUsersResponse) String() string {
func (*ListServerUsersResponse) ProtoMessage() {}
func (x *ListServerUsersResponse) ProtoReflect() protoreflect.Message {
mi := &file_konfa_server_v1_service_proto_msgTypes[3]
mi := &file_konfa_server_v1_service_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -188,10 +269,10 @@ func (x *ListServerUsersResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListServerUsersResponse.ProtoReflect.Descriptor instead.
func (*ListServerUsersResponse) Descriptor() ([]byte, []int) {
return file_konfa_server_v1_service_proto_rawDescGZIP(), []int{3}
return file_konfa_server_v1_service_proto_rawDescGZIP(), []int{5}
}
func (x *ListServerUsersResponse) GetUsers() []*v11.User {
func (x *ListServerUsersResponse) GetUsers() []*v1.User {
if x != nil {
return x.Users
}
@ -207,7 +288,7 @@ type GetUserRequest struct {
func (x *GetUserRequest) Reset() {
*x = GetUserRequest{}
mi := &file_konfa_server_v1_service_proto_msgTypes[4]
mi := &file_konfa_server_v1_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -219,7 +300,7 @@ func (x *GetUserRequest) String() string {
func (*GetUserRequest) ProtoMessage() {}
func (x *GetUserRequest) ProtoReflect() protoreflect.Message {
mi := &file_konfa_server_v1_service_proto_msgTypes[4]
mi := &file_konfa_server_v1_service_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -232,7 +313,7 @@ func (x *GetUserRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.
func (*GetUserRequest) Descriptor() ([]byte, []int) {
return file_konfa_server_v1_service_proto_rawDescGZIP(), []int{4}
return file_konfa_server_v1_service_proto_rawDescGZIP(), []int{6}
}
func (x *GetUserRequest) GetUserId() string {
@ -244,14 +325,14 @@ func (x *GetUserRequest) GetUserId() string {
type GetUserResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
User *v11.User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
User *v1.User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetUserResponse) Reset() {
*x = GetUserResponse{}
mi := &file_konfa_server_v1_service_proto_msgTypes[5]
mi := &file_konfa_server_v1_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -263,7 +344,7 @@ func (x *GetUserResponse) String() string {
func (*GetUserResponse) ProtoMessage() {}
func (x *GetUserResponse) ProtoReflect() protoreflect.Message {
mi := &file_konfa_server_v1_service_proto_msgTypes[5]
mi := &file_konfa_server_v1_service_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -276,10 +357,10 @@ func (x *GetUserResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead.
func (*GetUserResponse) Descriptor() ([]byte, []int) {
return file_konfa_server_v1_service_proto_rawDescGZIP(), []int{5}
return file_konfa_server_v1_service_proto_rawDescGZIP(), []int{7}
}
func (x *GetUserResponse) GetUser() *v11.User {
func (x *GetUserResponse) GetUser() *v1.User {
if x != nil {
return x.User
}
@ -288,110 +369,74 @@ func (x *GetUserResponse) GetUser() *v11.User {
var File_konfa_server_v1_service_proto protoreflect.FileDescriptor
var file_konfa_server_v1_service_proto_rawDesc = []byte{
0x0a, 0x1d, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x76,
0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x0f, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31,
0x1a, 0x18, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f,
0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x6b, 0x6f, 0x6e, 0x66,
0x61, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x68, 0x61,
0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x38, 0x0a, 0x19, 0x4c,
0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x49, 0x64, 0x22, 0x53, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x63, 0x68,
0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c,
0x52, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x22, 0x35, 0x0a, 0x16, 0x4c, 0x69,
0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49,
0x64, 0x22, 0x44, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55,
0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x05,
0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6b, 0x6f,
0x6e, 0x66, 0x61, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72,
0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x29, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73,
0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65,
0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72,
0x49, 0x64, 0x22, 0x3a, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x75, 0x73, 0x65, 0x72,
0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x32, 0xb8,
0x02, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x12, 0x6f, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x68,
0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x12, 0x2a, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x73,
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43,
0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x00, 0x12, 0x66, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55,
0x73, 0x65, 0x72, 0x73, 0x12, 0x27, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65,
0x72, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e,
0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e,
0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x07, 0x47, 0x65, 0x74,
0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x73, 0x65,
0x72, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xc6, 0x01, 0x0a, 0x13, 0x63, 0x6f,
0x6d, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x76,
0x31, 0x42, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
0x01, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f,
0x79, 0x61, 0x6c, 0x63, 0x61, 0x74, 0x2f, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2d, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x2f, 0x73, 0x72, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6b, 0x6f,
0x6e, 0x66, 0x61, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65,
0x72, 0x76, 0x65, 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4b, 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x4b,
0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02,
0x0f, 0x4b, 0x6f, 0x6e, 0x66, 0x61, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5c, 0x56, 0x31,
0xe2, 0x02, 0x1b, 0x4b, 0x6f, 0x6e, 0x66, 0x61, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5c,
0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02,
0x11, 0x4b, 0x6f, 0x6e, 0x66, 0x61, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x3a,
0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
const file_konfa_server_v1_service_proto_rawDesc = "" +
"\n" +
"\x1dkonfa/server/v1/service.proto\x12\x0fkonfa.server.v1\x1a\x18konfa/user/v1/user.proto\x1a\x1fkonfa/channel/v1/channels.proto\"\x14\n" +
"\x12CurrentUserRequest\">\n" +
"\x13CurrentUserResponse\x12'\n" +
"\x04user\x18\x01 \x01(\v2\x13.konfa.user.v1.UserR\x04user\"8\n" +
"\x19ListServerChannelsRequest\x12\x1b\n" +
"\tserver_id\x18\x01 \x01(\tR\bserverId\"S\n" +
"\x1aListServerChannelsResponse\x125\n" +
"\bchannels\x18\x01 \x03(\v2\x19.konfa.channel.v1.ChannelR\bchannels\"5\n" +
"\x16ListServerUsersRequest\x12\x1b\n" +
"\tserver_id\x18\x01 \x01(\tR\bserverId\"D\n" +
"\x17ListServerUsersResponse\x12)\n" +
"\x05users\x18\x01 \x03(\v2\x13.konfa.user.v1.UserR\x05users\")\n" +
"\x0eGetUserRequest\x12\x17\n" +
"\auser_id\x18\x01 \x01(\tR\x06userId\":\n" +
"\x0fGetUserResponse\x12'\n" +
"\x04user\x18\x01 \x01(\v2\x13.konfa.user.v1.UserR\x04user2\x94\x03\n" +
"\rServerService\x12o\n" +
"\x12ListServerChannels\x12*.konfa.server.v1.ListServerChannelsRequest\x1a+.konfa.server.v1.ListServerChannelsResponse\"\x00\x12f\n" +
"\x0fListServerUsers\x12'.konfa.server.v1.ListServerUsersRequest\x1a(.konfa.server.v1.ListServerUsersResponse\"\x00\x12N\n" +
"\aGetUser\x12\x1f.konfa.server.v1.GetUserRequest\x1a .konfa.server.v1.GetUserResponse\"\x00\x12Z\n" +
"\vCurrentUser\x12#.konfa.server.v1.CurrentUserRequest\x1a$.konfa.server.v1.CurrentUserResponse\"\x00B\xc6\x01\n" +
"\x13com.konfa.server.v1B\fServiceProtoP\x01ZCgithub.com/royalcat/konfa-server/src/proto/konfa/server/v1;serverv1\xa2\x02\x03KSX\xaa\x02\x0fKonfa.Server.V1\xca\x02\x0fKonfa\\Server\\V1\xe2\x02\x1bKonfa\\Server\\V1\\GPBMetadata\xea\x02\x11Konfa::Server::V1b\x06proto3"
var (
file_konfa_server_v1_service_proto_rawDescOnce sync.Once
file_konfa_server_v1_service_proto_rawDescData = file_konfa_server_v1_service_proto_rawDesc
file_konfa_server_v1_service_proto_rawDescData []byte
)
func file_konfa_server_v1_service_proto_rawDescGZIP() []byte {
file_konfa_server_v1_service_proto_rawDescOnce.Do(func() {
file_konfa_server_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_konfa_server_v1_service_proto_rawDescData)
file_konfa_server_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_konfa_server_v1_service_proto_rawDesc), len(file_konfa_server_v1_service_proto_rawDesc)))
})
return file_konfa_server_v1_service_proto_rawDescData
}
var file_konfa_server_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_konfa_server_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_konfa_server_v1_service_proto_goTypes = []any{
(*ListServerChannelsRequest)(nil), // 0: konfa.server.v1.ListServerChannelsRequest
(*ListServerChannelsResponse)(nil), // 1: konfa.server.v1.ListServerChannelsResponse
(*ListServerUsersRequest)(nil), // 2: konfa.server.v1.ListServerUsersRequest
(*ListServerUsersResponse)(nil), // 3: konfa.server.v1.ListServerUsersResponse
(*GetUserRequest)(nil), // 4: konfa.server.v1.GetUserRequest
(*GetUserResponse)(nil), // 5: konfa.server.v1.GetUserResponse
(*v1.Channel)(nil), // 6: konfa.channel.v1.Channel
(*v11.User)(nil), // 7: konfa.user.v1.User
(*CurrentUserRequest)(nil), // 0: konfa.server.v1.CurrentUserRequest
(*CurrentUserResponse)(nil), // 1: konfa.server.v1.CurrentUserResponse
(*ListServerChannelsRequest)(nil), // 2: konfa.server.v1.ListServerChannelsRequest
(*ListServerChannelsResponse)(nil), // 3: konfa.server.v1.ListServerChannelsResponse
(*ListServerUsersRequest)(nil), // 4: konfa.server.v1.ListServerUsersRequest
(*ListServerUsersResponse)(nil), // 5: konfa.server.v1.ListServerUsersResponse
(*GetUserRequest)(nil), // 6: konfa.server.v1.GetUserRequest
(*GetUserResponse)(nil), // 7: konfa.server.v1.GetUserResponse
(*v1.User)(nil), // 8: konfa.user.v1.User
(*v11.Channel)(nil), // 9: konfa.channel.v1.Channel
}
var file_konfa_server_v1_service_proto_depIdxs = []int32{
6, // 0: konfa.server.v1.ListServerChannelsResponse.channels:type_name -> konfa.channel.v1.Channel
7, // 1: konfa.server.v1.ListServerUsersResponse.users:type_name -> konfa.user.v1.User
7, // 2: konfa.server.v1.GetUserResponse.user:type_name -> konfa.user.v1.User
0, // 3: konfa.server.v1.ServerService.ListServerChannels:input_type -> konfa.server.v1.ListServerChannelsRequest
2, // 4: konfa.server.v1.ServerService.ListServerUsers:input_type -> konfa.server.v1.ListServerUsersRequest
4, // 5: konfa.server.v1.ServerService.GetUser:input_type -> konfa.server.v1.GetUserRequest
1, // 6: konfa.server.v1.ServerService.ListServerChannels:output_type -> konfa.server.v1.ListServerChannelsResponse
3, // 7: konfa.server.v1.ServerService.ListServerUsers:output_type -> konfa.server.v1.ListServerUsersResponse
5, // 8: konfa.server.v1.ServerService.GetUser:output_type -> konfa.server.v1.GetUserResponse
6, // [6:9] is the sub-list for method output_type
3, // [3:6] 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
8, // 0: konfa.server.v1.CurrentUserResponse.user:type_name -> konfa.user.v1.User
9, // 1: konfa.server.v1.ListServerChannelsResponse.channels:type_name -> konfa.channel.v1.Channel
8, // 2: konfa.server.v1.ListServerUsersResponse.users:type_name -> konfa.user.v1.User
8, // 3: konfa.server.v1.GetUserResponse.user:type_name -> konfa.user.v1.User
2, // 4: konfa.server.v1.ServerService.ListServerChannels:input_type -> konfa.server.v1.ListServerChannelsRequest
4, // 5: konfa.server.v1.ServerService.ListServerUsers:input_type -> konfa.server.v1.ListServerUsersRequest
6, // 6: konfa.server.v1.ServerService.GetUser:input_type -> konfa.server.v1.GetUserRequest
0, // 7: konfa.server.v1.ServerService.CurrentUser:input_type -> konfa.server.v1.CurrentUserRequest
3, // 8: konfa.server.v1.ServerService.ListServerChannels:output_type -> konfa.server.v1.ListServerChannelsResponse
5, // 9: konfa.server.v1.ServerService.ListServerUsers:output_type -> konfa.server.v1.ListServerUsersResponse
7, // 10: konfa.server.v1.ServerService.GetUser:output_type -> konfa.server.v1.GetUserResponse
1, // 11: konfa.server.v1.ServerService.CurrentUser:output_type -> konfa.server.v1.CurrentUserResponse
8, // [8:12] is the sub-list for method output_type
4, // [4:8] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_konfa_server_v1_service_proto_init() }
@ -403,9 +448,9 @@ func file_konfa_server_v1_service_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_konfa_server_v1_service_proto_rawDesc,
RawDescriptor: unsafe.Slice(unsafe.StringData(file_konfa_server_v1_service_proto_rawDesc), len(file_konfa_server_v1_service_proto_rawDesc)),
NumEnums: 0,
NumMessages: 6,
NumMessages: 8,
NumExtensions: 0,
NumServices: 1,
},
@ -414,7 +459,6 @@ func file_konfa_server_v1_service_proto_init() {
MessageInfos: file_konfa_server_v1_service_proto_msgTypes,
}.Build()
File_konfa_server_v1_service_proto = out.File
file_konfa_server_v1_service_proto_rawDesc = nil
file_konfa_server_v1_service_proto_goTypes = nil
file_konfa_server_v1_service_proto_depIdxs = nil
}

View file

@ -22,6 +22,7 @@ const (
ServerService_ListServerChannels_FullMethodName = "/konfa.server.v1.ServerService/ListServerChannels"
ServerService_ListServerUsers_FullMethodName = "/konfa.server.v1.ServerService/ListServerUsers"
ServerService_GetUser_FullMethodName = "/konfa.server.v1.ServerService/GetUser"
ServerService_CurrentUser_FullMethodName = "/konfa.server.v1.ServerService/CurrentUser"
)
// ServerServiceClient is the client API for ServerService service.
@ -31,6 +32,7 @@ type ServerServiceClient interface {
ListServerChannels(ctx context.Context, in *ListServerChannelsRequest, opts ...grpc.CallOption) (*ListServerChannelsResponse, error)
ListServerUsers(ctx context.Context, in *ListServerUsersRequest, opts ...grpc.CallOption) (*ListServerUsersResponse, error)
GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error)
CurrentUser(ctx context.Context, in *CurrentUserRequest, opts ...grpc.CallOption) (*CurrentUserResponse, error)
}
type serverServiceClient struct {
@ -71,6 +73,16 @@ func (c *serverServiceClient) GetUser(ctx context.Context, in *GetUserRequest, o
return out, nil
}
func (c *serverServiceClient) CurrentUser(ctx context.Context, in *CurrentUserRequest, opts ...grpc.CallOption) (*CurrentUserResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CurrentUserResponse)
err := c.cc.Invoke(ctx, ServerService_CurrentUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ServerServiceServer is the server API for ServerService service.
// All implementations should embed UnimplementedServerServiceServer
// for forward compatibility.
@ -78,6 +90,7 @@ type ServerServiceServer interface {
ListServerChannels(context.Context, *ListServerChannelsRequest) (*ListServerChannelsResponse, error)
ListServerUsers(context.Context, *ListServerUsersRequest) (*ListServerUsersResponse, error)
GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
CurrentUser(context.Context, *CurrentUserRequest) (*CurrentUserResponse, error)
}
// UnimplementedServerServiceServer should be embedded to have
@ -96,6 +109,9 @@ func (UnimplementedServerServiceServer) ListServerUsers(context.Context, *ListSe
func (UnimplementedServerServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented")
}
func (UnimplementedServerServiceServer) CurrentUser(context.Context, *CurrentUserRequest) (*CurrentUserResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CurrentUser not implemented")
}
func (UnimplementedServerServiceServer) testEmbeddedByValue() {}
// UnsafeServerServiceServer may be embedded to opt out of forward compatibility for this service.
@ -170,6 +186,24 @@ func _ServerService_GetUser_Handler(srv interface{}, ctx context.Context, dec fu
return interceptor(ctx, in, info, handler)
}
func _ServerService_CurrentUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CurrentUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ServerServiceServer).CurrentUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ServerService_CurrentUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ServerServiceServer).CurrentUser(ctx, req.(*CurrentUserRequest))
}
return interceptor(ctx, in, info, handler)
}
// ServerService_ServiceDesc is the grpc.ServiceDesc for ServerService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -189,6 +223,10 @@ var ServerService_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetUser",
Handler: _ServerService_GetUser_Handler,
},
{
MethodName: "CurrentUser",
Handler: _ServerService_CurrentUser_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "konfa/server/v1/service.proto",

View file

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc-gen-go v1.36.6
// protoc (unknown)
// source: konfa/user/v1/user.proto
@ -11,6 +11,7 @@ import (
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
@ -74,35 +75,22 @@ func (x *User) GetUsername() string {
var File_konfa_user_v1_user_proto protoreflect.FileDescriptor
var file_konfa_user_v1_user_proto_rawDesc = []byte{
0x0a, 0x18, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f,
0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x6b, 0x6f, 0x6e, 0x66,
0x61, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x22, 0x32, 0x0a, 0x04, 0x55, 0x73, 0x65,
0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69,
0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0xb5, 0x01,
0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2e, 0x75, 0x73, 0x65, 0x72,
0x2e, 0x76, 0x31, 0x42, 0x09, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x79,
0x61, 0x6c, 0x63, 0x61, 0x74, 0x2f, 0x6b, 0x6f, 0x6e, 0x66, 0x61, 0x2d, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x2f, 0x73, 0x72, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6b, 0x6f, 0x6e,
0x66, 0x61, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x76,
0x31, 0xa2, 0x02, 0x03, 0x4b, 0x55, 0x58, 0xaa, 0x02, 0x0d, 0x4b, 0x6f, 0x6e, 0x66, 0x61, 0x2e,
0x55, 0x73, 0x65, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4b, 0x6f, 0x6e, 0x66, 0x61, 0x5c,
0x55, 0x73, 0x65, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4b, 0x6f, 0x6e, 0x66, 0x61, 0x5c,
0x55, 0x73, 0x65, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64,
0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x4b, 0x6f, 0x6e, 0x66, 0x61, 0x3a, 0x3a, 0x55, 0x73, 0x65,
0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
const file_konfa_user_v1_user_proto_rawDesc = "" +
"\n" +
"\x18konfa/user/v1/user.proto\x12\rkonfa.user.v1\"2\n" +
"\x04User\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" +
"\busername\x18\x02 \x01(\tR\busernameB\xb5\x01\n" +
"\x11com.konfa.user.v1B\tUserProtoP\x01Z?github.com/royalcat/konfa-server/src/proto/konfa/user/v1;userv1\xa2\x02\x03KUX\xaa\x02\rKonfa.User.V1\xca\x02\rKonfa\\User\\V1\xe2\x02\x19Konfa\\User\\V1\\GPBMetadata\xea\x02\x0fKonfa::User::V1b\x06proto3"
var (
file_konfa_user_v1_user_proto_rawDescOnce sync.Once
file_konfa_user_v1_user_proto_rawDescData = file_konfa_user_v1_user_proto_rawDesc
file_konfa_user_v1_user_proto_rawDescData []byte
)
func file_konfa_user_v1_user_proto_rawDescGZIP() []byte {
file_konfa_user_v1_user_proto_rawDescOnce.Do(func() {
file_konfa_user_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_konfa_user_v1_user_proto_rawDescData)
file_konfa_user_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_konfa_user_v1_user_proto_rawDesc), len(file_konfa_user_v1_user_proto_rawDesc)))
})
return file_konfa_user_v1_user_proto_rawDescData
}
@ -128,7 +116,7 @@ func file_konfa_user_v1_user_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_konfa_user_v1_user_proto_rawDesc,
RawDescriptor: unsafe.Slice(unsafe.StringData(file_konfa_user_v1_user_proto_rawDesc), len(file_konfa_user_v1_user_proto_rawDesc)),
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
@ -139,7 +127,6 @@ func file_konfa_user_v1_user_proto_init() {
MessageInfos: file_konfa_user_v1_user_proto_msgTypes,
}.Build()
File_konfa_user_v1_user_proto = out.File
file_konfa_user_v1_user_proto_rawDesc = nil
file_konfa_user_v1_user_proto_goTypes = nil
file_konfa_user_v1_user_proto_depIdxs = nil
}

View file

@ -2,8 +2,10 @@ package proto
import (
"context"
"fmt"
"github.com/royalcat/konfa-server/pkg/uuid"
"github.com/royalcat/konfa-server/src/auth"
"github.com/royalcat/konfa-server/src/konfa"
channelv1 "github.com/royalcat/konfa-server/src/proto/konfa/channel/v1"
serverv1 "github.com/royalcat/konfa-server/src/proto/konfa/server/v1"
@ -80,3 +82,15 @@ func (s *ServerService) GetUser(ctx context.Context, req *serverv1.GetUserReques
User: mapUser(users),
}, nil
}
// CurrentUser implements serverv1.ServerServiceServer.
func (s *ServerService) CurrentUser(ctx context.Context, req *serverv1.CurrentUserRequest) (*serverv1.CurrentUserResponse, error) {
user := auth.CtxGetUser(ctx)
if user == nil {
return nil, fmt.Errorf("user not found in context")
}
return &serverv1.CurrentUserResponse{
User: mapUser(*user),
}, nil
}