chore: auto-generate protobuf files [skip ci]
This commit is contained in:
@@ -2037,6 +2037,95 @@ func (x *ModifyPermissionAdminResponse) GetMessage() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
type GrafanaAlertRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Payload string `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GrafanaAlertRequest) Reset() {
|
||||
*x = GrafanaAlertRequest{}
|
||||
mi := &file_admin_admin_account_proto_msgTypes[36]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GrafanaAlertRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GrafanaAlertRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GrafanaAlertRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_admin_account_proto_msgTypes[36]
|
||||
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 GrafanaAlertRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GrafanaAlertRequest) Descriptor() ([]byte, []int) {
|
||||
return file_admin_admin_account_proto_rawDescGZIP(), []int{36}
|
||||
}
|
||||
|
||||
func (x *GrafanaAlertRequest) GetPayload() string {
|
||||
if x != nil {
|
||||
return x.Payload
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Успешно ли обработан алерт
|
||||
type GrafanaAlertResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GrafanaAlertResponse) Reset() {
|
||||
*x = GrafanaAlertResponse{}
|
||||
mi := &file_admin_admin_account_proto_msgTypes[37]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GrafanaAlertResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GrafanaAlertResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GrafanaAlertResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_admin_account_proto_msgTypes[37]
|
||||
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 GrafanaAlertResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GrafanaAlertResponse) Descriptor() ([]byte, []int) {
|
||||
return file_admin_admin_account_proto_rawDescGZIP(), []int{37}
|
||||
}
|
||||
|
||||
func (x *GrafanaAlertResponse) GetSuccess() bool {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var File_admin_admin_account_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_admin_admin_account_proto_rawDesc = "" +
|
||||
@@ -2191,7 +2280,11 @@ const file_admin_admin_account_proto_rawDesc = "" +
|
||||
"\brole_ids\x18\x02 \x03(\tR\aroleIds\"S\n" +
|
||||
"\x1dModifyPermissionAdminResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
|
||||
"\amessage\x18\x02 \x01(\tR\amessage2\xd3\v\n" +
|
||||
"\amessage\x18\x02 \x01(\tR\amessage\"/\n" +
|
||||
"\x13GrafanaAlertRequest\x12\x18\n" +
|
||||
"\apayload\x18\x01 \x01(\tR\apayload\"0\n" +
|
||||
"\x14GrafanaAlertResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess2\xa8\f\n" +
|
||||
"\fAdminService\x12G\n" +
|
||||
"\n" +
|
||||
"CreateUser\x12\x1b.admin.v1.CreateUserRequest\x1a\x1c.admin.v1.CreateUserResponse\x12G\n" +
|
||||
@@ -2208,7 +2301,8 @@ const file_admin_admin_account_proto_rawDesc = "" +
|
||||
"RevokeRole\x12\x1b.admin.v1.RevokeRoleRequest\x1a\x1c.admin.v1.RevokeRoleResponse\x12>\n" +
|
||||
"\aBlockIp\x12\x18.admin.v1.BlockIpRequest\x1a\x19.admin.v1.BlockIpResponse\x12D\n" +
|
||||
"\tUnblockIp\x12\x1a.admin.v1.UnblockIpRequest\x1a\x1b.admin.v1.UnblockIpResponse\x12\\\n" +
|
||||
"\x11SyncUsersToSearch\x12\".admin.v1.SyncUsersToSearchRequest\x1a#.admin.v1.SyncUsersToSearchResponse\x12f\n" +
|
||||
"\x11SyncUsersToSearch\x12\".admin.v1.SyncUsersToSearchRequest\x1a#.admin.v1.SyncUsersToSearchResponse\x12S\n" +
|
||||
"\x12HandleGrafanaAlert\x12\x1d.admin.v1.GrafanaAlertRequest\x1a\x1e.admin.v1.GrafanaAlertResponse\x12f\n" +
|
||||
"\x11GetAllPermissions\x12'.admin.v1.GetAllPermissionsAdminRequest\x1a(.admin.v1.GetAllPermissionsAdminResponse\x12T\n" +
|
||||
"\vGetAllRoles\x12!.admin.v1.GetAllRolesAdminRequest\x1a\".admin.v1.GetAllRolesAdminResponse\x12Q\n" +
|
||||
"\n" +
|
||||
@@ -2232,7 +2326,7 @@ func file_admin_admin_account_proto_rawDescGZIP() []byte {
|
||||
return file_admin_admin_account_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_admin_admin_account_proto_msgTypes = make([]protoimpl.MessageInfo, 36)
|
||||
var file_admin_admin_account_proto_msgTypes = make([]protoimpl.MessageInfo, 38)
|
||||
var file_admin_admin_account_proto_goTypes = []any{
|
||||
(*CreateUserRequest)(nil), // 0: admin.v1.CreateUserRequest
|
||||
(*CreateUserResponse)(nil), // 1: admin.v1.CreateUserResponse
|
||||
@@ -2270,6 +2364,8 @@ var file_admin_admin_account_proto_goTypes = []any{
|
||||
(*CreatePermissionAdminRequest)(nil), // 33: admin.v1.CreatePermissionAdminRequest
|
||||
(*UpdatePermissionAdminRequest)(nil), // 34: admin.v1.UpdatePermissionAdminRequest
|
||||
(*ModifyPermissionAdminResponse)(nil), // 35: admin.v1.ModifyPermissionAdminResponse
|
||||
(*GrafanaAlertRequest)(nil), // 36: admin.v1.GrafanaAlertRequest
|
||||
(*GrafanaAlertResponse)(nil), // 37: admin.v1.GrafanaAlertResponse
|
||||
}
|
||||
var file_admin_admin_account_proto_depIdxs = []int32{
|
||||
23, // 0: admin.v1.GetAllPermissionsAdminResponse.permissions:type_name -> admin.v1.PermissionAdmin
|
||||
@@ -2285,33 +2381,35 @@ var file_admin_admin_account_proto_depIdxs = []int32{
|
||||
16, // 10: admin.v1.AdminService.BlockIp:input_type -> admin.v1.BlockIpRequest
|
||||
18, // 11: admin.v1.AdminService.UnblockIp:input_type -> admin.v1.UnblockIpRequest
|
||||
20, // 12: admin.v1.AdminService.SyncUsersToSearch:input_type -> admin.v1.SyncUsersToSearchRequest
|
||||
22, // 13: admin.v1.AdminService.GetAllPermissions:input_type -> admin.v1.GetAllPermissionsAdminRequest
|
||||
25, // 14: admin.v1.AdminService.GetAllRoles:input_type -> admin.v1.GetAllRolesAdminRequest
|
||||
28, // 15: admin.v1.AdminService.CreateRole:input_type -> admin.v1.CreateRoleAdminRequest
|
||||
29, // 16: admin.v1.AdminService.UpdateRole:input_type -> admin.v1.UpdateRoleAdminRequest
|
||||
31, // 17: admin.v1.AdminService.DeleteRole:input_type -> admin.v1.DeleteRoleAdminRequest
|
||||
33, // 18: admin.v1.AdminService.CreatePermission:input_type -> admin.v1.CreatePermissionAdminRequest
|
||||
34, // 19: admin.v1.AdminService.UpdatePermission:input_type -> admin.v1.UpdatePermissionAdminRequest
|
||||
1, // 20: admin.v1.AdminService.CreateUser:output_type -> admin.v1.CreateUserResponse
|
||||
3, // 21: admin.v1.AdminService.DeleteUser:output_type -> admin.v1.DeleteUserResponse
|
||||
5, // 22: admin.v1.AdminService.BlockUser:output_type -> admin.v1.BlockUserResponse
|
||||
7, // 23: admin.v1.AdminService.UnblockUser:output_type -> admin.v1.UnblockUserResponse
|
||||
9, // 24: admin.v1.AdminService.ChangeData:output_type -> admin.v1.ChangeDataResponse
|
||||
11, // 25: admin.v1.AdminService.AdminResetPassword:output_type -> admin.v1.AdminResetPasswordResponse
|
||||
13, // 26: admin.v1.AdminService.AssignRole:output_type -> admin.v1.AssignRoleResponse
|
||||
15, // 27: admin.v1.AdminService.RevokeRole:output_type -> admin.v1.RevokeRoleResponse
|
||||
17, // 28: admin.v1.AdminService.BlockIp:output_type -> admin.v1.BlockIpResponse
|
||||
19, // 29: admin.v1.AdminService.UnblockIp:output_type -> admin.v1.UnblockIpResponse
|
||||
21, // 30: admin.v1.AdminService.SyncUsersToSearch:output_type -> admin.v1.SyncUsersToSearchResponse
|
||||
24, // 31: admin.v1.AdminService.GetAllPermissions:output_type -> admin.v1.GetAllPermissionsAdminResponse
|
||||
27, // 32: admin.v1.AdminService.GetAllRoles:output_type -> admin.v1.GetAllRolesAdminResponse
|
||||
30, // 33: admin.v1.AdminService.CreateRole:output_type -> admin.v1.ModifyRoleAdminResponse
|
||||
30, // 34: admin.v1.AdminService.UpdateRole:output_type -> admin.v1.ModifyRoleAdminResponse
|
||||
32, // 35: admin.v1.AdminService.DeleteRole:output_type -> admin.v1.DeleteRoleAdminResponse
|
||||
35, // 36: admin.v1.AdminService.CreatePermission:output_type -> admin.v1.ModifyPermissionAdminResponse
|
||||
35, // 37: admin.v1.AdminService.UpdatePermission:output_type -> admin.v1.ModifyPermissionAdminResponse
|
||||
20, // [20:38] is the sub-list for method output_type
|
||||
2, // [2:20] is the sub-list for method input_type
|
||||
36, // 13: admin.v1.AdminService.HandleGrafanaAlert:input_type -> admin.v1.GrafanaAlertRequest
|
||||
22, // 14: admin.v1.AdminService.GetAllPermissions:input_type -> admin.v1.GetAllPermissionsAdminRequest
|
||||
25, // 15: admin.v1.AdminService.GetAllRoles:input_type -> admin.v1.GetAllRolesAdminRequest
|
||||
28, // 16: admin.v1.AdminService.CreateRole:input_type -> admin.v1.CreateRoleAdminRequest
|
||||
29, // 17: admin.v1.AdminService.UpdateRole:input_type -> admin.v1.UpdateRoleAdminRequest
|
||||
31, // 18: admin.v1.AdminService.DeleteRole:input_type -> admin.v1.DeleteRoleAdminRequest
|
||||
33, // 19: admin.v1.AdminService.CreatePermission:input_type -> admin.v1.CreatePermissionAdminRequest
|
||||
34, // 20: admin.v1.AdminService.UpdatePermission:input_type -> admin.v1.UpdatePermissionAdminRequest
|
||||
1, // 21: admin.v1.AdminService.CreateUser:output_type -> admin.v1.CreateUserResponse
|
||||
3, // 22: admin.v1.AdminService.DeleteUser:output_type -> admin.v1.DeleteUserResponse
|
||||
5, // 23: admin.v1.AdminService.BlockUser:output_type -> admin.v1.BlockUserResponse
|
||||
7, // 24: admin.v1.AdminService.UnblockUser:output_type -> admin.v1.UnblockUserResponse
|
||||
9, // 25: admin.v1.AdminService.ChangeData:output_type -> admin.v1.ChangeDataResponse
|
||||
11, // 26: admin.v1.AdminService.AdminResetPassword:output_type -> admin.v1.AdminResetPasswordResponse
|
||||
13, // 27: admin.v1.AdminService.AssignRole:output_type -> admin.v1.AssignRoleResponse
|
||||
15, // 28: admin.v1.AdminService.RevokeRole:output_type -> admin.v1.RevokeRoleResponse
|
||||
17, // 29: admin.v1.AdminService.BlockIp:output_type -> admin.v1.BlockIpResponse
|
||||
19, // 30: admin.v1.AdminService.UnblockIp:output_type -> admin.v1.UnblockIpResponse
|
||||
21, // 31: admin.v1.AdminService.SyncUsersToSearch:output_type -> admin.v1.SyncUsersToSearchResponse
|
||||
37, // 32: admin.v1.AdminService.HandleGrafanaAlert:output_type -> admin.v1.GrafanaAlertResponse
|
||||
24, // 33: admin.v1.AdminService.GetAllPermissions:output_type -> admin.v1.GetAllPermissionsAdminResponse
|
||||
27, // 34: admin.v1.AdminService.GetAllRoles:output_type -> admin.v1.GetAllRolesAdminResponse
|
||||
30, // 35: admin.v1.AdminService.CreateRole:output_type -> admin.v1.ModifyRoleAdminResponse
|
||||
30, // 36: admin.v1.AdminService.UpdateRole:output_type -> admin.v1.ModifyRoleAdminResponse
|
||||
32, // 37: admin.v1.AdminService.DeleteRole:output_type -> admin.v1.DeleteRoleAdminResponse
|
||||
35, // 38: admin.v1.AdminService.CreatePermission:output_type -> admin.v1.ModifyPermissionAdminResponse
|
||||
35, // 39: admin.v1.AdminService.UpdatePermission:output_type -> admin.v1.ModifyPermissionAdminResponse
|
||||
21, // [21:40] is the sub-list for method output_type
|
||||
2, // [2:21] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
@@ -2333,7 +2431,7 @@ func file_admin_admin_account_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_admin_admin_account_proto_rawDesc), len(file_admin_admin_account_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 36,
|
||||
NumMessages: 38,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
||||
@@ -30,6 +30,7 @@ const (
|
||||
AdminService_BlockIp_FullMethodName = "/admin.v1.AdminService/BlockIp"
|
||||
AdminService_UnblockIp_FullMethodName = "/admin.v1.AdminService/UnblockIp"
|
||||
AdminService_SyncUsersToSearch_FullMethodName = "/admin.v1.AdminService/SyncUsersToSearch"
|
||||
AdminService_HandleGrafanaAlert_FullMethodName = "/admin.v1.AdminService/HandleGrafanaAlert"
|
||||
AdminService_GetAllPermissions_FullMethodName = "/admin.v1.AdminService/GetAllPermissions"
|
||||
AdminService_GetAllRoles_FullMethodName = "/admin.v1.AdminService/GetAllRoles"
|
||||
AdminService_CreateRole_FullMethodName = "/admin.v1.AdminService/CreateRole"
|
||||
@@ -61,6 +62,7 @@ type AdminServiceClient interface {
|
||||
UnblockIp(ctx context.Context, in *UnblockIpRequest, opts ...grpc.CallOption) (*UnblockIpResponse, error)
|
||||
// Синхронизация с поисковым движком (Elasticsearch)
|
||||
SyncUsersToSearch(ctx context.Context, in *SyncUsersToSearchRequest, opts ...grpc.CallOption) (*SyncUsersToSearchResponse, error)
|
||||
HandleGrafanaAlert(ctx context.Context, in *GrafanaAlertRequest, opts ...grpc.CallOption) (*GrafanaAlertResponse, error)
|
||||
// RBAC
|
||||
GetAllPermissions(ctx context.Context, in *GetAllPermissionsAdminRequest, opts ...grpc.CallOption) (*GetAllPermissionsAdminResponse, error)
|
||||
GetAllRoles(ctx context.Context, in *GetAllRolesAdminRequest, opts ...grpc.CallOption) (*GetAllRolesAdminResponse, error)
|
||||
@@ -189,6 +191,16 @@ func (c *adminServiceClient) SyncUsersToSearch(ctx context.Context, in *SyncUser
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminServiceClient) HandleGrafanaAlert(ctx context.Context, in *GrafanaAlertRequest, opts ...grpc.CallOption) (*GrafanaAlertResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GrafanaAlertResponse)
|
||||
err := c.cc.Invoke(ctx, AdminService_HandleGrafanaAlert_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminServiceClient) GetAllPermissions(ctx context.Context, in *GetAllPermissionsAdminRequest, opts ...grpc.CallOption) (*GetAllPermissionsAdminResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetAllPermissionsAdminResponse)
|
||||
@@ -281,6 +293,7 @@ type AdminServiceServer interface {
|
||||
UnblockIp(context.Context, *UnblockIpRequest) (*UnblockIpResponse, error)
|
||||
// Синхронизация с поисковым движком (Elasticsearch)
|
||||
SyncUsersToSearch(context.Context, *SyncUsersToSearchRequest) (*SyncUsersToSearchResponse, error)
|
||||
HandleGrafanaAlert(context.Context, *GrafanaAlertRequest) (*GrafanaAlertResponse, error)
|
||||
// RBAC
|
||||
GetAllPermissions(context.Context, *GetAllPermissionsAdminRequest) (*GetAllPermissionsAdminResponse, error)
|
||||
GetAllRoles(context.Context, *GetAllRolesAdminRequest) (*GetAllRolesAdminResponse, error)
|
||||
@@ -332,6 +345,9 @@ func (UnimplementedAdminServiceServer) UnblockIp(context.Context, *UnblockIpRequ
|
||||
func (UnimplementedAdminServiceServer) SyncUsersToSearch(context.Context, *SyncUsersToSearchRequest) (*SyncUsersToSearchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SyncUsersToSearch not implemented")
|
||||
}
|
||||
func (UnimplementedAdminServiceServer) HandleGrafanaAlert(context.Context, *GrafanaAlertRequest) (*GrafanaAlertResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method HandleGrafanaAlert not implemented")
|
||||
}
|
||||
func (UnimplementedAdminServiceServer) GetAllPermissions(context.Context, *GetAllPermissionsAdminRequest) (*GetAllPermissionsAdminResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetAllPermissions not implemented")
|
||||
}
|
||||
@@ -572,6 +588,24 @@ func _AdminService_SyncUsersToSearch_Handler(srv interface{}, ctx context.Contex
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminService_HandleGrafanaAlert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GrafanaAlertRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminServiceServer).HandleGrafanaAlert(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminService_HandleGrafanaAlert_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminServiceServer).HandleGrafanaAlert(ctx, req.(*GrafanaAlertRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminService_GetAllPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetAllPermissionsAdminRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -749,6 +783,10 @@ var AdminService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "SyncUsersToSearch",
|
||||
Handler: _AdminService_SyncUsersToSearch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "HandleGrafanaAlert",
|
||||
Handler: _AdminService_HandleGrafanaAlert_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetAllPermissions",
|
||||
Handler: _AdminService_GetAllPermissions_Handler,
|
||||
|
||||
Reference in New Issue
Block a user