Compare commits
No commits in common. "be5ac2dc40f3b6648d1e671bfbfbe1426eeb701b" and "3a741152fc86b31e7792e31d80ee9bb992a8453f" have entirely different histories.
be5ac2dc40
...
3a741152fc
575
ai.pb.go
575
ai.pb.go
@ -28,8 +28,6 @@ type AIRequest struct {
|
||||
BotUsername string `protobuf:"bytes,2,opt,name=bot_username,json=botUsername,proto3" json:"bot_username,omitempty"` // Username бота для упоминаний
|
||||
ModelName string `protobuf:"bytes,3,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"` // Название модели (по умолчанию "venice-uncensored")
|
||||
EnableReasoning bool `protobuf:"varint,4,opt,name=enable_reasoning,json=enableReasoning,proto3" json:"enable_reasoning,omitempty"` // Включить режим рассуждений (по умолчанию false)
|
||||
GlobalUserId int64 `protobuf:"varint,5,opt,name=global_user_id,json=globalUserId,proto3" json:"global_user_id,omitempty"` // Global user ID для получения доп. данных (профиль, воспоминания)
|
||||
Options *AnswerGenerationOptions `protobuf:"bytes,6,opt,name=options,proto3" json:"options,omitempty"` // Дополнительные опции генерации ответа
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@ -92,65 +90,6 @@ func (x *AIRequest) GetEnableReasoning() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *AIRequest) GetGlobalUserId() int64 {
|
||||
if x != nil {
|
||||
return x.GlobalUserId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AIRequest) GetOptions() *AnswerGenerationOptions {
|
||||
if x != nil {
|
||||
return x.Options
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// AnswerGenerationOptions содержит дополнительные опции для генерации ответа
|
||||
type AnswerGenerationOptions struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
IncludeUserMemories bool `protobuf:"varint,1,opt,name=include_user_memories,json=includeUserMemories,proto3" json:"include_user_memories,omitempty"` // Включить воспоминания о пользователе в промпт
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AnswerGenerationOptions) Reset() {
|
||||
*x = AnswerGenerationOptions{}
|
||||
mi := &file_ai_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AnswerGenerationOptions) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AnswerGenerationOptions) ProtoMessage() {}
|
||||
|
||||
func (x *AnswerGenerationOptions) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ai_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 AnswerGenerationOptions.ProtoReflect.Descriptor instead.
|
||||
func (*AnswerGenerationOptions) Descriptor() ([]byte, []int) {
|
||||
return file_ai_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *AnswerGenerationOptions) GetIncludeUserMemories() bool {
|
||||
if x != nil {
|
||||
return x.IncludeUserMemories
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// AIResponse содержит ответ от AI модели
|
||||
type AIResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
@ -164,7 +103,7 @@ type AIResponse struct {
|
||||
|
||||
func (x *AIResponse) Reset() {
|
||||
*x = AIResponse{}
|
||||
mi := &file_ai_proto_msgTypes[2]
|
||||
mi := &file_ai_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -176,7 +115,7 @@ func (x *AIResponse) String() string {
|
||||
func (*AIResponse) ProtoMessage() {}
|
||||
|
||||
func (x *AIResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ai_proto_msgTypes[2]
|
||||
mi := &file_ai_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -189,7 +128,7 @@ func (x *AIResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use AIResponse.ProtoReflect.Descriptor instead.
|
||||
func (*AIResponse) Descriptor() ([]byte, []int) {
|
||||
return file_ai_proto_rawDescGZIP(), []int{2}
|
||||
return file_ai_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *AIResponse) GetContent() string {
|
||||
@ -220,404 +159,6 @@ func (x *AIResponse) GetReasoningContent() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// CreateSessionRequest для создания новой AI сессии
|
||||
type CreateSessionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // Идентификатор пользователя
|
||||
BotUsername string `protobuf:"bytes,2,opt,name=bot_username,json=botUsername,proto3" json:"bot_username,omitempty"` // Username бота для упоминаний
|
||||
ModelName string `protobuf:"bytes,3,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"` // Название модели (по умолчанию "venice-uncensored")
|
||||
TtlSeconds int64 `protobuf:"varint,4,opt,name=ttl_seconds,json=ttlSeconds,proto3" json:"ttl_seconds,omitempty"` // Время жизни сессии в секундах (по умолчанию 3600 = 1 час)
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CreateSessionRequest) Reset() {
|
||||
*x = CreateSessionRequest{}
|
||||
mi := &file_ai_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CreateSessionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CreateSessionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *CreateSessionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ai_proto_msgTypes[3]
|
||||
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 CreateSessionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*CreateSessionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_ai_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *CreateSessionRequest) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreateSessionRequest) GetBotUsername() string {
|
||||
if x != nil {
|
||||
return x.BotUsername
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreateSessionRequest) GetModelName() string {
|
||||
if x != nil {
|
||||
return x.ModelName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreateSessionRequest) GetTtlSeconds() int64 {
|
||||
if x != nil {
|
||||
return x.TtlSeconds
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// CreateSessionResponse содержит ID созданной сессии
|
||||
type CreateSessionResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` // ID сессии
|
||||
Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // Статус сессии
|
||||
Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` // Текст ошибки, если произошла
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CreateSessionResponse) Reset() {
|
||||
*x = CreateSessionResponse{}
|
||||
mi := &file_ai_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CreateSessionResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CreateSessionResponse) ProtoMessage() {}
|
||||
|
||||
func (x *CreateSessionResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ai_proto_msgTypes[4]
|
||||
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 CreateSessionResponse.ProtoReflect.Descriptor instead.
|
||||
func (*CreateSessionResponse) Descriptor() ([]byte, []int) {
|
||||
return file_ai_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *CreateSessionResponse) GetSessionId() string {
|
||||
if x != nil {
|
||||
return x.SessionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreateSessionResponse) GetStatus() string {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreateSessionResponse) GetError() string {
|
||||
if x != nil {
|
||||
return x.Error
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// AskInSessionRequest для запроса в рамках сессии
|
||||
type AskInSessionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` // ID сессии
|
||||
Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` // Текст запроса
|
||||
EnableReasoning bool `protobuf:"varint,3,opt,name=enable_reasoning,json=enableReasoning,proto3" json:"enable_reasoning,omitempty"` // Включить режим рассуждений (по умолчанию false)
|
||||
GlobalUserId int64 `protobuf:"varint,4,opt,name=global_user_id,json=globalUserId,proto3" json:"global_user_id,omitempty"` // Global user ID для получения воспоминаний
|
||||
Options *AnswerGenerationOptions `protobuf:"bytes,5,opt,name=options,proto3" json:"options,omitempty"` // Дополнительные опции генерации
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *AskInSessionRequest) Reset() {
|
||||
*x = AskInSessionRequest{}
|
||||
mi := &file_ai_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *AskInSessionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AskInSessionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *AskInSessionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ai_proto_msgTypes[5]
|
||||
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 AskInSessionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*AskInSessionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_ai_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *AskInSessionRequest) GetSessionId() string {
|
||||
if x != nil {
|
||||
return x.SessionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AskInSessionRequest) GetText() string {
|
||||
if x != nil {
|
||||
return x.Text
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AskInSessionRequest) GetEnableReasoning() bool {
|
||||
if x != nil {
|
||||
return x.EnableReasoning
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *AskInSessionRequest) GetGlobalUserId() int64 {
|
||||
if x != nil {
|
||||
return x.GlobalUserId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *AskInSessionRequest) GetOptions() *AnswerGenerationOptions {
|
||||
if x != nil {
|
||||
return x.Options
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SessionStatusResponse содержит статус сессии и ответ AI
|
||||
type SessionStatusResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` // ID сессии
|
||||
Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // Статус сессии (active, expired, closed)
|
||||
Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` // Текст ответа от AI
|
||||
Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` // Текст ошибки, если произошла
|
||||
DurationMs float64 `protobuf:"fixed64,5,opt,name=duration_ms,json=durationMs,proto3" json:"duration_ms,omitempty"` // Время выполнения в миллисекундах
|
||||
ReasoningContent string `protobuf:"bytes,6,opt,name=reasoning_content,json=reasoningContent,proto3" json:"reasoning_content,omitempty"` // Текст рассуждений (если включён режим reasoning)
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SessionStatusResponse) Reset() {
|
||||
*x = SessionStatusResponse{}
|
||||
mi := &file_ai_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SessionStatusResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SessionStatusResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SessionStatusResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ai_proto_msgTypes[6]
|
||||
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 SessionStatusResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SessionStatusResponse) Descriptor() ([]byte, []int) {
|
||||
return file_ai_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *SessionStatusResponse) GetSessionId() string {
|
||||
if x != nil {
|
||||
return x.SessionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SessionStatusResponse) GetStatus() string {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SessionStatusResponse) GetContent() string {
|
||||
if x != nil {
|
||||
return x.Content
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SessionStatusResponse) GetError() string {
|
||||
if x != nil {
|
||||
return x.Error
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SessionStatusResponse) GetDurationMs() float64 {
|
||||
if x != nil {
|
||||
return x.DurationMs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SessionStatusResponse) GetReasoningContent() string {
|
||||
if x != nil {
|
||||
return x.ReasoningContent
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// StatelessMessage одно сообщение для stateless запроса (role + content)
|
||||
type StatelessMessage struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` // "system", "user", "assistant"
|
||||
Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` // Текст сообщения
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StatelessMessage) Reset() {
|
||||
*x = StatelessMessage{}
|
||||
mi := &file_ai_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StatelessMessage) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StatelessMessage) ProtoMessage() {}
|
||||
|
||||
func (x *StatelessMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ai_proto_msgTypes[7]
|
||||
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 StatelessMessage.ProtoReflect.Descriptor instead.
|
||||
func (*StatelessMessage) Descriptor() ([]byte, []int) {
|
||||
return file_ai_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *StatelessMessage) GetRole() string {
|
||||
if x != nil {
|
||||
return x.Role
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *StatelessMessage) GetContent() string {
|
||||
if x != nil {
|
||||
return x.Content
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// StatelessRequest для stateless генерации с полным контролем над messages
|
||||
type StatelessRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Messages []*StatelessMessage `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` // Массив сообщений (system + history + user)
|
||||
ModelName string `protobuf:"bytes,2,opt,name=model_name,json=modelName,proto3" json:"model_name,omitempty"` // Название модели (по умолчанию "venice-uncensored")
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StatelessRequest) Reset() {
|
||||
*x = StatelessRequest{}
|
||||
mi := &file_ai_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StatelessRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StatelessRequest) ProtoMessage() {}
|
||||
|
||||
func (x *StatelessRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ai_proto_msgTypes[8]
|
||||
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 StatelessRequest.ProtoReflect.Descriptor instead.
|
||||
func (*StatelessRequest) Descriptor() ([]byte, []int) {
|
||||
return file_ai_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *StatelessRequest) GetMessages() []*StatelessMessage {
|
||||
if x != nil {
|
||||
return x.Messages
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *StatelessRequest) GetModelName() string {
|
||||
if x != nil {
|
||||
return x.ModelName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// HealthCheckRequest для проверки здоровья сервиса
|
||||
type HealthCheckRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
@ -627,7 +168,7 @@ type HealthCheckRequest struct {
|
||||
|
||||
func (x *HealthCheckRequest) Reset() {
|
||||
*x = HealthCheckRequest{}
|
||||
mi := &file_ai_proto_msgTypes[9]
|
||||
mi := &file_ai_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -639,7 +180,7 @@ func (x *HealthCheckRequest) String() string {
|
||||
func (*HealthCheckRequest) ProtoMessage() {}
|
||||
|
||||
func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ai_proto_msgTypes[9]
|
||||
mi := &file_ai_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -652,7 +193,7 @@ func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead.
|
||||
func (*HealthCheckRequest) Descriptor() ([]byte, []int) {
|
||||
return file_ai_proto_rawDescGZIP(), []int{9}
|
||||
return file_ai_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
// HealthCheckResponse для ответа на проверку здоровья
|
||||
@ -666,7 +207,7 @@ type HealthCheckResponse struct {
|
||||
|
||||
func (x *HealthCheckResponse) Reset() {
|
||||
*x = HealthCheckResponse{}
|
||||
mi := &file_ai_proto_msgTypes[10]
|
||||
mi := &file_ai_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -678,7 +219,7 @@ func (x *HealthCheckResponse) String() string {
|
||||
func (*HealthCheckResponse) ProtoMessage() {}
|
||||
|
||||
func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_ai_proto_msgTypes[10]
|
||||
mi := &file_ai_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -691,7 +232,7 @@ func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead.
|
||||
func (*HealthCheckResponse) Descriptor() ([]byte, []int) {
|
||||
return file_ai_proto_rawDescGZIP(), []int{10}
|
||||
return file_ai_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *HealthCheckResponse) GetServing() bool {
|
||||
@ -712,69 +253,27 @@ var File_ai_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_ai_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\bai.proto\x12\x02ai\"\xe9\x01\n" +
|
||||
"\bai.proto\x12\x02ai\"\x8c\x01\n" +
|
||||
"\tAIRequest\x12\x12\n" +
|
||||
"\x04text\x18\x01 \x01(\tR\x04text\x12!\n" +
|
||||
"\fbot_username\x18\x02 \x01(\tR\vbotUsername\x12\x1d\n" +
|
||||
"\n" +
|
||||
"model_name\x18\x03 \x01(\tR\tmodelName\x12)\n" +
|
||||
"\x10enable_reasoning\x18\x04 \x01(\bR\x0fenableReasoning\x12$\n" +
|
||||
"\x0eglobal_user_id\x18\x05 \x01(\x03R\fglobalUserId\x125\n" +
|
||||
"\aoptions\x18\x06 \x01(\v2\x1b.ai.AnswerGenerationOptionsR\aoptions\"M\n" +
|
||||
"\x17AnswerGenerationOptions\x122\n" +
|
||||
"\x15include_user_memories\x18\x01 \x01(\bR\x13includeUserMemories\"\x8a\x01\n" +
|
||||
"\x10enable_reasoning\x18\x04 \x01(\bR\x0fenableReasoning\"\x8a\x01\n" +
|
||||
"\n" +
|
||||
"AIResponse\x12\x18\n" +
|
||||
"\acontent\x18\x01 \x01(\tR\acontent\x12\x14\n" +
|
||||
"\x05error\x18\x02 \x01(\tR\x05error\x12\x1f\n" +
|
||||
"\vduration_ms\x18\x03 \x01(\x01R\n" +
|
||||
"durationMs\x12+\n" +
|
||||
"\x11reasoning_content\x18\x04 \x01(\tR\x10reasoningContent\"\x92\x01\n" +
|
||||
"\x14CreateSessionRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\tR\x06userId\x12!\n" +
|
||||
"\fbot_username\x18\x02 \x01(\tR\vbotUsername\x12\x1d\n" +
|
||||
"\n" +
|
||||
"model_name\x18\x03 \x01(\tR\tmodelName\x12\x1f\n" +
|
||||
"\vttl_seconds\x18\x04 \x01(\x03R\n" +
|
||||
"ttlSeconds\"d\n" +
|
||||
"\x15CreateSessionResponse\x12\x1d\n" +
|
||||
"\n" +
|
||||
"session_id\x18\x01 \x01(\tR\tsessionId\x12\x16\n" +
|
||||
"\x06status\x18\x02 \x01(\tR\x06status\x12\x14\n" +
|
||||
"\x05error\x18\x03 \x01(\tR\x05error\"\xd0\x01\n" +
|
||||
"\x13AskInSessionRequest\x12\x1d\n" +
|
||||
"\n" +
|
||||
"session_id\x18\x01 \x01(\tR\tsessionId\x12\x12\n" +
|
||||
"\x04text\x18\x02 \x01(\tR\x04text\x12)\n" +
|
||||
"\x10enable_reasoning\x18\x03 \x01(\bR\x0fenableReasoning\x12$\n" +
|
||||
"\x0eglobal_user_id\x18\x04 \x01(\x03R\fglobalUserId\x125\n" +
|
||||
"\aoptions\x18\x05 \x01(\v2\x1b.ai.AnswerGenerationOptionsR\aoptions\"\xcc\x01\n" +
|
||||
"\x15SessionStatusResponse\x12\x1d\n" +
|
||||
"\n" +
|
||||
"session_id\x18\x01 \x01(\tR\tsessionId\x12\x16\n" +
|
||||
"\x06status\x18\x02 \x01(\tR\x06status\x12\x18\n" +
|
||||
"\acontent\x18\x03 \x01(\tR\acontent\x12\x14\n" +
|
||||
"\x05error\x18\x04 \x01(\tR\x05error\x12\x1f\n" +
|
||||
"\vduration_ms\x18\x05 \x01(\x01R\n" +
|
||||
"durationMs\x12+\n" +
|
||||
"\x11reasoning_content\x18\x06 \x01(\tR\x10reasoningContent\"@\n" +
|
||||
"\x10StatelessMessage\x12\x12\n" +
|
||||
"\x04role\x18\x01 \x01(\tR\x04role\x12\x18\n" +
|
||||
"\acontent\x18\x02 \x01(\tR\acontent\"c\n" +
|
||||
"\x10StatelessRequest\x120\n" +
|
||||
"\bmessages\x18\x01 \x03(\v2\x14.ai.StatelessMessageR\bmessages\x12\x1d\n" +
|
||||
"\n" +
|
||||
"model_name\x18\x02 \x01(\tR\tmodelName\"\x14\n" +
|
||||
"\x11reasoning_content\x18\x04 \x01(\tR\x10reasoningContent\"\x14\n" +
|
||||
"\x12HealthCheckRequest\"I\n" +
|
||||
"\x13HealthCheckResponse\x12\x18\n" +
|
||||
"\aserving\x18\x01 \x01(\bR\aserving\x12\x18\n" +
|
||||
"\aversion\x18\x02 \x01(\tR\aversion2\xc1\x02\n" +
|
||||
"\aversion\x18\x02 \x01(\tR\aversion2|\n" +
|
||||
"\tAIService\x12/\n" +
|
||||
"\x0eGenerateAnswer\x12\r.ai.AIRequest\x1a\x0e.ai.AIResponse\x129\n" +
|
||||
"\x11GenerateStateless\x12\x14.ai.StatelessRequest\x1a\x0e.ai.AIResponse\x12>\n" +
|
||||
"\vHealthCheck\x12\x16.ai.HealthCheckRequest\x1a\x17.ai.HealthCheckResponse\x12D\n" +
|
||||
"\rCreateSession\x12\x18.ai.CreateSessionRequest\x1a\x19.ai.CreateSessionResponse\x12B\n" +
|
||||
"\fAskInSession\x12\x17.ai.AskInSessionRequest\x1a\x19.ai.SessionStatusResponseB,Z*git.be.kaien.ru/l-ai/l-ai-core-proto/protob\x06proto3"
|
||||
"\x0eGenerateAnswer\x12\r.ai.AIRequest\x1a\x0e.ai.AIResponse\x12>\n" +
|
||||
"\vHealthCheck\x12\x16.ai.HealthCheckRequest\x1a\x17.ai.HealthCheckResponseB,Z*git.be.kaien.ru/l-ai/l-ai-core-proto/protob\x06proto3"
|
||||
|
||||
var (
|
||||
file_ai_proto_rawDescOnce sync.Once
|
||||
@ -788,39 +287,23 @@ func file_ai_proto_rawDescGZIP() []byte {
|
||||
return file_ai_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_ai_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||
var file_ai_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_ai_proto_goTypes = []any{
|
||||
(*AIRequest)(nil), // 0: ai.AIRequest
|
||||
(*AnswerGenerationOptions)(nil), // 1: ai.AnswerGenerationOptions
|
||||
(*AIResponse)(nil), // 2: ai.AIResponse
|
||||
(*CreateSessionRequest)(nil), // 3: ai.CreateSessionRequest
|
||||
(*CreateSessionResponse)(nil), // 4: ai.CreateSessionResponse
|
||||
(*AskInSessionRequest)(nil), // 5: ai.AskInSessionRequest
|
||||
(*SessionStatusResponse)(nil), // 6: ai.SessionStatusResponse
|
||||
(*StatelessMessage)(nil), // 7: ai.StatelessMessage
|
||||
(*StatelessRequest)(nil), // 8: ai.StatelessRequest
|
||||
(*HealthCheckRequest)(nil), // 9: ai.HealthCheckRequest
|
||||
(*HealthCheckResponse)(nil), // 10: ai.HealthCheckResponse
|
||||
(*AIResponse)(nil), // 1: ai.AIResponse
|
||||
(*HealthCheckRequest)(nil), // 2: ai.HealthCheckRequest
|
||||
(*HealthCheckResponse)(nil), // 3: ai.HealthCheckResponse
|
||||
}
|
||||
var file_ai_proto_depIdxs = []int32{
|
||||
1, // 0: ai.AIRequest.options:type_name -> ai.AnswerGenerationOptions
|
||||
1, // 1: ai.AskInSessionRequest.options:type_name -> ai.AnswerGenerationOptions
|
||||
7, // 2: ai.StatelessRequest.messages:type_name -> ai.StatelessMessage
|
||||
0, // 3: ai.AIService.GenerateAnswer:input_type -> ai.AIRequest
|
||||
8, // 4: ai.AIService.GenerateStateless:input_type -> ai.StatelessRequest
|
||||
9, // 5: ai.AIService.HealthCheck:input_type -> ai.HealthCheckRequest
|
||||
3, // 6: ai.AIService.CreateSession:input_type -> ai.CreateSessionRequest
|
||||
5, // 7: ai.AIService.AskInSession:input_type -> ai.AskInSessionRequest
|
||||
2, // 8: ai.AIService.GenerateAnswer:output_type -> ai.AIResponse
|
||||
2, // 9: ai.AIService.GenerateStateless:output_type -> ai.AIResponse
|
||||
10, // 10: ai.AIService.HealthCheck:output_type -> ai.HealthCheckResponse
|
||||
4, // 11: ai.AIService.CreateSession:output_type -> ai.CreateSessionResponse
|
||||
6, // 12: ai.AIService.AskInSession:output_type -> ai.SessionStatusResponse
|
||||
8, // [8:13] is the sub-list for method output_type
|
||||
3, // [3:8] 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
|
||||
0, // 0: ai.AIService.GenerateAnswer:input_type -> ai.AIRequest
|
||||
2, // 1: ai.AIService.HealthCheck:input_type -> ai.HealthCheckRequest
|
||||
1, // 2: ai.AIService.GenerateAnswer:output_type -> ai.AIResponse
|
||||
3, // 3: ai.AIService.HealthCheck:output_type -> ai.HealthCheckResponse
|
||||
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_ai_proto_init() }
|
||||
@ -834,7 +317,7 @@ func file_ai_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ai_proto_rawDesc), len(file_ai_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 11,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
||||
62
ai.proto
62
ai.proto
@ -10,13 +10,6 @@ message AIRequest {
|
||||
string bot_username = 2; // Username бота для упоминаний
|
||||
string model_name = 3; // Название модели (по умолчанию "venice-uncensored")
|
||||
bool enable_reasoning = 4; // Включить режим рассуждений (по умолчанию false)
|
||||
int64 global_user_id = 5; // Global user ID для получения доп. данных (профиль, воспоминания)
|
||||
AnswerGenerationOptions options = 6; // Дополнительные опции генерации ответа
|
||||
}
|
||||
|
||||
// AnswerGenerationOptions содержит дополнительные опции для генерации ответа
|
||||
message AnswerGenerationOptions {
|
||||
bool include_user_memories = 1; // Включить воспоминания о пользователе в промпт
|
||||
}
|
||||
|
||||
// AIResponse содержит ответ от AI модели
|
||||
@ -27,52 +20,6 @@ message AIResponse {
|
||||
string reasoning_content = 4; // Текст рассуждений (если включён режим reasoning)
|
||||
}
|
||||
|
||||
// CreateSessionRequest для создания новой AI сессии
|
||||
message CreateSessionRequest {
|
||||
string user_id = 1; // Идентификатор пользователя
|
||||
string bot_username = 2; // Username бота для упоминаний
|
||||
string model_name = 3; // Название модели (по умолчанию "venice-uncensored")
|
||||
int64 ttl_seconds = 4; // Время жизни сессии в секундах (по умолчанию 3600 = 1 час)
|
||||
}
|
||||
|
||||
// CreateSessionResponse содержит ID созданной сессии
|
||||
message CreateSessionResponse {
|
||||
string session_id = 1; // ID сессии
|
||||
string status = 2; // Статус сессии
|
||||
string error = 3; // Текст ошибки, если произошла
|
||||
}
|
||||
|
||||
// AskInSessionRequest для запроса в рамках сессии
|
||||
message AskInSessionRequest {
|
||||
string session_id = 1; // ID сессии
|
||||
string text = 2; // Текст запроса
|
||||
bool enable_reasoning = 3; // Включить режим рассуждений (по умолчанию false)
|
||||
int64 global_user_id = 4; // Global user ID для получения воспоминаний
|
||||
AnswerGenerationOptions options = 5; // Дополнительные опции генерации
|
||||
}
|
||||
|
||||
// SessionStatusResponse содержит статус сессии и ответ AI
|
||||
message SessionStatusResponse {
|
||||
string session_id = 1; // ID сессии
|
||||
string status = 2; // Статус сессии (active, expired, closed)
|
||||
string content = 3; // Текст ответа от AI
|
||||
string error = 4; // Текст ошибки, если произошла
|
||||
double duration_ms = 5; // Время выполнения в миллисекундах
|
||||
string reasoning_content = 6; // Текст рассуждений (если включён режим reasoning)
|
||||
}
|
||||
|
||||
// StatelessMessage одно сообщение для stateless запроса (role + content)
|
||||
message StatelessMessage {
|
||||
string role = 1; // "system", "user", "assistant"
|
||||
string content = 2; // Текст сообщения
|
||||
}
|
||||
|
||||
// StatelessRequest для stateless генерации с полным контролем над messages
|
||||
message StatelessRequest {
|
||||
repeated StatelessMessage messages = 1; // Массив сообщений (system + history + user)
|
||||
string model_name = 2; // Название модели (по умолчанию "venice-uncensored")
|
||||
}
|
||||
|
||||
// HealthCheckRequest для проверки здоровья сервиса
|
||||
message HealthCheckRequest {}
|
||||
|
||||
@ -87,15 +34,6 @@ service AIService {
|
||||
// GenerateAnswer генерирует ответ на запрос
|
||||
rpc GenerateAnswer(AIRequest) returns (AIResponse);
|
||||
|
||||
// GenerateStateless генерирует ответ из массива messages (system+history+user)
|
||||
rpc GenerateStateless(StatelessRequest) returns (AIResponse);
|
||||
|
||||
// HealthCheck проверяет здоровье сервиса
|
||||
rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse);
|
||||
|
||||
// CreateSession созда новую AI сессию
|
||||
rpc CreateSession(CreateSessionRequest) returns (CreateSessionResponse);
|
||||
|
||||
// AskInSession отправляет запрос в рамках существующей сессии
|
||||
rpc AskInSession(AskInSessionRequest) returns (SessionStatusResponse);
|
||||
}
|
||||
|
||||
120
ai_grpc.pb.go
120
ai_grpc.pb.go
@ -20,10 +20,7 @@ const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
AIService_GenerateAnswer_FullMethodName = "/ai.AIService/GenerateAnswer"
|
||||
AIService_GenerateStateless_FullMethodName = "/ai.AIService/GenerateStateless"
|
||||
AIService_HealthCheck_FullMethodName = "/ai.AIService/HealthCheck"
|
||||
AIService_CreateSession_FullMethodName = "/ai.AIService/CreateSession"
|
||||
AIService_AskInSession_FullMethodName = "/ai.AIService/AskInSession"
|
||||
)
|
||||
|
||||
// AIServiceClient is the client API for AIService service.
|
||||
@ -34,14 +31,8 @@ const (
|
||||
type AIServiceClient interface {
|
||||
// GenerateAnswer генерирует ответ на запрос
|
||||
GenerateAnswer(ctx context.Context, in *AIRequest, opts ...grpc.CallOption) (*AIResponse, error)
|
||||
// GenerateStateless генерирует ответ из массива messages (system+history+user)
|
||||
GenerateStateless(ctx context.Context, in *StatelessRequest, opts ...grpc.CallOption) (*AIResponse, error)
|
||||
// HealthCheck проверяет здоровье сервиса
|
||||
HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
|
||||
// CreateSession созда новую AI сессию
|
||||
CreateSession(ctx context.Context, in *CreateSessionRequest, opts ...grpc.CallOption) (*CreateSessionResponse, error)
|
||||
// AskInSession отправляет запрос в рамках существующей сессии
|
||||
AskInSession(ctx context.Context, in *AskInSessionRequest, opts ...grpc.CallOption) (*SessionStatusResponse, error)
|
||||
}
|
||||
|
||||
type aIServiceClient struct {
|
||||
@ -62,16 +53,6 @@ func (c *aIServiceClient) GenerateAnswer(ctx context.Context, in *AIRequest, opt
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aIServiceClient) GenerateStateless(ctx context.Context, in *StatelessRequest, opts ...grpc.CallOption) (*AIResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AIResponse)
|
||||
err := c.cc.Invoke(ctx, AIService_GenerateStateless_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aIServiceClient) HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(HealthCheckResponse)
|
||||
@ -82,26 +63,6 @@ func (c *aIServiceClient) HealthCheck(ctx context.Context, in *HealthCheckReques
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aIServiceClient) CreateSession(ctx context.Context, in *CreateSessionRequest, opts ...grpc.CallOption) (*CreateSessionResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateSessionResponse)
|
||||
err := c.cc.Invoke(ctx, AIService_CreateSession_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *aIServiceClient) AskInSession(ctx context.Context, in *AskInSessionRequest, opts ...grpc.CallOption) (*SessionStatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SessionStatusResponse)
|
||||
err := c.cc.Invoke(ctx, AIService_AskInSession_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AIServiceServer is the server API for AIService service.
|
||||
// All implementations must embed UnimplementedAIServiceServer
|
||||
// for forward compatibility.
|
||||
@ -110,14 +71,8 @@ func (c *aIServiceClient) AskInSession(ctx context.Context, in *AskInSessionRequ
|
||||
type AIServiceServer interface {
|
||||
// GenerateAnswer генерирует ответ на запрос
|
||||
GenerateAnswer(context.Context, *AIRequest) (*AIResponse, error)
|
||||
// GenerateStateless генерирует ответ из массива messages (system+history+user)
|
||||
GenerateStateless(context.Context, *StatelessRequest) (*AIResponse, error)
|
||||
// HealthCheck проверяет здоровье сервиса
|
||||
HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
|
||||
// CreateSession созда новую AI сессию
|
||||
CreateSession(context.Context, *CreateSessionRequest) (*CreateSessionResponse, error)
|
||||
// AskInSession отправляет запрос в рамках существующей сессии
|
||||
AskInSession(context.Context, *AskInSessionRequest) (*SessionStatusResponse, error)
|
||||
mustEmbedUnimplementedAIServiceServer()
|
||||
}
|
||||
|
||||
@ -131,18 +86,9 @@ type UnimplementedAIServiceServer struct{}
|
||||
func (UnimplementedAIServiceServer) GenerateAnswer(context.Context, *AIRequest) (*AIResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GenerateAnswer not implemented")
|
||||
}
|
||||
func (UnimplementedAIServiceServer) GenerateStateless(context.Context, *StatelessRequest) (*AIResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GenerateStateless not implemented")
|
||||
}
|
||||
func (UnimplementedAIServiceServer) HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method HealthCheck not implemented")
|
||||
}
|
||||
func (UnimplementedAIServiceServer) CreateSession(context.Context, *CreateSessionRequest) (*CreateSessionResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateSession not implemented")
|
||||
}
|
||||
func (UnimplementedAIServiceServer) AskInSession(context.Context, *AskInSessionRequest) (*SessionStatusResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AskInSession not implemented")
|
||||
}
|
||||
func (UnimplementedAIServiceServer) mustEmbedUnimplementedAIServiceServer() {}
|
||||
func (UnimplementedAIServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
@ -182,24 +128,6 @@ func _AIService_GenerateAnswer_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AIService_GenerateStateless_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StatelessRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AIServiceServer).GenerateStateless(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AIService_GenerateStateless_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AIServiceServer).GenerateStateless(ctx, req.(*StatelessRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AIService_HealthCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(HealthCheckRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@ -218,42 +146,6 @@ func _AIService_HealthCheck_Handler(srv interface{}, ctx context.Context, dec fu
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AIService_CreateSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateSessionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AIServiceServer).CreateSession(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AIService_CreateSession_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AIServiceServer).CreateSession(ctx, req.(*CreateSessionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AIService_AskInSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AskInSessionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AIServiceServer).AskInSession(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AIService_AskInSession_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AIServiceServer).AskInSession(ctx, req.(*AskInSessionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AIService_ServiceDesc is the grpc.ServiceDesc for AIService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@ -265,22 +157,10 @@ var AIService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "GenerateAnswer",
|
||||
Handler: _AIService_GenerateAnswer_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GenerateStateless",
|
||||
Handler: _AIService_GenerateStateless_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "HealthCheck",
|
||||
Handler: _AIService_HealthCheck_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateSession",
|
||||
Handler: _AIService_CreateSession_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AskInSession",
|
||||
Handler: _AIService_AskInSession_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "ai.proto",
|
||||
|
||||
1003
auth.pb.go
1003
auth.pb.go
File diff suppressed because it is too large
Load Diff
131
auth.proto
131
auth.proto
@ -1,131 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package auth;
|
||||
|
||||
option go_package = "ai_service/proto/l-ai-core-proto;proto";
|
||||
|
||||
// AuthService handles OAuth authentication and JWT token management.
|
||||
// It is the single auth authority for all services in the platform.
|
||||
service AuthService {
|
||||
// Telegram Login Widget — verify widget callback data and return JWT tokens
|
||||
rpc AuthWithTelegram(TelegramAuthRequest) returns (AuthResponse);
|
||||
|
||||
// Telegram new Login (id_token JWT) — verify JWT and return platform tokens
|
||||
rpc AuthWithTelegramToken(TelegramTokenRequest) returns (AuthResponse);
|
||||
|
||||
// Discord OAuth — generate redirect URL (state stored server-side)
|
||||
rpc GetDiscordOAuthURL(GetDiscordOAuthURLRequest) returns (OAuthURLResponse);
|
||||
|
||||
// Discord OAuth — exchange authorization code for JWT tokens
|
||||
rpc ExchangeDiscordCode(DiscordExchangeRequest) returns (AuthResponse);
|
||||
|
||||
// Steam OpenID 2.0 — generate redirect URL (state stored server-side)
|
||||
rpc GetSteamAuthURL(GetSteamAuthURLRequest) returns (OAuthURLResponse);
|
||||
|
||||
// Steam OpenID 2.0 — verify OpenID assertion and return JWT tokens
|
||||
rpc ExchangeSteamLogin(SteamExchangeRequest) returns (AuthResponse);
|
||||
|
||||
// VK OAuth — generate redirect URL (state stored server-side)
|
||||
rpc GetVKOAuthURL(GetVKOAuthURLRequest) returns (OAuthURLResponse);
|
||||
|
||||
// VK OAuth — exchange authorization code for JWT tokens
|
||||
rpc ExchangeVKCode(VKExchangeRequest) returns (AuthResponse);
|
||||
|
||||
// Issue new token pair from a valid refresh token
|
||||
rpc RefreshToken(RefreshTokenRequest) returns (AuthResponse);
|
||||
|
||||
// Revoke a token (add to blacklist)
|
||||
rpc RevokeToken(RevokeTokenRequest) returns (RevokeTokenResponse);
|
||||
|
||||
// Validate a token and return its claims (optional — services can validate locally)
|
||||
rpc ValidateToken(ValidateTokenRequest) returns (ValidateTokenResponse);
|
||||
}
|
||||
|
||||
// TelegramTokenRequest contains the id_token JWT from the new Telegram Login
|
||||
message TelegramTokenRequest {
|
||||
string id_token = 1;
|
||||
}
|
||||
|
||||
// TelegramAuthRequest contains the data sent by the Telegram Login Widget
|
||||
message TelegramAuthRequest {
|
||||
int64 id = 1;
|
||||
string first_name = 2;
|
||||
string last_name = 3;
|
||||
string username = 4;
|
||||
string photo_url = 5;
|
||||
int64 auth_date = 6;
|
||||
string hash = 7;
|
||||
}
|
||||
|
||||
// GetDiscordOAuthURLRequest — caller provides the redirect_uri for their service
|
||||
message GetDiscordOAuthURLRequest {
|
||||
string redirect_uri = 1;
|
||||
}
|
||||
|
||||
// OAuthURLResponse returns the full OAuth redirect URL including state
|
||||
message OAuthURLResponse {
|
||||
string url = 1;
|
||||
string state = 2;
|
||||
}
|
||||
|
||||
// DiscordExchangeRequest — exchange code received in Discord callback
|
||||
message DiscordExchangeRequest {
|
||||
string code = 1;
|
||||
string state = 2;
|
||||
string redirect_uri = 3;
|
||||
}
|
||||
|
||||
// GetSteamAuthURLRequest — caller provides the redirect_uri for their service
|
||||
message GetSteamAuthURLRequest {
|
||||
string redirect_uri = 1;
|
||||
}
|
||||
|
||||
// SteamExchangeRequest — all OpenID 2.0 params received in the Steam callback
|
||||
message SteamExchangeRequest {
|
||||
string state = 1;
|
||||
map<string, string> openid_params = 2;
|
||||
}
|
||||
|
||||
// GetVKOAuthURLRequest — caller provides the redirect_uri for their service
|
||||
message GetVKOAuthURLRequest {
|
||||
string redirect_uri = 1;
|
||||
}
|
||||
|
||||
// VKExchangeRequest — exchange code received in VK callback
|
||||
message VKExchangeRequest {
|
||||
string code = 1;
|
||||
string state = 2;
|
||||
string redirect_uri = 3;
|
||||
}
|
||||
|
||||
// AuthResponse is returned after successful authentication
|
||||
message AuthResponse {
|
||||
string access_token = 1;
|
||||
string refresh_token = 2;
|
||||
int64 global_user_id = 3;
|
||||
string display_name = 4;
|
||||
int64 expires_at = 5; // unix timestamp of access token expiry
|
||||
}
|
||||
|
||||
message RefreshTokenRequest {
|
||||
string refresh_token = 1;
|
||||
}
|
||||
|
||||
message RevokeTokenRequest {
|
||||
string token = 1;
|
||||
}
|
||||
|
||||
message RevokeTokenResponse {
|
||||
bool success = 1;
|
||||
}
|
||||
|
||||
message ValidateTokenRequest {
|
||||
string token = 1;
|
||||
}
|
||||
|
||||
message ValidateTokenResponse {
|
||||
bool valid = 1;
|
||||
int64 global_user_id = 2;
|
||||
string display_name = 3;
|
||||
repeated string linked_platforms = 4;
|
||||
}
|
||||
529
auth_grpc.pb.go
529
auth_grpc.pb.go
@ -1,529 +0,0 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v7.34.0
|
||||
// source: auth.proto
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
AuthService_AuthWithTelegram_FullMethodName = "/auth.AuthService/AuthWithTelegram"
|
||||
AuthService_AuthWithTelegramToken_FullMethodName = "/auth.AuthService/AuthWithTelegramToken"
|
||||
AuthService_GetDiscordOAuthURL_FullMethodName = "/auth.AuthService/GetDiscordOAuthURL"
|
||||
AuthService_ExchangeDiscordCode_FullMethodName = "/auth.AuthService/ExchangeDiscordCode"
|
||||
AuthService_GetSteamAuthURL_FullMethodName = "/auth.AuthService/GetSteamAuthURL"
|
||||
AuthService_ExchangeSteamLogin_FullMethodName = "/auth.AuthService/ExchangeSteamLogin"
|
||||
AuthService_GetVKOAuthURL_FullMethodName = "/auth.AuthService/GetVKOAuthURL"
|
||||
AuthService_ExchangeVKCode_FullMethodName = "/auth.AuthService/ExchangeVKCode"
|
||||
AuthService_RefreshToken_FullMethodName = "/auth.AuthService/RefreshToken"
|
||||
AuthService_RevokeToken_FullMethodName = "/auth.AuthService/RevokeToken"
|
||||
AuthService_ValidateToken_FullMethodName = "/auth.AuthService/ValidateToken"
|
||||
)
|
||||
|
||||
// AuthServiceClient is the client API for AuthService 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.
|
||||
//
|
||||
// AuthService handles OAuth authentication and JWT token management.
|
||||
// It is the single auth authority for all services in the platform.
|
||||
type AuthServiceClient interface {
|
||||
// Telegram Login Widget — verify widget callback data and return JWT tokens
|
||||
AuthWithTelegram(ctx context.Context, in *TelegramAuthRequest, opts ...grpc.CallOption) (*AuthResponse, error)
|
||||
// Telegram new Login (id_token JWT) — verify JWT and return platform tokens
|
||||
AuthWithTelegramToken(ctx context.Context, in *TelegramTokenRequest, opts ...grpc.CallOption) (*AuthResponse, error)
|
||||
// Discord OAuth — generate redirect URL (state stored server-side)
|
||||
GetDiscordOAuthURL(ctx context.Context, in *GetDiscordOAuthURLRequest, opts ...grpc.CallOption) (*OAuthURLResponse, error)
|
||||
// Discord OAuth — exchange authorization code for JWT tokens
|
||||
ExchangeDiscordCode(ctx context.Context, in *DiscordExchangeRequest, opts ...grpc.CallOption) (*AuthResponse, error)
|
||||
// Steam OpenID 2.0 — generate redirect URL (state stored server-side)
|
||||
GetSteamAuthURL(ctx context.Context, in *GetSteamAuthURLRequest, opts ...grpc.CallOption) (*OAuthURLResponse, error)
|
||||
// Steam OpenID 2.0 — verify OpenID assertion and return JWT tokens
|
||||
ExchangeSteamLogin(ctx context.Context, in *SteamExchangeRequest, opts ...grpc.CallOption) (*AuthResponse, error)
|
||||
// VK OAuth — generate redirect URL (state stored server-side)
|
||||
GetVKOAuthURL(ctx context.Context, in *GetVKOAuthURLRequest, opts ...grpc.CallOption) (*OAuthURLResponse, error)
|
||||
// VK OAuth — exchange authorization code for JWT tokens
|
||||
ExchangeVKCode(ctx context.Context, in *VKExchangeRequest, opts ...grpc.CallOption) (*AuthResponse, error)
|
||||
// Issue new token pair from a valid refresh token
|
||||
RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*AuthResponse, error)
|
||||
// Revoke a token (add to blacklist)
|
||||
RevokeToken(ctx context.Context, in *RevokeTokenRequest, opts ...grpc.CallOption) (*RevokeTokenResponse, error)
|
||||
// Validate a token and return its claims (optional — services can validate locally)
|
||||
ValidateToken(ctx context.Context, in *ValidateTokenRequest, opts ...grpc.CallOption) (*ValidateTokenResponse, error)
|
||||
}
|
||||
|
||||
type authServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
|
||||
return &authServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *authServiceClient) AuthWithTelegram(ctx context.Context, in *TelegramAuthRequest, opts ...grpc.CallOption) (*AuthResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AuthResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_AuthWithTelegram_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) AuthWithTelegramToken(ctx context.Context, in *TelegramTokenRequest, opts ...grpc.CallOption) (*AuthResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AuthResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_AuthWithTelegramToken_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) GetDiscordOAuthURL(ctx context.Context, in *GetDiscordOAuthURLRequest, opts ...grpc.CallOption) (*OAuthURLResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(OAuthURLResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_GetDiscordOAuthURL_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) ExchangeDiscordCode(ctx context.Context, in *DiscordExchangeRequest, opts ...grpc.CallOption) (*AuthResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AuthResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_ExchangeDiscordCode_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) GetSteamAuthURL(ctx context.Context, in *GetSteamAuthURLRequest, opts ...grpc.CallOption) (*OAuthURLResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(OAuthURLResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_GetSteamAuthURL_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) ExchangeSteamLogin(ctx context.Context, in *SteamExchangeRequest, opts ...grpc.CallOption) (*AuthResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AuthResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_ExchangeSteamLogin_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) GetVKOAuthURL(ctx context.Context, in *GetVKOAuthURLRequest, opts ...grpc.CallOption) (*OAuthURLResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(OAuthURLResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_GetVKOAuthURL_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) ExchangeVKCode(ctx context.Context, in *VKExchangeRequest, opts ...grpc.CallOption) (*AuthResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AuthResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_ExchangeVKCode_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*AuthResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AuthResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_RefreshToken_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) RevokeToken(ctx context.Context, in *RevokeTokenRequest, opts ...grpc.CallOption) (*RevokeTokenResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RevokeTokenResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_RevokeToken_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) ValidateToken(ctx context.Context, in *ValidateTokenRequest, opts ...grpc.CallOption) (*ValidateTokenResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ValidateTokenResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_ValidateToken_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AuthServiceServer is the server API for AuthService service.
|
||||
// All implementations must embed UnimplementedAuthServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// AuthService handles OAuth authentication and JWT token management.
|
||||
// It is the single auth authority for all services in the platform.
|
||||
type AuthServiceServer interface {
|
||||
// Telegram Login Widget — verify widget callback data and return JWT tokens
|
||||
AuthWithTelegram(context.Context, *TelegramAuthRequest) (*AuthResponse, error)
|
||||
// Telegram new Login (id_token JWT) — verify JWT and return platform tokens
|
||||
AuthWithTelegramToken(context.Context, *TelegramTokenRequest) (*AuthResponse, error)
|
||||
// Discord OAuth — generate redirect URL (state stored server-side)
|
||||
GetDiscordOAuthURL(context.Context, *GetDiscordOAuthURLRequest) (*OAuthURLResponse, error)
|
||||
// Discord OAuth — exchange authorization code for JWT tokens
|
||||
ExchangeDiscordCode(context.Context, *DiscordExchangeRequest) (*AuthResponse, error)
|
||||
// Steam OpenID 2.0 — generate redirect URL (state stored server-side)
|
||||
GetSteamAuthURL(context.Context, *GetSteamAuthURLRequest) (*OAuthURLResponse, error)
|
||||
// Steam OpenID 2.0 — verify OpenID assertion and return JWT tokens
|
||||
ExchangeSteamLogin(context.Context, *SteamExchangeRequest) (*AuthResponse, error)
|
||||
// VK OAuth — generate redirect URL (state stored server-side)
|
||||
GetVKOAuthURL(context.Context, *GetVKOAuthURLRequest) (*OAuthURLResponse, error)
|
||||
// VK OAuth — exchange authorization code for JWT tokens
|
||||
ExchangeVKCode(context.Context, *VKExchangeRequest) (*AuthResponse, error)
|
||||
// Issue new token pair from a valid refresh token
|
||||
RefreshToken(context.Context, *RefreshTokenRequest) (*AuthResponse, error)
|
||||
// Revoke a token (add to blacklist)
|
||||
RevokeToken(context.Context, *RevokeTokenRequest) (*RevokeTokenResponse, error)
|
||||
// Validate a token and return its claims (optional — services can validate locally)
|
||||
ValidateToken(context.Context, *ValidateTokenRequest) (*ValidateTokenResponse, error)
|
||||
mustEmbedUnimplementedAuthServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedAuthServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedAuthServiceServer struct{}
|
||||
|
||||
func (UnimplementedAuthServiceServer) AuthWithTelegram(context.Context, *TelegramAuthRequest) (*AuthResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AuthWithTelegram not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) AuthWithTelegramToken(context.Context, *TelegramTokenRequest) (*AuthResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AuthWithTelegramToken not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) GetDiscordOAuthURL(context.Context, *GetDiscordOAuthURLRequest) (*OAuthURLResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetDiscordOAuthURL not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) ExchangeDiscordCode(context.Context, *DiscordExchangeRequest) (*AuthResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ExchangeDiscordCode not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) GetSteamAuthURL(context.Context, *GetSteamAuthURLRequest) (*OAuthURLResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetSteamAuthURL not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) ExchangeSteamLogin(context.Context, *SteamExchangeRequest) (*AuthResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ExchangeSteamLogin not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) GetVKOAuthURL(context.Context, *GetVKOAuthURLRequest) (*OAuthURLResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetVKOAuthURL not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) ExchangeVKCode(context.Context, *VKExchangeRequest) (*AuthResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ExchangeVKCode not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) RefreshToken(context.Context, *RefreshTokenRequest) (*AuthResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RefreshToken not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) RevokeToken(context.Context, *RevokeTokenRequest) (*RevokeTokenResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RevokeToken not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) ValidateToken(context.Context, *ValidateTokenRequest) (*ValidateTokenResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ValidateToken not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
|
||||
func (UnimplementedAuthServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AuthServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeAuthServiceServer interface {
|
||||
mustEmbedUnimplementedAuthServiceServer()
|
||||
}
|
||||
|
||||
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedAuthServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&AuthService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _AuthService_AuthWithTelegram_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TelegramAuthRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).AuthWithTelegram(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_AuthWithTelegram_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).AuthWithTelegram(ctx, req.(*TelegramAuthRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_AuthWithTelegramToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TelegramTokenRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).AuthWithTelegramToken(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_AuthWithTelegramToken_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).AuthWithTelegramToken(ctx, req.(*TelegramTokenRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_GetDiscordOAuthURL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetDiscordOAuthURLRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).GetDiscordOAuthURL(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_GetDiscordOAuthURL_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).GetDiscordOAuthURL(ctx, req.(*GetDiscordOAuthURLRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_ExchangeDiscordCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DiscordExchangeRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).ExchangeDiscordCode(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_ExchangeDiscordCode_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).ExchangeDiscordCode(ctx, req.(*DiscordExchangeRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_GetSteamAuthURL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetSteamAuthURLRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).GetSteamAuthURL(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_GetSteamAuthURL_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).GetSteamAuthURL(ctx, req.(*GetSteamAuthURLRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_ExchangeSteamLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SteamExchangeRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).ExchangeSteamLogin(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_ExchangeSteamLogin_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).ExchangeSteamLogin(ctx, req.(*SteamExchangeRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_GetVKOAuthURL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetVKOAuthURLRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).GetVKOAuthURL(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_GetVKOAuthURL_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).GetVKOAuthURL(ctx, req.(*GetVKOAuthURLRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_ExchangeVKCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(VKExchangeRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).ExchangeVKCode(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_ExchangeVKCode_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).ExchangeVKCode(ctx, req.(*VKExchangeRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RefreshTokenRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).RefreshToken(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_RefreshToken_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).RefreshToken(ctx, req.(*RefreshTokenRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_RevokeToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RevokeTokenRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).RevokeToken(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_RevokeToken_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).RevokeToken(ctx, req.(*RevokeTokenRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_ValidateToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ValidateTokenRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).ValidateToken(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_ValidateToken_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).ValidateToken(ctx, req.(*ValidateTokenRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var AuthService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "auth.AuthService",
|
||||
HandlerType: (*AuthServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "AuthWithTelegram",
|
||||
Handler: _AuthService_AuthWithTelegram_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AuthWithTelegramToken",
|
||||
Handler: _AuthService_AuthWithTelegramToken_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetDiscordOAuthURL",
|
||||
Handler: _AuthService_GetDiscordOAuthURL_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ExchangeDiscordCode",
|
||||
Handler: _AuthService_ExchangeDiscordCode_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetSteamAuthURL",
|
||||
Handler: _AuthService_GetSteamAuthURL_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ExchangeSteamLogin",
|
||||
Handler: _AuthService_ExchangeSteamLogin_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetVKOAuthURL",
|
||||
Handler: _AuthService_GetVKOAuthURL_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ExchangeVKCode",
|
||||
Handler: _AuthService_ExchangeVKCode_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RefreshToken",
|
||||
Handler: _AuthService_RefreshToken_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RevokeToken",
|
||||
Handler: _AuthService_RevokeToken_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ValidateToken",
|
||||
Handler: _AuthService_ValidateToken_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "auth.proto",
|
||||
}
|
||||
243
settings.pb.go
243
settings.pb.go
@ -1,243 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v7.34.0
|
||||
// source: settings.proto
|
||||
|
||||
package proto
|
||||
|
||||
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"
|
||||
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 GetPreferredModelRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetPreferredModelRequest) Reset() {
|
||||
*x = GetPreferredModelRequest{}
|
||||
mi := &file_settings_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetPreferredModelRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetPreferredModelRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetPreferredModelRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_settings_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 GetPreferredModelRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetPreferredModelRequest) Descriptor() ([]byte, []int) {
|
||||
return file_settings_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *GetPreferredModelRequest) GetUserId() int64 {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type GetPreferredModelResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetPreferredModelResponse) Reset() {
|
||||
*x = GetPreferredModelResponse{}
|
||||
mi := &file_settings_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetPreferredModelResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetPreferredModelResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetPreferredModelResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_settings_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 GetPreferredModelResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetPreferredModelResponse) Descriptor() ([]byte, []int) {
|
||||
return file_settings_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetPreferredModelResponse) GetModel() string {
|
||||
if x != nil {
|
||||
return x.Model
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type SetPreferredModelRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
|
||||
Model string `protobuf:"bytes,3,opt,name=model,proto3" json:"model,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SetPreferredModelRequest) Reset() {
|
||||
*x = SetPreferredModelRequest{}
|
||||
mi := &file_settings_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SetPreferredModelRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SetPreferredModelRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SetPreferredModelRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_settings_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SetPreferredModelRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SetPreferredModelRequest) Descriptor() ([]byte, []int) {
|
||||
return file_settings_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *SetPreferredModelRequest) GetUserId() int64 {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SetPreferredModelRequest) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SetPreferredModelRequest) GetModel() string {
|
||||
if x != nil {
|
||||
return x.Model
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_settings_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_settings_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x0esettings.proto\x12\x05users\x1a\x1bgoogle/protobuf/empty.proto\"3\n" +
|
||||
"\x18GetPreferredModelRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\x03R\x06userId\"1\n" +
|
||||
"\x19GetPreferredModelResponse\x12\x14\n" +
|
||||
"\x05model\x18\x01 \x01(\tR\x05model\"e\n" +
|
||||
"\x18SetPreferredModelRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\x03R\x06userId\x12\x1a\n" +
|
||||
"\busername\x18\x02 \x01(\tR\busername\x12\x14\n" +
|
||||
"\x05model\x18\x03 \x01(\tR\x05model2\xbb\x01\n" +
|
||||
"\x13UserSettingsService\x12V\n" +
|
||||
"\x11GetPreferredModel\x12\x1f.users.GetPreferredModelRequest\x1a .users.GetPreferredModelResponse\x12L\n" +
|
||||
"\x11SetPreferredModel\x12\x1f.users.SetPreferredModelRequest\x1a\x16.google.protobuf.EmptyB,Z*git.be.kaien.ru/l-ai/l-ai-core-proto/protob\x06proto3"
|
||||
|
||||
var (
|
||||
file_settings_proto_rawDescOnce sync.Once
|
||||
file_settings_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_settings_proto_rawDescGZIP() []byte {
|
||||
file_settings_proto_rawDescOnce.Do(func() {
|
||||
file_settings_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_settings_proto_rawDesc), len(file_settings_proto_rawDesc)))
|
||||
})
|
||||
return file_settings_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_settings_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_settings_proto_goTypes = []any{
|
||||
(*GetPreferredModelRequest)(nil), // 0: users.GetPreferredModelRequest
|
||||
(*GetPreferredModelResponse)(nil), // 1: users.GetPreferredModelResponse
|
||||
(*SetPreferredModelRequest)(nil), // 2: users.SetPreferredModelRequest
|
||||
(*emptypb.Empty)(nil), // 3: google.protobuf.Empty
|
||||
}
|
||||
var file_settings_proto_depIdxs = []int32{
|
||||
0, // 0: users.UserSettingsService.GetPreferredModel:input_type -> users.GetPreferredModelRequest
|
||||
2, // 1: users.UserSettingsService.SetPreferredModel:input_type -> users.SetPreferredModelRequest
|
||||
1, // 2: users.UserSettingsService.GetPreferredModel:output_type -> users.GetPreferredModelResponse
|
||||
3, // 3: users.UserSettingsService.SetPreferredModel:output_type -> google.protobuf.Empty
|
||||
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_settings_proto_init() }
|
||||
func file_settings_proto_init() {
|
||||
if File_settings_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_settings_proto_rawDesc), len(file_settings_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_settings_proto_goTypes,
|
||||
DependencyIndexes: file_settings_proto_depIdxs,
|
||||
MessageInfos: file_settings_proto_msgTypes,
|
||||
}.Build()
|
||||
File_settings_proto = out.File
|
||||
file_settings_proto_goTypes = nil
|
||||
file_settings_proto_depIdxs = nil
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package users;
|
||||
|
||||
option go_package = "git.be.kaien.ru/l-ai/l-ai-core-proto/proto";
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
// UserSettingsService manages per-user bot settings
|
||||
service UserSettingsService {
|
||||
rpc GetPreferredModel(GetPreferredModelRequest) returns (GetPreferredModelResponse);
|
||||
rpc SetPreferredModel(SetPreferredModelRequest) returns (google.protobuf.Empty);
|
||||
}
|
||||
|
||||
message GetPreferredModelRequest {
|
||||
int64 user_id = 1;
|
||||
}
|
||||
|
||||
message GetPreferredModelResponse {
|
||||
string model = 1;
|
||||
}
|
||||
|
||||
message SetPreferredModelRequest {
|
||||
int64 user_id = 1;
|
||||
string username = 2;
|
||||
string model = 3;
|
||||
}
|
||||
@ -1,164 +0,0 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v7.34.0
|
||||
// source: settings.proto
|
||||
|
||||
package proto
|
||||
|
||||
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.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
UserSettingsService_GetPreferredModel_FullMethodName = "/users.UserSettingsService/GetPreferredModel"
|
||||
UserSettingsService_SetPreferredModel_FullMethodName = "/users.UserSettingsService/SetPreferredModel"
|
||||
)
|
||||
|
||||
// UserSettingsServiceClient is the client API for UserSettingsService 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.
|
||||
//
|
||||
// UserSettingsService manages per-user bot settings
|
||||
type UserSettingsServiceClient interface {
|
||||
GetPreferredModel(ctx context.Context, in *GetPreferredModelRequest, opts ...grpc.CallOption) (*GetPreferredModelResponse, error)
|
||||
SetPreferredModel(ctx context.Context, in *SetPreferredModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type userSettingsServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewUserSettingsServiceClient(cc grpc.ClientConnInterface) UserSettingsServiceClient {
|
||||
return &userSettingsServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *userSettingsServiceClient) GetPreferredModel(ctx context.Context, in *GetPreferredModelRequest, opts ...grpc.CallOption) (*GetPreferredModelResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetPreferredModelResponse)
|
||||
err := c.cc.Invoke(ctx, UserSettingsService_GetPreferredModel_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *userSettingsServiceClient) SetPreferredModel(ctx context.Context, in *SetPreferredModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, UserSettingsService_SetPreferredModel_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// UserSettingsServiceServer is the server API for UserSettingsService service.
|
||||
// All implementations must embed UnimplementedUserSettingsServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// UserSettingsService manages per-user bot settings
|
||||
type UserSettingsServiceServer interface {
|
||||
GetPreferredModel(context.Context, *GetPreferredModelRequest) (*GetPreferredModelResponse, error)
|
||||
SetPreferredModel(context.Context, *SetPreferredModelRequest) (*emptypb.Empty, error)
|
||||
mustEmbedUnimplementedUserSettingsServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedUserSettingsServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedUserSettingsServiceServer struct{}
|
||||
|
||||
func (UnimplementedUserSettingsServiceServer) GetPreferredModel(context.Context, *GetPreferredModelRequest) (*GetPreferredModelResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetPreferredModel not implemented")
|
||||
}
|
||||
func (UnimplementedUserSettingsServiceServer) SetPreferredModel(context.Context, *SetPreferredModelRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetPreferredModel not implemented")
|
||||
}
|
||||
func (UnimplementedUserSettingsServiceServer) mustEmbedUnimplementedUserSettingsServiceServer() {}
|
||||
func (UnimplementedUserSettingsServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeUserSettingsServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to UserSettingsServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeUserSettingsServiceServer interface {
|
||||
mustEmbedUnimplementedUserSettingsServiceServer()
|
||||
}
|
||||
|
||||
func RegisterUserSettingsServiceServer(s grpc.ServiceRegistrar, srv UserSettingsServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedUserSettingsServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&UserSettingsService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _UserSettingsService_GetPreferredModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPreferredModelRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserSettingsServiceServer).GetPreferredModel(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UserSettingsService_GetPreferredModel_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserSettingsServiceServer).GetPreferredModel(ctx, req.(*GetPreferredModelRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _UserSettingsService_SetPreferredModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetPreferredModelRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UserSettingsServiceServer).SetPreferredModel(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UserSettingsService_SetPreferredModel_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UserSettingsServiceServer).SetPreferredModel(ctx, req.(*SetPreferredModelRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// UserSettingsService_ServiceDesc is the grpc.ServiceDesc for UserSettingsService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var UserSettingsService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "users.UserSettingsService",
|
||||
HandlerType: (*UserSettingsServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetPreferredModel",
|
||||
Handler: _UserSettingsService_GetPreferredModel_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetPreferredModel",
|
||||
Handler: _UserSettingsService_SetPreferredModel_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "settings.proto",
|
||||
}
|
||||
111
users.pb.go
111
users.pb.go
@ -615,58 +615,6 @@ func (x *GetLinkedAccountsByPlatformRequest) GetPlatform() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetLinkedAccountsByUserAndPlatformRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
GlobalUserId int64 `protobuf:"varint,1,opt,name=global_user_id,json=globalUserId,proto3" json:"global_user_id,omitempty"`
|
||||
Platform string `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetLinkedAccountsByUserAndPlatformRequest) Reset() {
|
||||
*x = GetLinkedAccountsByUserAndPlatformRequest{}
|
||||
mi := &file_users_proto_msgTypes[10]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetLinkedAccountsByUserAndPlatformRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetLinkedAccountsByUserAndPlatformRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetLinkedAccountsByUserAndPlatformRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_users_proto_msgTypes[10]
|
||||
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 GetLinkedAccountsByUserAndPlatformRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetLinkedAccountsByUserAndPlatformRequest) Descriptor() ([]byte, []int) {
|
||||
return file_users_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
func (x *GetLinkedAccountsByUserAndPlatformRequest) GetGlobalUserId() int64 {
|
||||
if x != nil {
|
||||
return x.GlobalUserId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GetLinkedAccountsByUserAndPlatformRequest) GetPlatform() string {
|
||||
if x != nil {
|
||||
return x.Platform
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetLinkedAccountsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Accounts []*LinkedAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"`
|
||||
@ -676,7 +624,7 @@ type GetLinkedAccountsResponse struct {
|
||||
|
||||
func (x *GetLinkedAccountsResponse) Reset() {
|
||||
*x = GetLinkedAccountsResponse{}
|
||||
mi := &file_users_proto_msgTypes[11]
|
||||
mi := &file_users_proto_msgTypes[10]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -688,7 +636,7 @@ func (x *GetLinkedAccountsResponse) String() string {
|
||||
func (*GetLinkedAccountsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetLinkedAccountsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_users_proto_msgTypes[11]
|
||||
mi := &file_users_proto_msgTypes[10]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -701,7 +649,7 @@ func (x *GetLinkedAccountsResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use GetLinkedAccountsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetLinkedAccountsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_users_proto_rawDescGZIP(), []int{11}
|
||||
return file_users_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
func (x *GetLinkedAccountsResponse) GetAccounts() []*LinkedAccount {
|
||||
@ -763,12 +711,9 @@ const file_users_proto_rawDesc = "" +
|
||||
"\x0eglobal_user_id\x18\x01 \x01(\x03R\fglobalUserId\x12\x1a\n" +
|
||||
"\bplatform\x18\x02 \x01(\tR\bplatform\"@\n" +
|
||||
"\"GetLinkedAccountsByPlatformRequest\x12\x1a\n" +
|
||||
"\bplatform\x18\x01 \x01(\tR\bplatform\"m\n" +
|
||||
")GetLinkedAccountsByUserAndPlatformRequest\x12$\n" +
|
||||
"\x0eglobal_user_id\x18\x01 \x01(\x03R\fglobalUserId\x12\x1a\n" +
|
||||
"\bplatform\x18\x02 \x01(\tR\bplatform\"M\n" +
|
||||
"\bplatform\x18\x01 \x01(\tR\bplatform\"M\n" +
|
||||
"\x19GetLinkedAccountsResponse\x120\n" +
|
||||
"\baccounts\x18\x01 \x03(\v2\x14.users.LinkedAccountR\baccounts2\xe9\x05\n" +
|
||||
"\baccounts\x18\x01 \x03(\v2\x14.users.LinkedAccountR\baccounts2\xef\x04\n" +
|
||||
"\fUsersService\x12E\n" +
|
||||
"\x10CreateGlobalUser\x12\x1e.users.CreateGlobalUserRequest\x1a\x11.users.GlobalUser\x12?\n" +
|
||||
"\rGetGlobalUser\x12\x1b.users.GetGlobalUserRequest\x1a\x11.users.GlobalUser\x12M\n" +
|
||||
@ -777,8 +722,7 @@ const file_users_proto_rawDesc = "" +
|
||||
"\vLinkAccount\x12\x19.users.LinkAccountRequest\x1a\x14.users.LinkedAccount\x12D\n" +
|
||||
"\rUnlinkAccount\x12\x1b.users.UnlinkAccountRequest\x1a\x16.google.protobuf.Empty\x12H\n" +
|
||||
"\x10GetLinkedAccount\x12\x1e.users.GetLinkedAccountRequest\x1a\x14.users.LinkedAccount\x12j\n" +
|
||||
"\x1bGetLinkedAccountsByPlatform\x12).users.GetLinkedAccountsByPlatformRequest\x1a .users.GetLinkedAccountsResponse\x12x\n" +
|
||||
"\"GetLinkedAccountsByUserAndPlatform\x120.users.GetLinkedAccountsByUserAndPlatformRequest\x1a .users.GetLinkedAccountsResponseB,Z*git.be.kaien.ru/l-ai/l-ai-core-proto/protob\x06proto3"
|
||||
"\x1bGetLinkedAccountsByPlatform\x12).users.GetLinkedAccountsByPlatformRequest\x1a .users.GetLinkedAccountsResponseB,Z*git.be.kaien.ru/l-ai/l-ai-core-proto/protob\x06proto3"
|
||||
|
||||
var (
|
||||
file_users_proto_rawDescOnce sync.Once
|
||||
@ -792,7 +736,7 @@ func file_users_proto_rawDescGZIP() []byte {
|
||||
return file_users_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_users_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
|
||||
var file_users_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||
var file_users_proto_goTypes = []any{
|
||||
(*GlobalUser)(nil), // 0: users.GlobalUser
|
||||
(*LinkedAccount)(nil), // 1: users.LinkedAccount
|
||||
@ -804,39 +748,36 @@ var file_users_proto_goTypes = []any{
|
||||
(*UnlinkAccountRequest)(nil), // 7: users.UnlinkAccountRequest
|
||||
(*GetLinkedAccountRequest)(nil), // 8: users.GetLinkedAccountRequest
|
||||
(*GetLinkedAccountsByPlatformRequest)(nil), // 9: users.GetLinkedAccountsByPlatformRequest
|
||||
(*GetLinkedAccountsByUserAndPlatformRequest)(nil), // 10: users.GetLinkedAccountsByUserAndPlatformRequest
|
||||
(*GetLinkedAccountsResponse)(nil), // 11: users.GetLinkedAccountsResponse
|
||||
(*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp
|
||||
(*emptypb.Empty)(nil), // 13: google.protobuf.Empty
|
||||
(*GetLinkedAccountsResponse)(nil), // 10: users.GetLinkedAccountsResponse
|
||||
(*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp
|
||||
(*emptypb.Empty)(nil), // 12: google.protobuf.Empty
|
||||
}
|
||||
var file_users_proto_depIdxs = []int32{
|
||||
12, // 0: users.GlobalUser.created_at:type_name -> google.protobuf.Timestamp
|
||||
12, // 1: users.GlobalUser.updated_at:type_name -> google.protobuf.Timestamp
|
||||
11, // 0: users.GlobalUser.created_at:type_name -> google.protobuf.Timestamp
|
||||
11, // 1: users.GlobalUser.updated_at:type_name -> google.protobuf.Timestamp
|
||||
1, // 2: users.GlobalUser.linked_accounts:type_name -> users.LinkedAccount
|
||||
12, // 3: users.LinkedAccount.linked_at:type_name -> google.protobuf.Timestamp
|
||||
12, // 4: users.LinkedAccount.updated_at:type_name -> google.protobuf.Timestamp
|
||||
11, // 3: users.LinkedAccount.linked_at:type_name -> google.protobuf.Timestamp
|
||||
11, // 4: users.LinkedAccount.updated_at:type_name -> google.protobuf.Timestamp
|
||||
0, // 5: users.GetAllGlobalUsersResponse.users:type_name -> users.GlobalUser
|
||||
1, // 6: users.GetLinkedAccountsResponse.accounts:type_name -> users.LinkedAccount
|
||||
2, // 7: users.UsersService.CreateGlobalUser:input_type -> users.CreateGlobalUserRequest
|
||||
3, // 8: users.UsersService.GetGlobalUser:input_type -> users.GetGlobalUserRequest
|
||||
13, // 9: users.UsersService.GetAllGlobalUsers:input_type -> google.protobuf.Empty
|
||||
12, // 9: users.UsersService.GetAllGlobalUsers:input_type -> google.protobuf.Empty
|
||||
5, // 10: users.UsersService.UpdateDisplayName:input_type -> users.UpdateDisplayNameRequest
|
||||
6, // 11: users.UsersService.LinkAccount:input_type -> users.LinkAccountRequest
|
||||
7, // 12: users.UsersService.UnlinkAccount:input_type -> users.UnlinkAccountRequest
|
||||
8, // 13: users.UsersService.GetLinkedAccount:input_type -> users.GetLinkedAccountRequest
|
||||
9, // 14: users.UsersService.GetLinkedAccountsByPlatform:input_type -> users.GetLinkedAccountsByPlatformRequest
|
||||
10, // 15: users.UsersService.GetLinkedAccountsByUserAndPlatform:input_type -> users.GetLinkedAccountsByUserAndPlatformRequest
|
||||
0, // 16: users.UsersService.CreateGlobalUser:output_type -> users.GlobalUser
|
||||
0, // 17: users.UsersService.GetGlobalUser:output_type -> users.GlobalUser
|
||||
4, // 18: users.UsersService.GetAllGlobalUsers:output_type -> users.GetAllGlobalUsersResponse
|
||||
13, // 19: users.UsersService.UpdateDisplayName:output_type -> google.protobuf.Empty
|
||||
1, // 20: users.UsersService.LinkAccount:output_type -> users.LinkedAccount
|
||||
13, // 21: users.UsersService.UnlinkAccount:output_type -> google.protobuf.Empty
|
||||
1, // 22: users.UsersService.GetLinkedAccount:output_type -> users.LinkedAccount
|
||||
11, // 23: users.UsersService.GetLinkedAccountsByPlatform:output_type -> users.GetLinkedAccountsResponse
|
||||
11, // 24: users.UsersService.GetLinkedAccountsByUserAndPlatform:output_type -> users.GetLinkedAccountsResponse
|
||||
16, // [16:25] is the sub-list for method output_type
|
||||
7, // [7:16] is the sub-list for method input_type
|
||||
0, // 15: users.UsersService.CreateGlobalUser:output_type -> users.GlobalUser
|
||||
0, // 16: users.UsersService.GetGlobalUser:output_type -> users.GlobalUser
|
||||
4, // 17: users.UsersService.GetAllGlobalUsers:output_type -> users.GetAllGlobalUsersResponse
|
||||
12, // 18: users.UsersService.UpdateDisplayName:output_type -> google.protobuf.Empty
|
||||
1, // 19: users.UsersService.LinkAccount:output_type -> users.LinkedAccount
|
||||
12, // 20: users.UsersService.UnlinkAccount:output_type -> google.protobuf.Empty
|
||||
1, // 21: users.UsersService.GetLinkedAccount:output_type -> users.LinkedAccount
|
||||
10, // 22: users.UsersService.GetLinkedAccountsByPlatform:output_type -> users.GetLinkedAccountsResponse
|
||||
15, // [15:23] is the sub-list for method output_type
|
||||
7, // [7:15] is the sub-list for method input_type
|
||||
7, // [7:7] is the sub-list for extension type_name
|
||||
7, // [7:7] is the sub-list for extension extendee
|
||||
0, // [0:7] is the sub-list for field type_name
|
||||
@ -853,7 +794,7 @@ func file_users_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_users_proto_rawDesc), len(file_users_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 12,
|
||||
NumMessages: 11,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
||||
@ -18,7 +18,6 @@ service UsersService {
|
||||
rpc UnlinkAccount(UnlinkAccountRequest) returns (google.protobuf.Empty);
|
||||
rpc GetLinkedAccount(GetLinkedAccountRequest) returns (LinkedAccount);
|
||||
rpc GetLinkedAccountsByPlatform(GetLinkedAccountsByPlatformRequest) returns (GetLinkedAccountsResponse);
|
||||
rpc GetLinkedAccountsByUserAndPlatform(GetLinkedAccountsByUserAndPlatformRequest) returns (GetLinkedAccountsResponse);
|
||||
}
|
||||
|
||||
message GlobalUser {
|
||||
@ -80,11 +79,6 @@ message GetLinkedAccountsByPlatformRequest {
|
||||
string platform = 1;
|
||||
}
|
||||
|
||||
message GetLinkedAccountsByUserAndPlatformRequest {
|
||||
int64 global_user_id = 1;
|
||||
string platform = 2;
|
||||
}
|
||||
|
||||
message GetLinkedAccountsResponse {
|
||||
repeated LinkedAccount accounts = 1;
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@ const (
|
||||
UsersService_UnlinkAccount_FullMethodName = "/users.UsersService/UnlinkAccount"
|
||||
UsersService_GetLinkedAccount_FullMethodName = "/users.UsersService/GetLinkedAccount"
|
||||
UsersService_GetLinkedAccountsByPlatform_FullMethodName = "/users.UsersService/GetLinkedAccountsByPlatform"
|
||||
UsersService_GetLinkedAccountsByUserAndPlatform_FullMethodName = "/users.UsersService/GetLinkedAccountsByUserAndPlatform"
|
||||
)
|
||||
|
||||
// UsersServiceClient is the client API for UsersService service.
|
||||
@ -45,7 +44,6 @@ type UsersServiceClient interface {
|
||||
UnlinkAccount(ctx context.Context, in *UnlinkAccountRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
GetLinkedAccount(ctx context.Context, in *GetLinkedAccountRequest, opts ...grpc.CallOption) (*LinkedAccount, error)
|
||||
GetLinkedAccountsByPlatform(ctx context.Context, in *GetLinkedAccountsByPlatformRequest, opts ...grpc.CallOption) (*GetLinkedAccountsResponse, error)
|
||||
GetLinkedAccountsByUserAndPlatform(ctx context.Context, in *GetLinkedAccountsByUserAndPlatformRequest, opts ...grpc.CallOption) (*GetLinkedAccountsResponse, error)
|
||||
}
|
||||
|
||||
type usersServiceClient struct {
|
||||
@ -136,16 +134,6 @@ func (c *usersServiceClient) GetLinkedAccountsByPlatform(ctx context.Context, in
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *usersServiceClient) GetLinkedAccountsByUserAndPlatform(ctx context.Context, in *GetLinkedAccountsByUserAndPlatformRequest, opts ...grpc.CallOption) (*GetLinkedAccountsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetLinkedAccountsResponse)
|
||||
err := c.cc.Invoke(ctx, UsersService_GetLinkedAccountsByUserAndPlatform_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// UsersServiceServer is the server API for UsersService service.
|
||||
// All implementations must embed UnimplementedUsersServiceServer
|
||||
// for forward compatibility.
|
||||
@ -160,7 +148,6 @@ type UsersServiceServer interface {
|
||||
UnlinkAccount(context.Context, *UnlinkAccountRequest) (*emptypb.Empty, error)
|
||||
GetLinkedAccount(context.Context, *GetLinkedAccountRequest) (*LinkedAccount, error)
|
||||
GetLinkedAccountsByPlatform(context.Context, *GetLinkedAccountsByPlatformRequest) (*GetLinkedAccountsResponse, error)
|
||||
GetLinkedAccountsByUserAndPlatform(context.Context, *GetLinkedAccountsByUserAndPlatformRequest) (*GetLinkedAccountsResponse, error)
|
||||
mustEmbedUnimplementedUsersServiceServer()
|
||||
}
|
||||
|
||||
@ -195,9 +182,6 @@ func (UnimplementedUsersServiceServer) GetLinkedAccount(context.Context, *GetLin
|
||||
func (UnimplementedUsersServiceServer) GetLinkedAccountsByPlatform(context.Context, *GetLinkedAccountsByPlatformRequest) (*GetLinkedAccountsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetLinkedAccountsByPlatform not implemented")
|
||||
}
|
||||
func (UnimplementedUsersServiceServer) GetLinkedAccountsByUserAndPlatform(context.Context, *GetLinkedAccountsByUserAndPlatformRequest) (*GetLinkedAccountsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetLinkedAccountsByUserAndPlatform not implemented")
|
||||
}
|
||||
func (UnimplementedUsersServiceServer) mustEmbedUnimplementedUsersServiceServer() {}
|
||||
func (UnimplementedUsersServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
@ -363,24 +347,6 @@ func _UsersService_GetLinkedAccountsByPlatform_Handler(srv interface{}, ctx cont
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _UsersService_GetLinkedAccountsByUserAndPlatform_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetLinkedAccountsByUserAndPlatformRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UsersServiceServer).GetLinkedAccountsByUserAndPlatform(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UsersService_GetLinkedAccountsByUserAndPlatform_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UsersServiceServer).GetLinkedAccountsByUserAndPlatform(ctx, req.(*GetLinkedAccountsByUserAndPlatformRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// UsersService_ServiceDesc is the grpc.ServiceDesc for UsersService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@ -420,10 +386,6 @@ var UsersService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "GetLinkedAccountsByPlatform",
|
||||
Handler: _UsersService_GetLinkedAccountsByPlatform_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetLinkedAccountsByUserAndPlatform",
|
||||
Handler: _UsersService_GetLinkedAccountsByUserAndPlatform_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "users.proto",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user