pub struct ServiceEndpointsBuilder { /* private fields */ }
Expand description
Used for configuring the SDKs service URLs.
The default behavior, if you do not change any of these properties, is that the SDK will connect to the standard endpoints in the LaunchDarkly production service. There are several use cases for changing these properties:
-
You are using the LaunchDarkly Relay Proxy. In this case, use ServiceEndpointsBuilder::relay_proxy with the URL of the relay proxy instance.
-
You are connecting to a private instance of LaunchDarkly, rather than the standard production services. In this case, there will be custom base URIs for each service. You need to configure each endpoint with ServiceEndpointsBuilder::polling_base_url, ServiceEndpointsBuilder::streaming_base_url, and ServiceEndpointsBuilder::events_base_url.
-
You are connecting to a test fixture that simulates the service endpoints. In this case, you may set the base URLs to whatever you want, although the SDK will still set the URL paths to the expected paths for LaunchDarkly services.
Examples
Configure for a Relay Proxy instance.
ConfigBuilder::new("sdk-key").service_endpoints(ServiceEndpointsBuilder::new()
.relay_proxy("http://my-relay-hostname:8080"));
Configure for a private LaunchDarkly instance.
ConfigBuilder::new("sdk-key").service_endpoints(ServiceEndpointsBuilder::new()
.polling_base_url("https://sdk.my-private-instance.com")
.streaming_base_url("https://stream.my-private-instance.com")
.events_base_url("https://events.my-private-instance.com"));
Implementations
Create a new instance of ServiceEndpointsBuilder with no URLs specified.
Sets a custom base URL for the polling service.
Sets a custom base URL for the streaming service.
Sets a custom base URI for the events service.
Specifies a single base URL for a Relay Proxy instance.
Called internally by the SDK to create a configuration instance. Applications do not need to call this method.
Errors
When using custom endpoints it is important that all of the URLs are set. If some URLs are set, but others are not, then this will return an error. If no URLs are set, then the default values will be used. This prevents a combination of custom and default values from being used.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ServiceEndpointsBuilder
impl Send for ServiceEndpointsBuilder
impl Sync for ServiceEndpointsBuilder
impl Unpin for ServiceEndpointsBuilder
impl UnwindSafe for ServiceEndpointsBuilder
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more