UNPKG

skywalking-backend-js-netease

Version:

The NodeJS agent for Apache SkyWalking

48 lines (47 loc) 2.01 kB
/*! * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ import PluginInstaller from '../core/PluginInstaller'; import SwPlugin from '../core/SwPlugin'; import { Listener, Metadata, Requester } from '@grpc/grpc-js'; declare type Options = { [key: string]: string | number | any; }; declare class GrpcPlugin implements SwPlugin { readonly module = "grpc"; readonly versions = "*"; install(installer: PluginInstaller): void; interceptClientConstruct(Mod: any, Cls: any, func: string): void; addClientIntercepter(Mod: any, address: any, options: any): any; interceptServerOperation(Mod: any, Cls: any, operation: string): void; inteceptServerLocal(Cls: any, name: string): void; } /** * @param opts { method_definition: { path: "/TraceSegmentReportService/collect" } } */ export declare class TracingRequester implements Requester { _SKYWALKING_GRPC_OBJ: any; constructor(address: string, opts: Options); getSkywalkingObj(address: string, opts: Options): any; start(metadata: Metadata, listener: Listener, next: Function): void; sendMessage(message: any, next: Function): void; halfClose(next: Function): void; cancel(next: Function): void; } declare const _default: GrpcPlugin; export default _default;