xrpc
library
Functions
-
procedure<T>(NSID methodId, {Protocol protocol = Protocol.https, String? service, Map<String, dynamic>? parameters, dynamic body, Duration timeout = const Duration(seconds: 10), ResponseDataBuilder<T>? to, PostClient? postClient})
→ Future<XRPCResponse<T>>
-
Performs POST communication to the ATP server.
-
query<T>(NSID methodId, {Protocol protocol = Protocol.https, String? service, Map<String, dynamic>? parameters, Duration timeout = const Duration(seconds: 10), ResponseDataBuilder<T>? to, ResponseDataAdaptor? adaptor, GetClient? getClient})
→ Future<XRPCResponse<T>>
-
Performs GET communication to the ATP server.
-
subscribe<T>(NSID methodId, {String? service, Map<String, dynamic>? parameters, ResponseDataBuilder<T>? to, ResponseDataAdaptor? adaptor})
→ XRPCResponse<Subscription<T>>
-
Subscribes endpoints associated with
methodId
in WebSocket.
Typedefs
-
GetClient
= Future<Response> Function(Uri url, {})
-
A function type abstracted from
http.get
, mainly for mocking
at test time.
-
-
PostClient
= Future<Response> Function(Uri url, {Object? body, Encoding? encoding, })
-
A function type abstracted from
http.post
, mainly for mocking
at test time.
-
ResponseDataAdaptor
= Map<String, dynamic> Function(dynamic data)
-
Function to convert response data to an specific structure.
-
ResponseDataBuilder<T>
= T Function(Map<String, Object?> json)
-
A function type that expresses the function of converting response body
to model objects.