Commit 84507b1f authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Console node health protocol improvements.

parent 360f855c
Loading
Loading
Loading
Loading
+724 −661

File changed.

Preview size limit exceeded, changes collapsed.

+8 −1
Original line number Diff line number Diff line
@@ -693,6 +693,13 @@ enum UserRole {
  USER_ROLE_READONLY = 4; // Read-only role for those only need to view data
}

enum StatusHealth {
  STATUS_HEALTH_OK = 0;
  STATUS_HEALTH_ERROR = 1;
  STATUS_HEALTH_CONNECTING = 2;
  STATUS_HEALTH_DISCONNECTING = 3;
}

// List of nodes and their stats.
message StatusList {
  // The status of a Nakama node.
@@ -700,7 +707,7 @@ message StatusList {
    // Node name.
    string name = 1;
    // Health score.
    int32 health = 2;
    StatusHealth health = 2;
    // Currently connected sessions.
    int32 session_count = 3;
    // Currently registered live presences.
+15 −2
Original line number Diff line number Diff line
@@ -2253,6 +2253,10 @@
        "environment": {
          "$ref": "#/definitions/ValidatedPurchaseEnvironment",
          "description": "Whether the purchase was done in production or sandbox environment."
        },
        "seenBefore": {
          "type": "boolean",
          "description": "Whether the purchase had already been validated by Nakama before."
        }
      },
      "description": "Validated Purchase stored by Nakama."
@@ -2536,6 +2540,16 @@
      },
      "title": "Runtime information"
    },
    "consoleStatusHealth": {
      "type": "string",
      "enum": [
        "STATUS_HEALTH_OK",
        "STATUS_HEALTH_ERROR",
        "STATUS_HEALTH_CONNECTING",
        "STATUS_HEALTH_DISCONNECTING"
      ],
      "default": "STATUS_HEALTH_OK"
    },
    "consoleStatusList": {
      "type": "object",
      "properties": {
@@ -2562,8 +2576,7 @@
          "description": "Node name."
        },
        "health": {
          "type": "integer",
          "format": "int32",
          "$ref": "#/definitions/consoleStatusHealth",
          "description": "Health score."
        },
        "sessionCount": {
+3 −7
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@ import (

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// ConsoleClient is the client API for Console service.
@@ -802,8 +801,8 @@ type UnsafeConsoleServer interface {
	mustEmbedUnimplementedConsoleServer()
}

func RegisterConsoleServer(s grpc.ServiceRegistrar, srv ConsoleServer) {
	s.RegisterService(&Console_ServiceDesc, srv)
func RegisterConsoleServer(s *grpc.Server, srv ConsoleServer) {
	s.RegisterService(&_Console_serviceDesc, srv)
}

func _Console_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
@@ -1652,10 +1651,7 @@ func _Console_WriteStorageObject_Handler(srv interface{}, ctx context.Context, d
	return interceptor(ctx, in, info, handler)
}

// Console_ServiceDesc is the grpc.ServiceDesc for Console service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Console_ServiceDesc = grpc.ServiceDesc{
var _Console_serviceDesc = grpc.ServiceDesc{
	ServiceName: "nakama.console.Console",
	HandlerType: (*ConsoleServer)(nil),
	Methods: []grpc.MethodDesc{
+9 −1
Original line number Diff line number Diff line
@@ -578,6 +578,7 @@ export interface ApiValidatedPurchase {
  update_time?: string
  provider_response?: string
  environment?: ValidatedPurchaseEnvironment
  seen_before?: boolean
}

export interface Account {
@@ -768,7 +769,7 @@ export interface StatusList {

export interface StatusListStatus {
  name?: string
  health?: number
  health?: StatusHealth
  session_count?: number
  presence_count?: number
  match_count?: number
@@ -867,6 +868,13 @@ export enum ValidatedPurchaseStore {
  HUAWEI_APP_GALLERY = 2,
}

export enum StatusHealth {
  STATUS_HEALTH_OK = 0,
  STATUS_HEALTH_ERROR = 1,
  STATUS_HEALTH_CONNECTING = 2,
  STATUS_HEALTH_DISCONNECTING = 3,
}

export enum UserRole {
  USER_ROLE_UNKNOWN = 0,
  USER_ROLE_ADMIN = 1,
Loading