@litert/televoke
Version:
A simple RPC service framework.
78 lines • 2.01 kB
TypeScript
/**
* Copyright 2025 Angus.Fenying <fenying@litert.org>
*
* 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
*
* https://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.
*/
export declare enum EResponseCode {
/**
* API was called succeed
*/
OK = 0,
/**
* The invoked API does not exist on the remote server.
*/
API_NOT_FOUND = 1,
/**
* Some unexpected error happened.
*/
SYSTEM_ERROR = 2,
/**
* Logical error happened inside the API handler.
*/
FAILURE = 3,
/**
* The arguments inside the request is malformed.
*/
MALFORMED_ARGUMENTS = 4
}
export interface IRequestPayloadV1 {
ttl: number;
api: string;
args: unknown;
cst: number;
rid: string | number;
}
export interface IResponsePayloadV1 {
/**
* The time when server sent the response.
*/
sst: number;
/**
* The time when server received the request.
*/
srt: number;
/**
* The identity of the request.
*/
rid: string | number;
/**
* The protocol status code of the response.
*/
code: number;
/**
* The content of API response.
*/
body: unknown;
}
/**
* The default port for HTTP.
*/
export declare const DEFAULT_INSECURE_PORT = 80;
/**
* The default port for HTTPS.
*/
export declare const DEFAULT_SECURE_PORT = 443;
export declare const DEFAULT_BACKLOG = 511;
export declare const DEFAULT_HOSTNAME = "localhost";
export declare const MAX_PACKET_SIZE: number;
//# sourceMappingURL=Protocol.v1.decls.d.ts.map