{
  "repo": "pingcap/br",
  "binary": "tidb-lightning",
  "binary_path": "cmd/tidb-lightning/main.go",
  "surface_kind": "mixed_service",
  "type": "mixed_service",
  "services": [
    {
      "name": "TiDBLightningLifecycle",
      "package": "cmd/tidb-lightning",
      "methods": [
        {
          "name": "tidb-lightning main",
          "name_key": "CLI tidb-lightning",
          "input": "global config flags and arguments",
          "output": "lightning app initialized and import workflow started"
        },
        {
          "name": "RunServer",
          "name_key": "Runtime TiDBLightningServer.run",
          "input": "server-mode enabled config",
          "output": "long-running Lightning server mode"
        },
        {
          "name": "RunOnce",
          "name_key": "Runtime TiDBLightningOnce.run",
          "input": "normal import config",
          "output": "one-shot import execution"
        }
      ]
    },
    {
      "name": "TiDBLightningStatusServer",
      "package": "pkg/lightning",
      "methods": [
        {
          "name": "status-addr HTTP surface",
          "name_key": "Runtime TiDBLightningStatusServer.serve",
          "input": "status server requests",
          "output": "Lightning status and control endpoints served by GoServe()"
        }
      ]
    }
  ],
  "extensions": {
    "notes": [
      "tidb-lightning always initializes GoServe(); in server mode it becomes a persistent worker with an HTTP status surface."
    ]
  }
}
