UNPKG

@google-cloud/spanner

Version:
45 lines (44 loc) 2.15 kB
/** * Copyright 2025 Google LLC. All Rights Reserved. * * Licensed 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 * as grpc from '@grpc/grpc-js'; declare const randIdForProcess: string; declare const X_GOOG_SPANNER_REQUEST_ID_HEADER = "x-goog-spanner-request-id"; declare class AtomicCounter { private readonly backingBuffer; constructor(initialValue?: number); increment(n?: number): number; value(): number; toString(): string; reset(): void; } declare function craftRequestId(nthClientId: number, channelId: number, nthRequest: number, attempt: number): string; export declare function resetNthClientId(): void; declare function nextSpannerClientId(): number; declare function newAtomicCounter(n?: number): AtomicCounter; declare function injectRequestIDIntoError(config: any, err: Error): void; declare function injectRequestIDIntoHeaders(headers: { [k: string]: string; }, session: any, nthRequest?: number, attempt?: number): { [k: string]: string; }; declare function nextNthRequest(database: any): number; export interface RequestIDError extends grpc.ServiceError { requestID: string; } declare const X_GOOG_SPANNER_REQUEST_ID_SPAN_ATTR = "x_goog_spanner_request_id"; declare function attributeXGoogSpannerRequestIdToActiveSpan(config: any): void; declare const X_GOOG_REQ_ID_REGEX: RegExp; export { AtomicCounter, X_GOOG_REQ_ID_REGEX, X_GOOG_SPANNER_REQUEST_ID_HEADER, X_GOOG_SPANNER_REQUEST_ID_SPAN_ATTR, attributeXGoogSpannerRequestIdToActiveSpan, craftRequestId, injectRequestIDIntoError, injectRequestIDIntoHeaders, nextNthRequest, nextSpannerClientId, newAtomicCounter, randIdForProcess, };