Documentation ¶
Overview ¶
Package endpoints contains internal constants and functions for computing service endpoint URIs.
Index ¶
- Constants
- func AddPath(baseURI string, path string) string
- func DefaultBaseURI(serviceType ServiceType) string
- func IsCustom(serviceEndpoints interfaces.ServiceEndpoints, serviceType ServiceType, ...) bool
- func SelectBaseURI(serviceEndpoints interfaces.ServiceEndpoints, serviceType ServiceType, ...) string
- type ServiceType
Constants ¶
View Source
const ( // DefaultStreamingBaseURI is the default base URI of the streaming service. DefaultStreamingBaseURI = "https://stream.launchdarkly.com/" // DefaultPollingBaseURI is the default base URI of the polling service. DefaultPollingBaseURI = "https://sdk.launchdarkly.com/" // DefaultEventsBaseURI is the default base URI of the events service. DefaultEventsBaseURI = "https://events.launchdarkly.com/" // StreamingRequestPath is the URL path for the server-side streaming endpoint. StreamingRequestPath = "/all" // PollingRequestPath is the URL path for the server-side polling endpoint. PollingRequestPath = "/sdk/latest-all" )
Variables ¶
This section is empty.
Functions ¶
func DefaultBaseURI ¶
func DefaultBaseURI(serviceType ServiceType) string
DefaultBaseURI returns the default base URI for the given kind of endpoint.
func IsCustom ¶
func IsCustom(serviceEndpoints interfaces.ServiceEndpoints, serviceType ServiceType, overrideValue string) bool
IsCustom returns true if the service endpoint has been overridden with a non-default value.
func SelectBaseURI ¶
func SelectBaseURI( serviceEndpoints interfaces.ServiceEndpoints, serviceType ServiceType, overrideValue string, loggers ldlog.Loggers, ) string
SelectBaseURI is a helper for getting either a custom or a default URI for the given kind of endpoint.
Types ¶
type ServiceType ¶
type ServiceType int
ServiceType is used internally to denote which endpoint a URI is for.
const ( StreamingService ServiceType = iota //nolint:revive // internal constant PollingService ServiceType = iota //nolint:revive // internal constant EventsService ServiceType = iota //nolint:revive // internal constant )
func (ServiceType) String ¶
func (s ServiceType) String() string
Click to show internal directories.
Click to hide internal directories.