endpoints

package
v6.0.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package endpoints contains internal constants and functions for computing service endpoint URIs.

Index

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 AddPath

func AddPath(baseURI string, path string) string

AddPath concatenates a subpath to a URL in a way that will not cause a double slash.

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 // don't really need doc comments here
	PollingService   ServiceType = iota
	EventsService    ServiceType = iota
)

func (ServiceType) String

func (s ServiceType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL