ลายเซ็น:
export declare class FunctionBuilder
คอนสตรัคเตอร์
ตัวสร้าง | ตัวดัดแปลง | คำอธิบาย |
---|---|---|
(ตัวสร้าง)(ตัวเลือก) | สร้างอินสแตนซ์ใหม่ของคลาส FunctionBuilder |
คุณสมบัติ
คุณสมบัติ | ตัวดัดแปลง | พิมพ์ | คำอธิบาย |
---|---|---|---|
การวิเคราะห์ | { เหตุการณ์: (analyticsEventType: string) => analytics.AnalyticsEventBuilder ; } | ||
รับรองความถูกต้อง | { ผู้ใช้: (userOptions?: auth.UserOptions ) => auth.UserBuilder ; } | ||
ฐานข้อมูล | { อินสแตนซ์: (อินสแตนซ์: สตริง) => ฐานข้อมูล InstanceBuilder ; อ้างอิง: <อ้างอิงขยายสตริง> (เส้นทาง: อ้างอิง) => ฐานข้อมูล RefBuilder <อ้างอิง>; } | ||
ร้านขายไฟ | { document: <Path ขยายสตริง>(path: Path) => firestore.DocumentBuilder <เส้นทาง>; เนมสเปซ: (เนมสเปซ: สตริง) => firestore.NamespaceBuilder ; ฐานข้อมูล: (ฐานข้อมูล: string) => firestore.DatabaseBuilder ; } | ||
https | { onRequest: (ตัวจัดการ: (req: https.Request, resp: express.Response) => void | Promise<void>) => import("./cloud-functions") HttpsFunction ; onCall: (ตัวจัดการ: (ข้อมูล: ใด ๆ บริบท: https.CallableContext ) => ใดๆ | สัญญา<any>) => import("./cloud-functions") HttpsFunction & import("./cloud-functions"). รันได้ <ใดๆ>; } | ||
ผับซับ | { หัวข้อ: (หัวข้อ: สตริง) => pubsub.TopicBuilder ; กำหนดการ: (กำหนดการ: สตริง) => pubsub.ScheduleBuilder ; } | ||
การกำหนดค่าระยะไกล | { onUpdate: (ตัวจัดการ: (เวอร์ชัน: remoteConfig.TemplateVersion บริบท: EventContext ) => PromiseLike<ใด ๆ> | ใด ๆ) => import("./cloud-functions"). คลาวด์ฟังก์ชัน < remoteConfig.TemplateVersion >; } | ||
พื้นที่จัดเก็บ | { ฝากข้อมูล: (ฝากข้อมูล?: สตริง) => storage.BucketBuilder ; วัตถุ: () => storage.ObjectBuilder ; } | ||
งาน | { งานคิว: (ตัวเลือก?: งาน TaskQueueOptions ) => งาน TaskQueueBuilder ; } | ||
ทดสอบแล็บ | { testMatrix: () => testLab.TestMatrixBuilder ; } |
วิธีการ
วิธี | ตัวดัดแปลง | คำอธิบาย |
---|---|---|
ภูมิภาค(ภูมิภาค) | กำหนดค่าภูมิภาคที่จะปรับใช้ฟังก์ชันนี้ | |
runWith (รันไทม์ตัวเลือก) | กำหนดค่าตัวเลือกรันไทม์สำหรับฟังก์ชัน |
FunctionBuilder.(ตัวสร้าง)
สร้างอินสแตนซ์ใหม่ของคลาส FunctionBuilder
ลายเซ็น:
constructor(options: DeploymentOptions);
พารามิเตอร์
พารามิเตอร์ | พิมพ์ | คำอธิบาย |
---|---|---|
ตัวเลือก | ตัวเลือกการปรับใช้ |
FunctionBuilder.analytics
ลายเซ็น:
get analytics(): {
event: (analyticsEventType: string) => analytics.AnalyticsEventBuilder;
};
FunctionBuilder.auth
ลายเซ็น:
get auth(): {
user: (userOptions?: auth.UserOptions) => auth.UserBuilder;
};
FunctionBuilder.ฐานข้อมูล
ลายเซ็น:
get database(): {
instance: (instance: string) => database.InstanceBuilder;
ref: <Ref extends string>(path: Ref) => database.RefBuilder<Ref>;
};
FunctionBuilder.firestore
ลายเซ็น:
get firestore(): {
document: <Path extends string>(path: Path) => firestore.DocumentBuilder<Path>;
namespace: (namespace: string) => firestore.NamespaceBuilder;
database: (database: string) => firestore.DatabaseBuilder;
};
FunctionBuilder.https
ลายเซ็น:
get https(): {
onRequest: (handler: (req: https.Request, resp: express.Response) => void | Promise<void>) => import("./cloud-functions").HttpsFunction;
onCall: (handler: (data: any, context: https.CallableContext) => any | Promise<any>) => import("./cloud-functions").HttpsFunction & import("./cloud-functions").Runnable<any>;
};
FunctionBuilder.pubsub
ลายเซ็น:
get pubsub(): {
topic: (topic: string) => pubsub.TopicBuilder;
schedule: (schedule: string) => pubsub.ScheduleBuilder;
};
FunctionBuilder.remoteConfig
ลายเซ็น:
get remoteConfig(): {
onUpdate: (handler: (version: remoteConfig.TemplateVersion, context: EventContext) => PromiseLike<any> | any) => import("./cloud-functions").CloudFunction<remoteConfig.TemplateVersion>;
};
FunctionBuilder.storage
ลายเซ็น:
get storage(): {
bucket: (bucket?: string) => storage.BucketBuilder;
object: () => storage.ObjectBuilder;
};
FunctionBuilder.tasks
ลายเซ็น:
get tasks(): {
taskQueue: (options?: tasks.TaskQueueOptions) => tasks.TaskQueueBuilder;
};
FunctionBuilder.testLab
ลายเซ็น:
get testLab(): {
testMatrix: () => testLab.TestMatrixBuilder;
};
FunctionBuilder.region()
กำหนดค่าภูมิภาคที่จะปรับใช้ฟังก์ชันนี้
ลายเซ็น:
region(...regions: Array<(typeof SUPPORTED_REGIONS)[number] | string | Expression<string> | ResetValue>): FunctionBuilder;
พารามิเตอร์
พารามิเตอร์ | พิมพ์ | คำอธิบาย |
---|---|---|
ภูมิภาค | อาร์เรย์<(ประเภทของ SUPPORTED_REGIONS )[จำนวน] | สตริง | การแสดงออก <สตริง> | รีเซ็ตค่า> | สตริงขอบเขตอย่างน้อยหนึ่งรายการ |
ผลตอบแทน:
ตัวอย่างที่ 1
ฟังก์ชั่นภูมิภาค ('us-east1')
ตัวอย่างที่ 2
ฟังก์ชั่นภูมิภาค ('us-east1', 'us-central1')
FunctionBuilder.runWith()
กำหนดค่าตัวเลือกรันไทม์สำหรับฟังก์ชัน
ลายเซ็น:
runWith(runtimeOptions: RuntimeOptions): FunctionBuilder;
พารามิเตอร์
พารามิเตอร์ | พิมพ์ | คำอธิบาย |
---|---|---|
ตัวเลือกรันไทม์ | ตัวเลือกรันไทม์ | วัตถุที่มีฟิลด์ตัวเลือก: 1. memory : จำนวนหน่วยความจำที่จะจัดสรรให้กับฟังก์ชัน ค่าที่เป็นไปได้คือ: '128MB', '256MB', '512MB', '1GB', '2GB', '4GB' และ '8GB' . 2. timeoutSeconds : หมดเวลาสำหรับฟังก์ชันเป็นวินาที ค่าที่เป็นไปได้คือ 0 ถึง 540 3. failurePolicy : นโยบายความล้มเหลวของฟังก์ชัน โดยที่บูลีน true จะเทียบเท่ากับการจัดเตรียมวัตถุลองใหม่ที่ว่างเปล่า 4. vpcConnector : id ของตัวเชื่อมต่อ VPC ในโปรเจ็กต์และภูมิภาคเดียวกัน 5. vpcConnectorEgressSettings : เมื่อมีการตั้งค่า vpcConnector ให้ควบคุมว่าการรับส่งข้อมูลขาออกใดที่จะถูกส่งผ่าน vpcConnector ค่าต้องไม่เป็นค่าว่าง |
ผลตอบแทน: