relay

package
v7.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Overview

Package relay contains the Relay application component that combines all of the internal components and implements HTTP endpoints.

This package is not in internal/ so that the exported Relay type can be used by external code to embed Relay functionality into a customized application. See docs/in-app.md.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientFactoryFunc

type ClientFactoryFunc func(sdkKey config.SDKKey, config ld.Config) (*ld.LDClient, error)

ClientFactoryFunc is a function that can be used with NewRelay to specify custom behavior when Relay needs to create a Go SDK client instance.

type Relay

type Relay struct {
	http.Handler
	// contains filtered or unexported fields
}

Relay represents the overall Relay Proxy application.

It can also be referenced externally in order to embed Relay Proxy functionality into a customized application; see docs/in-app.md.

This type deliberately exports no methods other than ServeHTTP and Close. Everything else is an implementation detail which is subject to change.

func NewRelay

func NewRelay(c config.Config, loggers ldlog.Loggers, clientFactory ClientFactoryFunc) (*Relay, error)

NewRelay creates a new Relay given a configuration and a method to create a client.

If any metrics exporters are enabled in c.MetricsConfig, it also registers those in OpenCensus.

The clientFactory parameter can be nil and is only needed if you want to customize how Relay creates the Go SDK client instance.

func (*Relay) Close

func (r *Relay) Close() error

Close shuts down components created by the Relay Proxy.

This includes dropping all connections to the LaunchDarkly services and to SDK clients, closing database connections if any, and stopping all Relay port listeners, goroutines, and OpenCensus exporters.

Directories

Path Synopsis
Package version exists only to hold the current version string for Relay, which is updated by the release script.
Package version exists only to hold the current version string for Relay, which is updated by the release script.

Jump to

Keyboard shortcuts

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