{
  "repo": "tidbcloud/dataservices",
  "binary": "dataapi",
  "binary_path": "cmd/dataapi/main.go",
  "surface_kind": "mixed_service",
  "type": "mixed_service",
  "extensions": {
    "notes": [
      "This binary exposes only gRPC plus a separate metrics listener; it does not run a public Gin API server.",
      "Business methods in DataAPIService mix direct service/data-store access with control-plane calls into central service helpers."
    ]
  },
  "services": [
    {
      "name": "DataAPILifecycle",
      "package": "cmd/dataapi",
      "methods": [
        {
          "name": "LoadConfigAndDatabase",
          "name_key": "DataAPILifecycle.LoadConfigAndDatabase",
          "input": "config-path and MySQL connection settings",
          "output": "global config initialized and MySQL connection created",
          "type": "local"
        },
        {
          "name": "StartEventbus",
          "name_key": "DataAPILifecycle.StartEventbus",
          "input": "MySQL connection",
          "output": "dataservice_dataapi eventbus running when not in local mode",
          "type": "background_worker"
        },
        {
          "name": "InitApikeyEncrypter",
          "name_key": "DataAPILifecycle.InitApikeyEncrypter",
          "input": "DataApiKey secret key and iv",
          "output": "API key encrypter initialized",
          "type": "local"
        },
        {
          "name": "InitRuntimeDependencies",
          "name_key": "DataAPILifecycle.InitRuntimeDependencies",
          "input": "DBHub SDK config, session cache size, and DynamoDB config",
          "output": "dbhubsdk initialized, in-memory session cache ready, and DynamoDB client connected",
          "type": "local"
        },
        {
          "name": "StartTracing",
          "name_key": "DataAPILifecycle.StartTracing",
          "input": "component name dataservices-dataapi",
          "output": "Jaeger tracer provider initialized",
          "type": "local"
        },
        {
          "name": "StartMetricsServer",
          "name_key": "DataAPILifecycle.StartMetricsServer",
          "input": "metrics port from config",
          "output": "HTTP metrics listener exposing /metrics",
          "type": "background_worker"
        },
        {
          "name": "StartGrpcServer",
          "name_key": "DataAPILifecycle.StartGrpcServer",
          "input": "gRPC port from config",
          "output": "DataAPIService gRPC server running with metrics and error interceptors",
          "type": "local"
        }
      ]
    },
    {
      "name": "DataAPIHTTP",
      "package": "cmd/dataapi",
      "type": "http",
      "methods": [
        {
          "name": "GET /metrics",
          "name_key": "HTTP GET /metrics",
          "path": "/metrics",
          "http_method": "GET",
          "input": "none",
          "output": "Prometheus metrics",
          "type": "http"
        }
      ]
    },
    {
      "name": "DataAPIService",
      "package": "internal/controller/dataapi",
      "type": "grpc",
      "methods": [
        {"name": "GetClusterMeta", "name_key": "DataAPIService.GetClusterMeta", "input": "GetClusterMetaReq", "output": "GetClusterMetaResp", "type": "grpc"},
        {"name": "GetDatabaseMeta", "name_key": "DataAPIService.GetDatabaseMeta", "input": "GetDatabaseMetaReq", "output": "GetDatabaseMetaResp", "type": "grpc"},
        {"name": "ExecSqlWithSession", "name_key": "DataAPIService.ExecSqlWithSession", "input": "BasicEndpointReq", "output": "ExecSqlResp", "type": "grpc"},
        {"name": "ExecSqlDirectly", "name_key": "DataAPIService.ExecSqlDirectly", "input": "BasicEndpointReq", "output": "ExecSqlResp", "type": "grpc"},
        {"name": "CreateSession", "name_key": "DataAPIService.CreateSession", "input": "CreateSessionReq", "output": "CreateSessionResp", "type": "grpc"},
        {"name": "CloseSession", "name_key": "DataAPIService.CloseSession", "input": "CloseSessionReq", "output": "CloseSessionResp", "type": "grpc"},
        {"name": "CreateAPIKey", "name_key": "DataAPIService.CreateAPIKey", "input": "CreateAPIKeyReq", "output": "CreateAPIKeyResp", "type": "grpc"},
        {"name": "DeleteAPIKey", "name_key": "DataAPIService.DeleteAPIKey", "input": "DeleteAPIKeyReq", "output": "DeleteAPIKeyResp", "type": "grpc"},
        {"name": "ListAPIKey", "name_key": "DataAPIService.ListAPIKey", "input": "ListAPIKeyReq", "output": "ListAPIKeyResp", "type": "grpc"},
        {"name": "AuthAPIKey", "name_key": "DataAPIService.AuthAPIKey", "input": "AuthAPIKeyReq", "output": "AuthAPIKeyResp", "type": "grpc"},
        {"name": "CreateDataApp", "name_key": "DataAPIService.CreateDataApp", "input": "CreateDataAppReq", "output": "CreateDataAppResp", "type": "grpc"},
        {"name": "ShowDataApp", "name_key": "DataAPIService.ShowDataApp", "input": "ShowDataAppReq", "output": "ShowDataAppResp", "type": "grpc"},
        {"name": "ListDataApp", "name_key": "DataAPIService.ListDataApp", "input": "ListDataAppReq", "output": "ListDataAppResp", "type": "grpc"},
        {"name": "DeleteDataApp", "name_key": "DataAPIService.DeleteDataApp", "input": "DeleteDataAppReq", "output": "DeleteDataAppResp", "type": "grpc"},
        {"name": "ShowAPIKey", "name_key": "DataAPIService.ShowAPIKey", "input": "ShowAPIKeyReq", "output": "ShowAPIKeyResp", "type": "grpc"},
        {"name": "ParseOneStmt", "name_key": "DataAPIService.ParseOneStmt", "input": "ParseOneStmtReq", "output": "ParseOneStmtResp", "type": "grpc"},
        {"name": "EndpointCodeExample", "name_key": "DataAPIService.EndpointCodeExample", "input": "EndpointCodeExampleReq", "output": "EndpointCodeExampleResp", "type": "grpc"},
        {"name": "GetClusterStatus", "name_key": "DataAPIService.GetClusterStatus", "input": "GetClusterStatusReq", "output": "GetClusterStatusResp", "type": "grpc"}
      ]
    }
  ]
}
