{
  "repo": "tidbcloud/tidb-operator-cse",
  "binary": "discovery",
  "binary_path": "cmd/discovery/main.go",
  "surface_kind": "mixed_service",
  "type": "mixed_service",
  "extensions": {
    "notes": [
      "The discovery binary exposes two HTTP listeners: the cluster bootstrap API on port 10261 and a PD reverse proxy on port 10262.",
      "The 6060 listener only serves pprof through the default net/http mux.",
      "DiscoverByRegisterType dispatches to PD discovery or DM discovery depending on the register-type path parameter."
    ]
  },
  "services": [
    {
      "name": "DiscoveryLifecycle",
      "package": "main",
      "methods": [
        {
          "name": "StartSecretInformer",
          "name_key": "DiscoveryLifecycle.StartSecretInformer",
          "input": "in-cluster config",
          "output": "shared secret cache",
          "type": "local"
        },
        {
          "name": "ServeDiscoveryAPI",
          "name_key": "DiscoveryLifecycle.ServeDiscoveryAPI",
          "input": "port 10261",
          "output": "HTTP server",
          "type": "local"
        },
        {
          "name": "ServePDProxy",
          "name_key": "DiscoveryLifecycle.ServePDProxy",
          "input": "port 10262",
          "output": "HTTP reverse proxy",
          "type": "local"
        }
      ]
    },
    {
      "name": "DiscoveryService",
      "package": "pkg/discovery/server",
      "methods": [
        {
          "name": "DiscoverPDPeer",
          "name_key": "DiscoveryService.DiscoverPDPeer",
          "input": "HTTP GET",
          "output": "join arguments",
          "path": "/new/{advertise-peer-url}",
          "type": "http"
        },
        {
          "name": "DiscoverByRegisterType",
          "name_key": "DiscoveryService.DiscoverByRegisterType",
          "input": "HTTP GET",
          "output": "join arguments",
          "path": "/new/{advertise-peer-url}/{register-type}",
          "type": "http"
        },
        {
          "name": "VerifyPDEndpoint",
          "name_key": "DiscoveryService.VerifyPDEndpoint",
          "input": "HTTP GET",
          "output": "comma-separated PD endpoints",
          "path": "/verify/{pd-url}",
          "type": "http"
        }
      ]
    },
    {
      "name": "PDProxyService",
      "package": "pkg/discovery/server",
      "methods": [
        {
          "name": "ProxyToPD",
          "name_key": "PDProxyService.ProxyToPD",
          "input": "HTTP ANY",
          "output": "proxied PD response",
          "path": "/{subpath:*}",
          "type": "http_proxy"
        }
      ]
    },
    {
      "name": "DebugService",
      "package": "net/http/pprof",
      "methods": [
        {
          "name": "PprofIndex",
          "name_key": "DebugService.PprofIndex",
          "input": "HTTP GET",
          "output": "pprof index",
          "path": "/debug/pprof/",
          "type": "http"
        },
        {
          "name": "PprofCmdline",
          "name_key": "DebugService.PprofCmdline",
          "input": "HTTP GET",
          "output": "pprof cmdline",
          "path": "/debug/pprof/cmdline",
          "type": "http"
        },
        {
          "name": "PprofProfile",
          "name_key": "DebugService.PprofProfile",
          "input": "HTTP GET",
          "output": "CPU profile",
          "path": "/debug/pprof/profile",
          "type": "http"
        },
        {
          "name": "PprofSymbol",
          "name_key": "DebugService.PprofSymbol",
          "input": "HTTP GET",
          "output": "symbol lookup",
          "path": "/debug/pprof/symbol",
          "type": "http"
        },
        {
          "name": "PprofTrace",
          "name_key": "DebugService.PprofTrace",
          "input": "HTTP GET",
          "output": "execution trace",
          "path": "/debug/pprof/trace",
          "type": "http"
        }
      ]
    }
  ]
}
