-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathServiceRegistryModels.ts
More file actions
79 lines (70 loc) · 2.16 KB
/
Copy pathServiceRegistryModels.ts
File metadata and controls
79 lines (70 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
// Service Registry Type enum
export enum ServiceType {
HTTP = 'HTTP',
gRPC = 'gRPC'
}
// Request Parameter Schema interface
export interface RequestParamSchema {
type: string;
format?: string;
defaultValue?: any;
}
// Request Parameter interface
export interface RequestParam {
name: string;
type: string; // Query, Header, Path, etc.
required: boolean;
schema?: RequestParamSchema;
}
// Service Method interface
export interface ServiceMethod {
id?: number;
operationName: string;
methodName: string;
methodType: string; // GET, PUT, POST, UNARY, SERVER_STREAMING etc.
inputType: string;
outputType: string;
requestParams?: RequestParam[];
exampleInput?: Record<string, any>; // Sample input request
}
// Circuit Breaker Configuration interface
export interface OrkesCircuitBreakerConfig {
failureRateThreshold?: number; // Percentage (e.g., 50.0 for 50%)
slidingWindowSize?: number;
minimumNumberOfCalls?: number;
waitDurationInOpenState?: number; // In millisec
permittedNumberOfCallsInHalfOpenState?: number;
slowCallRateThreshold?: number; // Percentage of slow calls
slowCallDurationThreshold?: number; // Defines "slow" call duration in milliSec
automaticTransitionFromOpenToHalfOpenEnabled?: boolean; // Auto transition
maxWaitDurationInHalfOpenState?: number; // Max time in HALF-OPEN state
}
// Service Registry Configuration interface
export interface ServiceRegistryConfig {
circuitBreakerConfig?: OrkesCircuitBreakerConfig;
}
// Service Registry interface
export interface ServiceRegistry {
name: string;
type: ServiceType;
serviceURI: string;
methods?: ServiceMethod[];
requestParams?: RequestParam[];
config?: ServiceRegistryConfig;
}
// Circuit Breaker Transition Response interface
export interface CircuitBreakerTransitionResponse {
service: string;
previousState: string;
currentState: string;
transitionTimestamp: number;
message: string;
}
// Proto Registry Entry interface
export interface ProtoRegistryEntry {
filename: string;
lastUpdated: number;
}