> Discover all available pages from the documentation index: https://mastra.zisheng.pro/zh-HK/llms.txt # Mastra.listGateways() 傳回所有已登錄閘道的記錄,並以其登錄鍵作為索引。 ## 使用範例 ```typescript import { Mastra } from '@mastra/core' const mastra = new Mastra({ gateways: { myGateway: new MyCustomGateway(), anotherGateway: new AnotherGateway(), }, }) const gateways = mastra.listGateways() console.log(Object.keys(gateways)) // ['myGateway', 'anotherGateway'] // Iterate over all gateways for (const [key, gateway] of Object.entries(gateways)) { console.log(`${key}: ${gateway.name}`) } ``` ## 參數 無。 ## 傳回值 **gateways** (`Record`): 以登錄鍵作為索引的閘道實例記錄 ## 相關內容 - [Mastra.getGateway()](https://mastra.zisheng.pro/zh-HK/reference/core/getGateway):按登錄鍵取得閘道 - [Mastra.getGatewayById()](https://mastra.zisheng.pro/zh-HK/reference/core/getGatewayById):按 ID 取得閘道 - [Mastra.addGateway()](https://mastra.zisheng.pro/zh-HK/reference/core/addGateway):加入閘道 - [MastraModelGateway](https://mastra.zisheng.pro/zh-HK/reference/core/mastra-model-gateway):閘道基礎類別 - [自訂閘道指南](https://mastra.zisheng.pro/zh-HK/models/gateways/custom-gateways):建立自訂閘道