feat(llc): Deprecate location in favor of edge server.
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -1,32 +1,20 @@
|
||||
part of 'stream_http_client.dart';
|
||||
|
||||
const _defaultBaseURL = 'https://chat-us-east-1.stream-io-api.com';
|
||||
const _defaultBaseURL = 'https://chat.stream-io-api.com';
|
||||
|
||||
/// Client options to modify [StreamHttpClient]
|
||||
class StreamHttpClientOptions {
|
||||
/// Instantiates a new [StreamHttpClientOptions]
|
||||
const StreamHttpClientOptions({
|
||||
String? baseUrl,
|
||||
this.location,
|
||||
this.connectTimeout = const Duration(seconds: 6),
|
||||
this.receiveTimeout = const Duration(seconds: 6),
|
||||
this.queryParameters = const {},
|
||||
this.headers = const {},
|
||||
}) : _baseUrl = baseUrl ?? _defaultBaseURL;
|
||||
|
||||
final String _baseUrl;
|
||||
}) : baseUrl = baseUrl ?? _defaultBaseURL;
|
||||
|
||||
/// base url to use with client.
|
||||
String get baseUrl {
|
||||
if (location == null) return _baseUrl;
|
||||
const serviceName = 'chat';
|
||||
final locationName = location!.name;
|
||||
const baseDomainName = 'stream-io-api.com';
|
||||
return 'https://$serviceName-proxy-$locationName.$baseDomainName';
|
||||
}
|
||||
|
||||
/// data center to use with client
|
||||
final Location? location;
|
||||
final String baseUrl;
|
||||
|
||||
/// connect timeout, default to 6s
|
||||
final Duration connectTimeout;
|
||||
|
||||
Reference in New Issue
Block a user