Tanda tangan:
export declare class FunctionBuilder
Konstruktor
Konstruktor | Pengubah | Keterangan |
---|---|---|
(konstruktor)(pilihan) | Membangun instance baru dari kelas FunctionBuilder |
Properti
Properti | Pengubah | Jenis | Keterangan |
---|---|---|---|
analitik | { peristiwa: (analyticsEventType: string) => analitik.AnalyticsEventBuilder ; } | ||
autentik | { pengguna: (userOptions?: auth.UserOptions ) => auth.UserBuilder ; } | ||
basis data | { contoh: (contoh: string) => database.InstanceBuilder ; ref: <Ref memperluas string>(jalur: Ref) => database.RefBuilder <Referensi>; } | ||
toko api | { dokumen: <Path extends string>(path: Path) => firestore.DocumentBuilder <Jalur>; namespace: (namespace: string) => firestore.NamespaceBuilder ; database: (database: string) => firestore.DatabaseBuilder ; } | ||
https | { onRequest: (handler: (req: https.Request, resp: express.Response) => void | Promise<void>) => import("./cloud-functions"). Fungsi Https ; onCall: (handler: (data: apa saja, konteks: https.CallableContext ) => apa saja | Janji<any>) => import("./cloud-functions"). HttpsFungsi & impor("./cloud-functions"). Dapat dijalankan <apa saja>; } | ||
pubsub | { topik: (topik: string) => pubsub.TopicBuilder ; jadwal: (jadwal: string) => pubsub.ScheduleBuilder ; } | ||
konfigurasi jarak jauh | { onUpdate: (handler: (versi: remoteConfig.TemplateVersion , konteks: EventContext ) => JanjiSeperti<any> | any) => import("./cloud-functions"). Fungsi Cloud < remoteConfig.TemplateVersion >; } | ||
penyimpanan | { ember: (ember?: string) => penyimpanan.BucketBuilder ; objek: () => penyimpanan.ObjectBuilder ; } | ||
tugas | { taskQueue: (pilihan?: tugas.TaskQueueOptions ) => tugas.TaskQueueBuilder ; } | ||
laboratorium uji | { testMatrix: () => testLab.TestMatrixBuilder ; } |
Metode
metode | Pengubah | Keterangan |
---|---|---|
wilayah (wilayah) | Konfigurasikan wilayah tempat fungsi tersebut diterapkan. | |
jalankanDengan(opsi runtime) | Konfigurasikan opsi runtime untuk fungsi tersebut. |
FunctionBuilder.(konstruktor)
Membangun instance baru dari kelas FunctionBuilder
Tanda tangan:
constructor(options: DeploymentOptions);
Parameter
Parameter | Jenis | Keterangan |
---|---|---|
pilihan | Opsi Penerapan |
FunctionBuilder.analytics
Tanda tangan:
get analytics(): {
event: (analyticsEventType: string) => analytics.AnalyticsEventBuilder;
};
FunctionBuilder.auth
Tanda tangan:
get auth(): {
user: (userOptions?: auth.UserOptions) => auth.UserBuilder;
};
FunctionBuilder.database
Tanda tangan:
get database(): {
instance: (instance: string) => database.InstanceBuilder;
ref: <Ref extends string>(path: Ref) => database.RefBuilder<Ref>;
};
FunctionBuilder.firestore
Tanda tangan:
get firestore(): {
document: <Path extends string>(path: Path) => firestore.DocumentBuilder<Path>;
namespace: (namespace: string) => firestore.NamespaceBuilder;
database: (database: string) => firestore.DatabaseBuilder;
};
FunctionBuilder.https
Tanda tangan:
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
Tanda tangan:
get pubsub(): {
topic: (topic: string) => pubsub.TopicBuilder;
schedule: (schedule: string) => pubsub.ScheduleBuilder;
};
FunctionBuilder.remoteConfig
Tanda tangan:
get remoteConfig(): {
onUpdate: (handler: (version: remoteConfig.TemplateVersion, context: EventContext) => PromiseLike<any> | any) => import("./cloud-functions").CloudFunction<remoteConfig.TemplateVersion>;
};
FunctionBuilder.penyimpanan
Tanda tangan:
get storage(): {
bucket: (bucket?: string) => storage.BucketBuilder;
object: () => storage.ObjectBuilder;
};
FunctionBuilder.tugas
Tanda tangan:
get tasks(): {
taskQueue: (options?: tasks.TaskQueueOptions) => tasks.TaskQueueBuilder;
};
FunctionBuilder.testLab
Tanda tangan:
get testLab(): {
testMatrix: () => testLab.TestMatrixBuilder;
};
FunctionBuilder.wilayah()
Konfigurasikan wilayah tempat fungsi tersebut diterapkan.
Tanda tangan:
region(...regions: Array<(typeof SUPPORTED_REGIONS)[number] | string | Expression<string> | ResetValue>): FunctionBuilder;
Parameter
Parameter | Jenis | Keterangan |
---|---|---|
wilayah | Array<(typeof SUPPORTED_REGIONS )[angka] | tali | Ekspresi <string> | Nilai Ulang> | Satu atau beberapa string wilayah. |
Pengembalian:
Contoh 1
fungsi.wilayah('us-east1')
Contoh 2
fungsi.wilayah('us-timur1', 'us-pusat1')
FunctionBuilder.runDengan()
Konfigurasikan opsi runtime untuk fungsi tersebut.
Tanda tangan:
runWith(runtimeOptions: RuntimeOptions): FunctionBuilder;
Parameter
Parameter | Jenis | Keterangan |
---|---|---|
opsi runtime | Opsi Waktu Proses | Objek dengan kolom opsional: 1. memory : jumlah memori yang akan dialokasikan ke fungsi, nilai yang mungkin adalah: '128MB', '256MB', '512MB', '1GB', '2GB', '4GB', dan '8GB' . 2. timeoutSeconds : batas waktu untuk fungsi dalam hitungan detik, nilai yang mungkin adalah 0 hingga 540. 3. failurePolicy : kebijakan kegagalan fungsi, dengan boolean true setara dengan menyediakan objek percobaan ulang yang kosong. 4. vpcConnector : id konektor VPC di proyek dan wilayah yang sama 5. vpcConnectorEgressSettings : ketika vpcConnector disetel, kendalikan lalu lintas keluar mana yang dikirim melalui vpcConnector . Nilai tidak boleh nol. |
Pengembalian: