FunctionBuilder class

签名:

export declare class FunctionBuilder 

构造函数

构造函数修饰符描述
(构造函数)(选项)构造FunctionBuilder类的新实例

特性

财产修饰符类型描述
分析{ 事件:(analyticsEventType:字符串)=> Analytics.AnalyticsEventBuilder ; }
授权{ 用户:(userOptions?: auth.UserOptions ) => auth.UserBuilder ; }
数据库{ 实例:(实例:字符串)=>数据库.InstanceBuilder ; ref: <Ref 扩展字符串>(path: Ref) => database.RefBuilder <参考>; }
火库{ 文档:<路径扩展字符串>(路径:路径) => firestore.DocumentBuilder <路径>;命名空间:(命名空间:字符串)=> firestore.NamespaceBuilder ;数据库:(数据库:字符串)=> firestore.DatabaseBuilder ; }
https { onRequest: (处理程序: (req: https.Request, resp:express.Response) => void | Promise<void>) => import("./cloud-functions"). Https函数; onCall: (处理程序: (数据: 任何, 上下文: https.CallableContext ) => 任意 | Promise<any>) => import("./cloud-functions"). HttpsFunction & import("./cloud-functions").可运行<任意>; }
发布订阅{ 主题:(主题:字符串)=> pubsub.TopicBuilder ;时间表:(时间表:字符串)=> pubsub.ScheduleBuilder ; }
远程配置{ onUpdate: (处理程序: (版本: remoteConfig.TemplateVersion , 上下文: EventContext ) => PromiseLike<任意> |任何)=>导入(“./云函数”)。云函数<远程配置.TemplateVersion >; }
贮存{ 桶:(桶?:字符串)=> storage.BucketBuilder ;对象:() => storage.ObjectBuilder ; }
任务{ 任务队列:(选项?: tasks.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

函数.region('us-east1')

实施例2

函数.region('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 :函数的失败策略,boolean true相当于提供一个空的重试对象。 4. vpcConnector :同一项目和区域中的 VPC 连接器的 id 5. vpcConnectorEgressSettings :当设置vpcConnector时,控制通过vpcConnector发送哪些出口流量。值不能为空。

返回:

函数生成器