跳到主要内容
版本:Next

Framework

Hierarchy

Index

Constructors

constructor

Properties

publicapp

readonlyapplicationContext

applicationContext: IMidwayContainer

configService

configService: MidwayConfigService

configurationOptions

configurationOptions: IFaaSConfigurationOptions

environmentService

environmentService: MidwayEnvironmentService

informationService

informationService: MidwayInformationService

loggerService

loggerService: MidwayLoggerService

middlewareService

middlewareService: MidwayMiddlewareService<Context, any, unknown>

mockService

mockService: MidwayMockService

Methods

applicationInitialize

  • applicationInitialize(options: IMidwayBootstrapOptions): Promise<void>

applyMiddleware

  • applyMiddleware<R, N>(lastMiddleware?: CommonMiddlewareUnion<Context, R, N>): Promise<MiddlewareRespond<Context, R, N>>
  • Type parameters

    • R
    • N

publicbeforeStop

  • beforeStop(): Promise<void>

configure

publiccreateLogger

  • createLogger(name: string, option?: LoggerOptions): ILogger

publicformatHttpResponse

  • formatHttpResponse(context: any, options?: { supportBufferResponse?: boolean }): HttpResponseFormat<unknown>

publicgenerateMiddleware

  • generateMiddleware(middlewareId: string): Promise<(context: Context, next: any, options?: any) => any>
  • @deprecated

publicgetAllHandlerNames

  • getAllHandlerNames(): string[]

getAppDir

  • getAppDir(): string

getApplication

getApplicationContext

  • getApplicationContext(): IMidwayContainer

getBaseDir

  • getBaseDir(): string

getConfiguration

  • getConfiguration(key?: string): any

publicgetContext

  • getContext(context?: any): any

getCoreLogger

  • getCoreLogger(): ILogger

getCurrentEnvironment

  • getCurrentEnvironment(): string

publicgetEventMiddleware

  • getEventMiddleware(): ContextMiddlewareManager<Context, NextFunction, undefined>

publicgetFrameworkName

  • getFrameworkName(): string

publicgetFrameworkType

getLogger

  • getLogger(name?: string): any

getMiddleware

  • getMiddleware(): ContextMiddlewareManager<Context, unknown, unknown>

getNamespace

  • getNamespace(): string

getProjectName

  • getProjectName(): string

publicgetServer

  • getServer(): Server<typeof IncomingMessage, typeof ServerResponse>

publichandleInvokeWrapper

  • handleInvokeWrapper(handlerMapping: string): (...args: any[]) => Promise<any>
  • @deprecated

init

initialize

  • initialize(options?: IMidwayBootstrapOptions): Promise<void>

publicinvokeTriggerFunction

  • invokeTriggerFunction(context: any, handlerMapping: string, options: HandlerOptions): Promise<any>

isEnable

  • isEnable(): boolean

publicloadFunction

  • loadFunction(): Promise<void>

publicrun

  • run(): Promise<void>

runGuard

  • runGuard(ctx: Context, supplierClz: new (...args: any[]) => any, methodName: string): Promise<boolean>

setNamespace

  • setNamespace(namespace: string): void

stop

  • stop(): Promise<void>

publicuseEventMiddleware

  • useEventMiddleware(middleware: CommonMiddlewareUnion<Context, NextFunction, undefined>): void

useFilter

  • useFilter(filter: CommonFilterUnion<Context, unknown, unknown>): void

useGuard

  • useGuard(guards: CommonGuardUnion<Context>): void

publicuseMiddleware

  • useMiddleware(middleware: CommonMiddlewareUnion<Context, NextFunction, undefined>): void

publicwrapHttpRequest

  • wrapHttpRequest(req: Record<string, any> | IncomingMessage, res?: Record<string, any> | ServerResponse<IncomingMessage>, options?: wrapHttpRequestOptions): Promise<unknown>