-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpkg.generated.mbti
More file actions
1018 lines (860 loc) · 37.1 KB
/
Copy pathpkg.generated.mbti
File metadata and controls
1018 lines (860 loc) · 37.1 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Generated using `moon info`, DON'T EDIT IT
package "moonbitstack/moonzero"
import {
"moonbitlang/core/debug",
"moonbitlang/core/json",
"moonbitstack/moonapi",
"moonbitstack/moonasgi/http",
"moonbitstack/moonasgi/spec",
"moonbitstack/mooncred/jwt",
"moonbitstack/moonhttp/hpack",
"moonbitstack/moonlog",
"moonbitstack/moonpool",
"moonbitstack/moonrpc",
}
// Values
pub fn auth(String, Clock) -> (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub fn breaker(Breaker, refusal? : Refusal) -> (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub fn canonical_key(String) -> String
pub fn constant_time_eq(Bytes, Bytes) -> Bool
pub fn consul_check_id(String) -> String
pub fn consul_parse_health(Bytes) -> Array[Endpoint] raise ConsulError
pub fn consul_register_body(String, String, String, Int, Int) -> Bytes
pub fn cors(CorsConf) -> (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub let default_latency_buckets : Array[Double]
pub let duration_key : String
pub fn entry(@moonlog.Record) -> String
pub fn etcd_prefix_end(Bytes) -> Bytes
pub fn etcd_service_prefix(String, String) -> String
pub let exposition_content_type : String
pub fn generate_span_id(Int64) -> String
pub fn generate_trace_id(Int64) -> String
pub fn hmac_sha256(Bytes, Bytes) -> Bytes
pub fn jwt_authorized(String?, String, Int64) -> Bool
pub fn jwt_sign(Map[String, Json], String, typ? : String?, extra? : Map[String, Json], wins? : @jwt.Wins, clash? : @jwt.OnClash[Map[String, Json]]) -> String
pub fn jwt_verify(String, String, Int64, policy? : @jwt.Policy) -> Map[String, Json] raise @jwt.Rejected
pub fn level_name(@moonlog.Level) -> String
pub fn logging(async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub let logx : Logger
pub fn max_conns(MaxConns, refusal? : Refusal) -> (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub fn maxbytes(Int, refusal? : Refusal) -> (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub let message_key : String
pub fn metrics(ServerMetrics, Clock) -> (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub fn metrics_handler(ServerMetrics) -> (@moonapi.Context) -> @http.Response raise
pub fn mount_metrics(@moonapi.App, ServerMetrics) -> Unit
pub fn next_trace_context(String?, Int64) -> TraceContext
pub fn parse_traceparent(String) -> TraceContext?
pub fn period_limit(PeriodLimit, Clock, key? : String, refusal? : Refusal) -> (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub let period_script : String
pub fn pick_first(Array[Endpoint]) -> Endpoint?
pub let plain_text : Array[(String, String)]
pub let port : Int
pub fn rate_limit(TokenBucket, Clock, refusal? : Refusal) -> (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub fn recovery(async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub fn redis_instance_key(String, String, Endpoint) -> String
pub fn redis_period_limit(RedisPeriodLimit, key? : String, refusal? : Refusal) -> (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub fn redis_rate_limit(RedisTokenLimit, Clock, refusal? : Refusal) -> (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub fn redis_service_pattern(String, String) -> String
pub fn redis_service_prefix(String, String) -> String
pub let refusal : Refusal
pub fn request_id(header? : String) -> (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub fn resolve_one(InMemoryRegistry, String, RoundRobin) -> Endpoint?
pub fn resp_command(Array[String]) -> Bytes
pub fn resp_encode_command(Array[Bytes]) -> Bytes
pub fn resp_kind(RespValue) -> String
pub let rpc_port : Int
pub fn set_log_level(LogLevel) -> Unit
pub fn set_log_sink(&@moonlog.Sink) -> Unit
pub fn set_log_writer((String) -> Unit) -> Unit
pub fn sha256(Bytes) -> Bytes
pub fn shedding(Shedder, refusal? : Refusal) -> (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub let stamp_key : String
pub fn status_of_code(Int) -> @moonrpc.Status
pub fn structured_logging(Clock, logger? : Logger) -> (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub let timed_out : Refusal
pub fn timeout(Int64, Clock, refusal? : Refusal) -> (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub let token_script : String
pub let too_large : Refusal
pub let too_many : Refusal
pub fn tracing(header? : String, ignore_paths? : Array[String]) -> (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub let unavailable : Refusal
// Errors
pub suberror ConfigError {
ConfigError(String)
}
pub suberror ConsulError {
ConsulError(String)
}
pub suberror EtcdError {
EtcdError(String)
}
pub suberror RedisError {
RedisError(String)
}
pub suberror RespError {
RespError(String)
}
pub suberror Unavailable
// Types and methods
pub(all) enum Balancer {
RoundRobinBalancer(RoundRobin)
PickFirst
WeightedBalancer(WeightedRoundRobin)
}
pub fn Balancer::pick(Self, Array[Endpoint]) -> Endpoint?
pub fn Balancer::round_robin() -> Self
pub fn Balancer::weighted() -> Self
pub struct BidiCall {
channel : RpcChannel
sid : Int
mut pending : Bytes
mut status_code : Int
mut ended : Bool
}
pub fn BidiCall::close_send(Self) -> Result[Array[Bytes], @moonrpc.Status] raise
pub fn BidiCall::send(Self, Bytes) -> Array[Bytes] raise
pub(all) struct BidiStreamHandler {
on_message : (Bytes) -> Array[Bytes]
on_end : () -> Array[Bytes]
}
pub struct Breaker {
win : Window
clock : Clock
roll : () -> Double
mut last_pass : Int64?
}
pub fn Breaker::allow(Self) -> Promise?
pub fn Breaker::drop_ratio(Self) -> Double
pub fn Breaker::new(Clock, rand? : () -> Double, buckets? : Int, bucket_ms? : Int64) -> Self
pub fn[T] Breaker::run(Self, () -> T raise) -> T raise
pub struct Bucket {
mut sum : Int64
mut succ : Int64
mut fail : Int64
mut drop : Int64
}
pub struct Clock {
now_ms : () -> Int64
}
pub fn Clock::new(() -> Int64) -> Self
pub fn Clock::now(Self) -> Int64
pub fn Clock::system() -> Self
pub struct Conf {
root : Map[String, Json]
}
pub fn Conf::at(Self, String) -> Json?
pub fn Conf::bool(Self, String, default? : Bool, env? : String, also? : Array[String]) -> Bool raise ConfigError
pub fn Conf::int(Self, String, default? : Int, range? : String, env? : String, also? : Array[String]) -> Int raise ConfigError
pub fn Conf::int64(Self, String, default? : Int64, range? : String, env? : String, also? : Array[String]) -> Int64 raise ConfigError
pub fn Conf::list(Self, String) -> Array[Self] raise ConfigError
pub fn Conf::of_json(String) -> Self raise ConfigError
pub fn Conf::of_yaml(String) -> Self raise ConfigError
pub fn Conf::string(Self, String, default? : String, options? : Array[String], env? : String, also? : Array[String]) -> String raise ConfigError
pub fn Conf::strings(Self, String, default? : Array[String], env? : String, also? : Array[String]) -> Array[String] raise ConfigError
pub struct ConsulClient {
http : &ConsulHttp
}
pub fn ConsulClient::agent_services(Self) -> Array[(String, String)] raise ConsulError
pub fn ConsulClient::check_pass(Self, String) -> Unit raise ConsulError
pub fn ConsulClient::deregister_service(Self, String) -> Unit raise ConsulError
pub fn ConsulClient::health_service(Self, String) -> Array[Endpoint] raise ConsulError
pub fn ConsulClient::new(&ConsulHttp) -> Self
pub fn ConsulClient::register_service(Self, String, String, String, Int, Int) -> Unit raise ConsulError
pub struct ConsulDiscovery {
client : ConsulClient
}
pub fn ConsulDiscovery::deregister(Self, String) -> Unit raise
pub fn ConsulDiscovery::deregister_instance(Self, String, Endpoint) -> Unit raise
pub fn ConsulDiscovery::keepalive(Self, String, Endpoint) -> Unit raise
pub fn ConsulDiscovery::new(ConsulClient) -> Self
pub fn ConsulDiscovery::register(Self, String, Endpoint, ttl? : Int) -> String raise
pub fn ConsulDiscovery::resolve(Self, String) -> Array[Endpoint] raise
pub fn ConsulDiscovery::resolver(Self) -> (String) -> Array[Endpoint]
pub struct ConsulResponse {
status : Int
body : Bytes
}
pub fn ConsulResponse::body(Self) -> Bytes
pub fn ConsulResponse::new(Int, Bytes) -> Self
pub fn ConsulResponse::status(Self) -> Int
pub(all) struct CorsConf {
allow_origin : String
allow_methods : String
allow_headers : String
allow_credentials : Bool
max_age : Int
}
pub fn CorsConf::new(allow_origin? : String, allow_methods? : String, allow_headers? : String, allow_credentials? : Bool, max_age? : Int) -> Self
pub struct CounterVec {
counts : Map[String, Int64]
}
pub fn CounterVec::add(Self, String, Int64) -> Unit
pub fn CounterVec::inc(Self, String) -> Unit
pub fn CounterVec::labels(Self) -> Array[String]
pub fn CounterVec::new() -> Self
pub fn CounterVec::to_exposition(Self, name~ : String, help~ : String, label? : String) -> String
pub fn CounterVec::total(Self) -> Int64
pub fn CounterVec::value(Self, String) -> Int64
pub struct Deadline {
budget_ms : Int64
started_ms : Int64
}
pub fn Deadline::expired(Self, Int64) -> Bool
pub fn Deadline::remaining(Self, Int64) -> Int64
pub fn Deadline::start(Int64, Int64) -> Self
pub(all) struct Endpoint {
host : String
port : Int
weight : Int
} derive(Eq, @debug.Debug)
pub fn Endpoint::address(Self) -> String
pub fn Endpoint::equal(Self, Self) -> Bool
pub fn Endpoint::new(String, Int, weight? : Int) -> Self
pub fn Endpoint::not_equal(Self, Self) -> Bool
pub fn Endpoint::to_repr(Self) -> @debug.Repr
pub struct EtcdClient {
channel : RpcChannel
}
pub fn EtcdClient::delete_range(Self, EtcdDeleteRangeRequest) -> EtcdDeleteRangeResponse raise
pub fn EtcdClient::lease_grant(Self, EtcdLeaseGrantRequest) -> EtcdLeaseGrantResponse raise
pub fn EtcdClient::new(RpcChannel) -> Self
pub fn EtcdClient::put(Self, EtcdPutRequest) -> EtcdPutResponse raise
pub fn EtcdClient::range(Self, EtcdRangeRequest) -> EtcdRangeResponse raise
pub fn EtcdClient::watch(Self, EtcdWatchRequest) -> Array[EtcdWatchResponse] raise
pub(all) struct EtcdDeleteRangeRequest {
key : Bytes
range_end : Bytes
prev_kv : Bool
} derive(Eq)
pub fn EtcdDeleteRangeRequest::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdDeleteRangeRequest::encode(Self) -> Bytes
pub fn EtcdDeleteRangeRequest::equal(Self, Self) -> Bool
pub fn EtcdDeleteRangeRequest::not_equal(Self, Self) -> Bool
pub(all) struct EtcdDeleteRangeResponse {
deleted : Int64
prev_kvs : Array[EtcdKeyValue]
} derive(Eq)
pub fn EtcdDeleteRangeResponse::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdDeleteRangeResponse::encode(Self) -> Bytes
pub fn EtcdDeleteRangeResponse::equal(Self, Self) -> Bool
pub fn EtcdDeleteRangeResponse::not_equal(Self, Self) -> Bool
pub struct EtcdDiscovery {
client : EtcdClient
prefix : String
}
pub fn EtcdDiscovery::deregister(Self, String) -> Unit raise
pub fn EtcdDiscovery::new(EtcdClient, prefix? : String) -> Self
pub fn EtcdDiscovery::register(Self, String, Endpoint, ttl? : Int64) -> Int64 raise
pub fn EtcdDiscovery::resolve(Self, String) -> Array[Endpoint] raise
pub fn EtcdDiscovery::resolver(Self) -> (String) -> Array[Endpoint]
pub(all) struct EtcdEvent {
event_type : EtcdEventType
kv : EtcdKeyValue
} derive(Eq)
pub fn EtcdEvent::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdEvent::encode(Self) -> Bytes
pub fn EtcdEvent::equal(Self, Self) -> Bool
pub fn EtcdEvent::not_equal(Self, Self) -> Bool
pub(all) enum EtcdEventType {
Put
Delete
} derive(Eq)
pub fn EtcdEventType::equal(Self, Self) -> Bool
pub fn EtcdEventType::from_int(Int) -> Self
pub fn EtcdEventType::not_equal(Self, Self) -> Bool
pub fn EtcdEventType::to_int(Self) -> Int
pub(all) struct EtcdKeyValue {
key : Bytes
create_revision : Int64
mod_revision : Int64
version : Int64
value : Bytes
lease : Int64
} derive(Eq)
pub fn EtcdKeyValue::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdKeyValue::empty() -> Self
pub fn EtcdKeyValue::encode(Self) -> Bytes
pub fn EtcdKeyValue::equal(Self, Self) -> Bool
pub fn EtcdKeyValue::not_equal(Self, Self) -> Bool
pub(all) struct EtcdLeaseGrantRequest {
ttl : Int64
id : Int64
} derive(Eq)
pub fn EtcdLeaseGrantRequest::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdLeaseGrantRequest::encode(Self) -> Bytes
pub fn EtcdLeaseGrantRequest::equal(Self, Self) -> Bool
pub fn EtcdLeaseGrantRequest::not_equal(Self, Self) -> Bool
pub(all) struct EtcdLeaseGrantResponse {
id : Int64
ttl : Int64
error : String
} derive(Eq)
pub fn EtcdLeaseGrantResponse::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdLeaseGrantResponse::encode(Self) -> Bytes
pub fn EtcdLeaseGrantResponse::equal(Self, Self) -> Bool
pub fn EtcdLeaseGrantResponse::not_equal(Self, Self) -> Bool
pub(all) struct EtcdLeaseKeepAliveRequest {
id : Int64
} derive(Eq)
pub fn EtcdLeaseKeepAliveRequest::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdLeaseKeepAliveRequest::encode(Self) -> Bytes
pub fn EtcdLeaseKeepAliveRequest::equal(Self, Self) -> Bool
pub fn EtcdLeaseKeepAliveRequest::not_equal(Self, Self) -> Bool
pub(all) struct EtcdLeaseKeepAliveResponse {
id : Int64
ttl : Int64
} derive(Eq)
pub fn EtcdLeaseKeepAliveResponse::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdLeaseKeepAliveResponse::encode(Self) -> Bytes
pub fn EtcdLeaseKeepAliveResponse::equal(Self, Self) -> Bool
pub fn EtcdLeaseKeepAliveResponse::not_equal(Self, Self) -> Bool
pub(all) struct EtcdPutRequest {
key : Bytes
value : Bytes
lease : Int64
} derive(Eq)
pub fn EtcdPutRequest::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdPutRequest::encode(Self) -> Bytes
pub fn EtcdPutRequest::equal(Self, Self) -> Bool
pub fn EtcdPutRequest::not_equal(Self, Self) -> Bool
pub(all) struct EtcdPutResponse {
prev_kv : EtcdKeyValue
} derive(Eq)
pub fn EtcdPutResponse::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdPutResponse::encode(Self) -> Bytes
pub fn EtcdPutResponse::equal(Self, Self) -> Bool
pub fn EtcdPutResponse::not_equal(Self, Self) -> Bool
pub(all) struct EtcdRangeRequest {
key : Bytes
range_end : Bytes
limit : Int64
} derive(Eq)
pub fn EtcdRangeRequest::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdRangeRequest::encode(Self) -> Bytes
pub fn EtcdRangeRequest::equal(Self, Self) -> Bool
pub fn EtcdRangeRequest::not_equal(Self, Self) -> Bool
pub(all) struct EtcdRangeResponse {
kvs : Array[EtcdKeyValue]
count : Int64
} derive(Eq)
pub fn EtcdRangeResponse::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdRangeResponse::encode(Self) -> Bytes
pub fn EtcdRangeResponse::equal(Self, Self) -> Bool
pub fn EtcdRangeResponse::not_equal(Self, Self) -> Bool
pub(all) struct EtcdWatchCancelRequest {
watch_id : Int64
} derive(Eq)
pub fn EtcdWatchCancelRequest::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdWatchCancelRequest::encode(Self) -> Bytes
pub fn EtcdWatchCancelRequest::equal(Self, Self) -> Bool
pub fn EtcdWatchCancelRequest::not_equal(Self, Self) -> Bool
pub(all) struct EtcdWatchCreateRequest {
key : Bytes
range_end : Bytes
start_revision : Int64
} derive(Eq)
pub fn EtcdWatchCreateRequest::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdWatchCreateRequest::encode(Self) -> Bytes
pub fn EtcdWatchCreateRequest::equal(Self, Self) -> Bool
pub fn EtcdWatchCreateRequest::not_equal(Self, Self) -> Bool
pub(all) enum EtcdWatchRequest {
Create(EtcdWatchCreateRequest)
Cancel(EtcdWatchCancelRequest)
} derive(Eq)
pub fn EtcdWatchRequest::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdWatchRequest::encode(Self) -> Bytes
pub fn EtcdWatchRequest::equal(Self, Self) -> Bool
pub fn EtcdWatchRequest::not_equal(Self, Self) -> Bool
pub(all) struct EtcdWatchResponse {
watch_id : Int64
created : Bool
canceled : Bool
events : Array[EtcdEvent]
} derive(Eq)
pub fn EtcdWatchResponse::decode(Bytes) -> Self raise @moonrpc.PbError
pub fn EtcdWatchResponse::encode(Self) -> Bytes
pub fn EtcdWatchResponse::equal(Self, Self) -> Bool
pub fn EtcdWatchResponse::not_equal(Self, Self) -> Bool
pub struct Group {
app : @moonapi.App
prefix : String
}
pub fn Group::delete(Self, String, (@moonapi.Context) -> @http.Response raise, summary? : String) -> Unit
pub fn Group::get(Self, String, (@moonapi.Context) -> @http.Response raise, summary? : String) -> Unit
pub fn Group::new(@moonapi.App, String) -> Self
pub fn Group::patch(Self, String, (@moonapi.Context) -> @http.Response raise, summary? : String) -> Unit
pub fn Group::post(Self, String, (@moonapi.Context) -> @http.Response raise, summary? : String) -> Unit
pub fn Group::prefix(Self) -> String
pub fn Group::put(Self, String, (@moonapi.Context) -> @http.Response raise, summary? : String) -> Unit
pub fn Group::route(Self, @moonapi.Method, String, (@moonapi.Context) -> @http.Response raise, summary? : String) -> Unit
pub struct Histogram {
bounds : Array[Double]
bucket : Array[Int64]
mut sum : Double
mut count : Int64
}
pub fn Histogram::bounds(Self) -> Array[Double]
pub fn Histogram::bucket_count(Self, Int) -> Int64
pub fn Histogram::mean(Self) -> Double
pub fn Histogram::new(bounds? : Array[Double]) -> Self
pub fn Histogram::observe(Self, Double) -> Unit
pub fn Histogram::sum_value(Self) -> Double
pub fn Histogram::to_exposition(Self, name~ : String, help~ : String) -> String
pub fn Histogram::total(Self) -> Int64
pub struct InMemoryRegistry {
instances : Map[String, Map[String, Endpoint]]
mut seq : Int
mut revision : Int64
}
pub fn InMemoryRegistry::deregister(Self, String, String) -> Bool
pub fn InMemoryRegistry::new() -> Self
pub fn InMemoryRegistry::register(Self, String, Endpoint) -> String
pub fn InMemoryRegistry::resolve(Self, String) -> Array[Endpoint]
pub fn InMemoryRegistry::resolver(Self) -> (String) -> Array[Endpoint]
pub fn InMemoryRegistry::revision(Self) -> Int64
pub fn InMemoryRegistry::services(Self) -> Array[String]
pub(all) struct Layer {
name : String
middleware : (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
}
pub struct LoadBalancedChannel {
resolve : (String) -> Array[Endpoint]
cluster : RpcCluster
balancer : Balancer
service : String
}
pub fn LoadBalancedChannel::call(Self, String, Bytes) -> Result[Bytes, @moonrpc.Status] raise
pub fn LoadBalancedChannel::call_bidi_streaming(Self, String, Array[Bytes]) -> Result[Array[Bytes], @moonrpc.Status] raise
pub fn LoadBalancedChannel::call_server_streaming(Self, String, Bytes) -> Result[Array[Bytes], @moonrpc.Status] raise
pub fn LoadBalancedChannel::new((String) -> Array[Endpoint], RpcCluster, String, balancer? : Balancer) -> Self
pub(all) enum LogLevel {
Debug
Info
Error
Severe
} derive(Compare, Eq, @debug.Debug)
pub fn LogLevel::as_level(Self) -> @moonlog.Level
pub fn LogLevel::compare(Self, Self) -> Int
pub fn LogLevel::equal(Self, Self) -> Bool
pub fn LogLevel::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
pub fn LogLevel::not_equal(Self, Self) -> Bool
pub fn LogLevel::op_ge(Self, Self) -> Bool
pub fn LogLevel::op_gt(Self, Self) -> Bool
pub fn LogLevel::op_le(Self, Self) -> Bool
pub fn LogLevel::op_lt(Self, Self) -> Bool
pub fn LogLevel::parse(String) -> Self
pub fn LogLevel::to_repr(Self) -> @debug.Repr
pub fn LogLevel::to_string(Self) -> String
pub impl @json.FromJson for LogLevel
type LogState
pub struct Logger {
state : LogState
clock : Clock
duration_ms : Int64?
}
pub fn Logger::debug(Self, String, fields? : Array[(String, Json)]) -> Unit
pub fn Logger::enabled(Self, LogLevel) -> Bool
pub fn Logger::error(Self, String, fields? : Array[(String, Json)]) -> Unit
pub fn Logger::info(Self, String, fields? : Array[(String, Json)]) -> Unit
pub fn Logger::level(Self) -> LogLevel
pub fn Logger::log(Self, LogLevel, String, fields? : Array[(String, Json)]) -> Unit
pub fn Logger::new(Clock, level? : LogLevel, sink? : &@moonlog.Sink) -> Self
pub fn Logger::set_level(Self, LogLevel) -> Unit
pub fn Logger::set_sink(Self, &@moonlog.Sink) -> Unit
pub fn Logger::set_writer(Self, (String) -> Unit) -> Unit
pub fn Logger::severe(Self, String, fields? : Array[(String, Json)]) -> Unit
pub fn Logger::with_duration(Self, Int64) -> Self
pub struct ManualClock {
mut ms : Int64
}
pub fn ManualClock::advance(Self, Int64) -> Unit
pub fn ManualClock::as_clock(Self) -> Clock
pub fn ManualClock::new(start? : Int64) -> Self
pub struct MaxConns {
max : Int
mut in_flight : Int
}
pub fn MaxConns::in_flight(Self) -> Int
pub fn MaxConns::new(Int) -> Self
pub fn MaxConns::release(Self) -> Unit
pub fn MaxConns::try_acquire(Self) -> Bool
pub(all) struct MiddlewaresConf {
trace : Bool
log : Bool
prometheus : Bool
max_conns : Bool
breaker : Bool
shedding : Bool
timeout : Bool
recover : Bool
metrics : Bool
max_bytes : Bool
gunzip : Bool
} derive(Eq, @debug.Debug)
pub fn MiddlewaresConf::equal(Self, Self) -> Bool
pub fn MiddlewaresConf::new(trace? : Bool, log? : Bool, prometheus? : Bool, max_conns? : Bool, breaker? : Bool, shedding? : Bool, timeout? : Bool, recover? : Bool, metrics? : Bool, max_bytes? : Bool, gunzip? : Bool) -> Self
pub fn MiddlewaresConf::not_equal(Self, Self) -> Bool
pub fn MiddlewaresConf::to_repr(Self) -> @debug.Repr
pub(all) enum Outcome {
Succ
Fail
Drop
} derive(Eq, @debug.Debug)
pub fn Outcome::equal(Self, Self) -> Bool
pub fn Outcome::not_equal(Self, Self) -> Bool
pub fn Outcome::to_repr(Self) -> @debug.Repr
pub struct PeriodLimit {
period_ms : Int64
quota : Int
windows : Map[String, (Int64, Int)]
}
pub fn PeriodLimit::new(period_secs~ : Int, quota~ : Int) -> Self
pub fn PeriodLimit::take(Self, String, Int64) -> PeriodResult
pub(all) enum PeriodResult {
PeriodAllowed
PeriodHitQuota
PeriodOverQuota
} derive(Eq, @debug.Debug)
pub fn PeriodResult::equal(Self, Self) -> Bool
pub fn PeriodResult::not_equal(Self, Self) -> Bool
pub fn PeriodResult::to_repr(Self) -> @debug.Repr
pub struct PersistentRegistry {
instances : Map[String, Map[String, Endpoint]]
key_rev : Map[String, Int64]
mut seq : Int
mut revision : Int64
events : Array[RegistryEvent]
watchers : Array[(RegistryEvent) -> Unit]
}
pub fn PersistentRegistry::deregister(Self, String, String) -> Bool
pub fn PersistentRegistry::events_since(Self, Int64) -> Array[RegistryEvent]
pub fn PersistentRegistry::keyed_entries(Self) -> Array[(String, Endpoint, Int64)]
pub fn PersistentRegistry::new() -> Self
pub fn PersistentRegistry::register(Self, String, Endpoint) -> String
pub fn PersistentRegistry::resolve(Self, String) -> Array[Endpoint]
pub fn PersistentRegistry::resolver(Self) -> (String) -> Array[Endpoint]
pub fn PersistentRegistry::restore(String) -> Self raise ConfigError
pub fn PersistentRegistry::revision(Self) -> Int64
pub fn PersistentRegistry::services(Self) -> Array[String]
pub fn PersistentRegistry::snapshot(Self) -> String
pub fn PersistentRegistry::watch(Self, (RegistryEvent) -> Unit) -> Unit
pub(all) struct PrivateKeyConf {
fingerprint : String
key_file : String
} derive(Eq, @debug.Debug)
pub fn PrivateKeyConf::equal(Self, Self) -> Bool
pub fn PrivateKeyConf::not_equal(Self, Self) -> Bool
pub fn PrivateKeyConf::to_repr(Self) -> @debug.Repr
pub struct Promise {
b : Breaker
}
pub fn Promise::accept(Self) -> Unit
pub fn Promise::reject(Self) -> Unit
pub struct RedisClient {
conn : &RedisConn
}
pub async fn RedisClient::command(Self, Array[Bytes]) -> RespValue raise RedisError
pub async fn RedisClient::del(Self, Array[Bytes]) -> Int64 raise RedisError
pub async fn RedisClient::eval(Self, String, Array[Bytes], Array[Bytes]) -> RespValue raise RedisError
pub async fn RedisClient::evalsha(Self, String, Array[Bytes], Array[Bytes]) -> RespValue raise RedisError
pub async fn RedisClient::expire(Self, Bytes, Int) -> Bool raise RedisError
pub async fn RedisClient::get(Self, Bytes) -> Bytes? raise RedisError
pub fn RedisClient::new(&RedisConn) -> Self
pub async fn RedisClient::ping(Self) -> String raise RedisError
pub async fn RedisClient::scan_match(Self, Bytes, Int) -> Array[Bytes] raise RedisError
pub async fn RedisClient::script_load(Self, String) -> String raise RedisError
pub async fn RedisClient::set_ex(Self, Bytes, Bytes, Int) -> Unit raise RedisError
pub struct RedisDiscovery {
client : RedisClient
prefix : String
seen : Map[String, Array[Endpoint]]
}
pub async fn RedisDiscovery::deregister(Self, String) -> Unit
pub async fn RedisDiscovery::deregister_instance(Self, String, Endpoint) -> Unit
pub async fn RedisDiscovery::keepalive(Self, String, Endpoint, ttl? : Int) -> Bool
pub fn RedisDiscovery::last(Self, String) -> Array[Endpoint]
pub fn RedisDiscovery::new(RedisClient, prefix? : String) -> Self
pub async fn RedisDiscovery::register(Self, String, Endpoint, ttl? : Int) -> String
pub async fn RedisDiscovery::resolve(Self, String) -> Array[Endpoint]
pub fn RedisDiscovery::resolver(Self) -> (String) -> Array[Endpoint]
pub struct RedisPeriodLimit {
client : RedisClient
script : RedisScript
period_secs : Int
quota : Int
prefix : String
}
pub fn RedisPeriodLimit::new(RedisClient, period_secs~ : Int, quota~ : Int, prefix? : String) -> Self
pub async fn RedisPeriodLimit::take(Self, String) -> PeriodResult raise RedisError
pub struct RedisScript {
source : String
mut sha : String?
}
pub fn RedisScript::new(String) -> Self
pub async fn RedisScript::run(Self, RedisClient, Array[Bytes], Array[Bytes]) -> RespValue raise RedisError
pub fn RedisScript::source(Self) -> String
pub struct RedisTokenLimit {
client : RedisClient
script : RedisScript
rate : Int
burst : Int
token_key : Bytes
ts_key : Bytes
rescue : TokenBucket
}
pub async fn RedisTokenLimit::allow(Self, Int64) -> Bool
pub async fn RedisTokenLimit::allow_n(Self, Int, Int64) -> Bool
pub fn RedisTokenLimit::new(RedisClient, rate~ : Int, burst~ : Int, key~ : String) -> Self
pub fn RedisTokenLimit::rescue(Self) -> TokenBucket
pub(all) struct Refusal {
status : Int
body : Bytes
headers : Array[(String, String)]
}
pub fn Refusal::events(Self) -> Array[@spec.Event]
pub fn Refusal::new(status? : Int, body? : Bytes, headers? : Array[(String, String)]) -> Self
pub(all) enum RegistryEvent {
Put(key~ : String, endpoint~ : Endpoint, revision~ : Int64)
Delete(key~ : String, revision~ : Int64)
} derive(Eq, @debug.Debug)
pub fn RegistryEvent::equal(Self, Self) -> Bool
pub fn RegistryEvent::not_equal(Self, Self) -> Bool
pub fn RegistryEvent::revision(Self) -> Int64
pub fn RegistryEvent::to_repr(Self) -> @debug.Repr
pub(all) struct RequestLog {
http_method : String
path : String
status : Int
duration_ms : Int64
request_id : String
client_ip : String
user_agent : String
}
pub fn RequestLog::fields(Self) -> Array[(String, Json)]
pub fn RequestLog::render(Self) -> String
pub fn RequestLog::to_json(Self) -> Json
pub struct RespReader {
data : Bytes
mut pos : Int
}
pub fn RespReader::at_end(Self) -> Bool
pub fn RespReader::new(Bytes) -> Self
pub fn RespReader::read(Self) -> RespValue raise RespError
pub(all) enum RespValue {
SimpleString(String)
Error(String)
Integer(Int64)
BulkString(Bytes)
Null
Array(Array[RespValue])
Boolean(Bool)
Double(Double)
BigNumber(String)
BulkError(String)
VerbatimString(String, Bytes)
RespMap(Array[(RespValue, RespValue)])
RespSet(Array[RespValue])
Push(Array[RespValue])
} derive(Eq, @debug.Debug)
pub fn RespValue::decode(Bytes) -> Self raise RespError
pub fn RespValue::equal(Self, Self) -> Bool
pub fn RespValue::not_equal(Self, Self) -> Bool
pub fn RespValue::to_repr(Self) -> @debug.Repr
pub(all) struct RestConf {
service : ServiceConf
cert_file : String
key_file : String
verbose : Bool
max_conns : Int
max_bytes : Int
cpu_threshold : Int64
signature : SignatureConf
middlewares : MiddlewaresConf
trace_ignore_paths : Array[String]
}
pub fn RestConf::from_json(String) -> Self raise ConfigError
pub fn RestConf::from_yaml(String) -> Self raise ConfigError
pub fn RestConf::host(Self) -> String
pub fn RestConf::new(service? : ServiceConf, cert_file? : String, key_file? : String, verbose? : Bool, max_conns? : Int, max_bytes? : Int, cpu_threshold? : Int64, signature? : SignatureConf, middlewares? : MiddlewaresConf, trace_ignore_paths? : Array[String]) -> Self
pub fn RestConf::port(Self) -> Int
pub fn RestConf::timeout_ms(Self) -> Int
pub fn RestConf::tls(Self) -> Bool
pub struct RestEngine {
conf : RestConf
clock : Clock
logger : Logger
metrics : ServerMetrics
conns : MaxConns
circuit : Breaker
shedder : Shedder
}
pub fn RestEngine::build(Self, @moonapi.App) -> Server
pub fn RestEngine::conf(Self) -> RestConf
pub fn RestEngine::layers(Self) -> Array[Layer]
pub fn RestEngine::metrics(Self) -> ServerMetrics
pub fn RestEngine::names(Self) -> Array[String]
pub fn RestEngine::new(RestConf, clock? : Clock, logger? : Logger, metrics? : ServerMetrics, usage? : () -> Int64) -> Self raise ConfigError
pub struct RoundRobin {
mut cursor : Int
}
pub fn RoundRobin::new() -> Self
pub fn RoundRobin::pick(Self, Array[Endpoint]) -> Endpoint?
pub struct RpcChannel {
engine : @moonrpc.H2Server
encoder : @hpack.Encoder
decoder : @hpack.Decoder
authority : String
mut next_stream_id : Int
}
pub fn RpcChannel::call(Self, String, Bytes) -> Result[Bytes, @moonrpc.Status] raise
pub fn RpcChannel::call_bidi_streaming(Self, String, Array[Bytes]) -> Result[Array[Bytes], @moonrpc.Status] raise
pub fn RpcChannel::call_client_streaming(Self, String, Array[Bytes]) -> Result[Bytes, @moonrpc.Status] raise
pub fn RpcChannel::call_server_streaming(Self, String, Bytes) -> Result[Array[Bytes], @moonrpc.Status] raise
pub fn RpcChannel::connect(RpcServer, authority? : String) -> Self
pub fn RpcChannel::open_bidi(Self, String) -> BidiCall raise
pub struct RpcCluster {
servers : Map[String, RpcServer]
}
pub fn RpcCluster::add(Self, Endpoint, RpcServer) -> Unit
pub fn RpcCluster::dial(Self, Endpoint) -> RpcChannel?
pub fn RpcCluster::new() -> Self
pub struct RpcGroup {
server : RpcServer
service : String
}
pub fn RpcGroup::register(Self, String, (Bytes) -> Bytes) -> Unit
pub fn RpcGroup::register_bidi_streaming(Self, String, () -> BidiStreamHandler) -> Unit
pub fn RpcGroup::register_client_streaming(Self, String, (Array[Bytes]) -> Bytes) -> Unit
pub fn RpcGroup::register_server_streaming(Self, String, (Bytes) -> Array[Bytes]) -> Unit
pub fn RpcGroup::service(Self) -> String
pub struct RpcServer {
conf : RpcServerConf
handlers : Map[String, (Bytes) -> Bytes]
server_streaming : Map[String, (Bytes) -> Array[Bytes]]
client_streaming : Map[String, (Array[Bytes]) -> Bytes]
bidi_streaming : Map[String, () -> BidiStreamHandler]
}
pub fn RpcServer::conf(Self) -> RpcServerConf
pub fn RpcServer::dispatch(Self, String, Bytes) -> Result[Bytes, @moonrpc.Status]
pub fn RpcServer::dispatch_graceful(Self, ShutdownCoordinator, String, Bytes) -> Result[Bytes, @moonrpc.Status]
pub fn RpcServer::group(Self, String) -> RpcGroup
pub fn RpcServer::has_method(Self, String) -> Bool
pub fn RpcServer::lookup(Self, String) -> ((Bytes) -> Bytes)?
pub fn RpcServer::methods(Self) -> Array[String]
pub fn RpcServer::new(RpcServerConf) -> Self
pub fn RpcServer::register(Self, @moonrpc.Method, (Bytes) -> Bytes) -> Unit
pub fn RpcServer::register_bidi_streaming(Self, @moonrpc.Method, () -> BidiStreamHandler) -> Unit
pub fn RpcServer::register_client_streaming(Self, @moonrpc.Method, (Array[Bytes]) -> Bytes) -> Unit
pub fn RpcServer::register_server_streaming(Self, @moonrpc.Method, (Bytes) -> Array[Bytes]) -> Unit
pub fn RpcServer::to_h2(Self) -> @moonrpc.H2Server
pub(all) struct RpcServerConf {
name : String
host : String
port : Int
timeout_ms : Int
} derive(Eq, @debug.Debug, @json.FromJson)
pub fn RpcServerConf::equal(Self, Self) -> Bool
pub fn RpcServerConf::from_json(String) -> Self raise ConfigError
pub fn RpcServerConf::from_yaml(String) -> Self raise ConfigError
pub fn RpcServerConf::new(name? : String, host? : String, port? : Int, timeout_ms? : Int) -> Self
pub fn RpcServerConf::not_equal(Self, Self) -> Bool
pub fn RpcServerConf::to_repr(Self) -> @debug.Repr
pub struct Server {
conf : ServiceConf
handler : async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
}
pub fn Server::describe(Self) -> String
pub fn Server::new(ServiceConf, @moonapi.App) -> Self
pub fn Server::to_asgi(Self) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
pub fn Server::use_(Self, (async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit) -> Self
pub struct ServerMetrics {
requests : CounterVec
latency : Histogram
}
pub fn ServerMetrics::latency(Self) -> Histogram
pub fn ServerMetrics::new() -> Self
pub fn ServerMetrics::requests(Self) -> CounterVec
pub fn ServerMetrics::to_exposition(Self) -> String
pub(all) struct ServiceConf {
name : String
host : String
port : Int
timeout_ms : Int
log_level : LogLevel
} derive(Eq, @json.FromJson)
pub fn ServiceConf::equal(Self, Self) -> Bool
pub fn ServiceConf::from_json(String) -> Self raise ConfigError
pub fn ServiceConf::from_yaml(String) -> Self raise ConfigError
pub fn ServiceConf::new(name? : String, host? : String, port? : Int, timeout_ms? : Int, log_level? : LogLevel) -> Self
pub fn ServiceConf::not_equal(Self, Self) -> Bool
pub struct Shedder {
threshold : Int64
usage : () -> Int64
}
pub fn Shedder::allow(Self) -> Bool
pub fn Shedder::new(Int64, usage? : () -> Int64) -> Self
pub fn Shedder::usage(Self) -> Int64
pub struct ShutdownCoordinator {
mut shutting_down : Bool
mut in_flight : Int
}
pub fn ShutdownCoordinator::begin_call(Self) -> Bool
pub fn ShutdownCoordinator::end_call(Self) -> Unit
pub fn ShutdownCoordinator::in_flight(Self) -> Int
pub fn ShutdownCoordinator::initiate_shutdown(Self) -> Unit
pub fn ShutdownCoordinator::is_drained(Self) -> Bool
pub fn ShutdownCoordinator::is_shutting_down(Self) -> Bool
pub fn ShutdownCoordinator::new() -> Self
pub(all) struct SignatureConf {
strict : Bool
expiry_ms : Int64
private_keys : Array[PrivateKeyConf]
} derive(Eq, @debug.Debug)
pub fn SignatureConf::equal(Self, Self) -> Bool
pub fn SignatureConf::new(strict? : Bool, expiry_ms? : Int64, private_keys? : Array[PrivateKeyConf]) -> Self
pub fn SignatureConf::not_equal(Self, Self) -> Bool
pub fn SignatureConf::to_repr(Self) -> @debug.Repr
pub struct TokenBucket {
bucket : @moonpool.Bucket
}
pub fn TokenBucket::allow(Self, Int64) -> Bool
pub fn TokenBucket::allow_n(Self, Double, Int64) -> Bool
pub fn TokenBucket::available(Self, Int64) -> Double
pub fn TokenBucket::new(Double, burst? : Double, now? : Int64) -> Self
pub(all) struct TraceContext {
trace_id : String
span_id : String
flags : Int
}
pub fn TraceContext::span_id(Self) -> String
pub fn TraceContext::to_traceparent(Self) -> String
pub fn TraceContext::trace_id(Self) -> String
pub struct WeightedRoundRobin {
scores : Map[String, Int]
}
pub fn WeightedRoundRobin::new() -> Self
pub fn WeightedRoundRobin::pick(Self, Array[Endpoint]) -> Endpoint?
pub struct Window {
size : Int
bucket_ms : Int64
buckets : Array[Bucket]
mut offset : Int
mut bucket_start : Int64
}
pub fn Window::add(Self, Outcome, Int64) -> Unit
pub fn Window::each(Self, Int64, (Bucket) -> Unit) -> Unit
pub fn Window::new(size? : Int, bucket_ms? : Int64, now? : Int64) -> Self
// Type aliases
pub type BidiStreamFactory = () -> BidiStreamHandler