internal

package
v6.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package internal contains SDK implementation details that are shared between packages, but are not exposed to application code. The datasource and datastore subpackages contain implementation components specific to their areas of functionality.

Index

Constants

View Source
const SDKVersion = "6.1.0"

SDKVersion is the current version string of the SDK. This is updated by our release scripts.

Variables

This section is empty.

Functions

func LogErrorNilPointerMethod

func LogErrorNilPointerMethod(typeName string)

LogErrorNilPointerMethod prints a message to os.Stderr to indicate that the application tried to call a method on a nil pointer receiver.

func NewFlagTrackerImpl

func NewFlagTrackerImpl(
	broadcaster *Broadcaster[interfaces.FlagChangeEvent],
	evaluateFn func(flagKey string, context ldcontext.Context, defaultValue ldvalue.Value) ldvalue.Value,
) interfaces.FlagTracker

NewFlagTrackerImpl creates the internal implementation of FlagTracker.

Types

type AtomicBoolean

type AtomicBoolean struct {
	// contains filtered or unexported fields
}

AtomicBoolean is a simple atomic boolean type based on sync/atomic. Since sync/atomic supports only integer types, the implementation uses an int32. (Note: we should be able to get rid of this once our minimum Go version becomes 1.19 or higher.)

func (*AtomicBoolean) Get

func (a *AtomicBoolean) Get() bool

Get returns the current value.

func (*AtomicBoolean) GetAndSet

func (a *AtomicBoolean) GetAndSet(value bool) bool

GetAndSet atomically updates the value and returns the previous value.

func (*AtomicBoolean) Set

func (a *AtomicBoolean) Set(value bool)

Set updates the value.

type Broadcaster

type Broadcaster[V any] struct {
	// contains filtered or unexported fields
}

Broadcaster is our generalized implementation of broadcasters.

func NewBroadcaster

func NewBroadcaster[V any]() *Broadcaster[V]

NewBroadcaster creates a Broadcaster that operates on the specified value type.

func (*Broadcaster[V]) AddListener

func (b *Broadcaster[V]) AddListener() <-chan V

AddListener adds a subscriber and returns a channel for it to receive values.

func (*Broadcaster[V]) Broadcast

func (b *Broadcaster[V]) Broadcast(value V)

Broadcast broadcasts a value to all current subscribers.

func (*Broadcaster[V]) Close

func (b *Broadcaster[V]) Close()

Close closes all current subscriber channels.

func (*Broadcaster[V]) HasListeners

func (b *Broadcaster[V]) HasListeners() bool

HasListeners returns true if there are any current subscribers.

func (*Broadcaster[V]) RemoveListener

func (b *Broadcaster[V]) RemoveListener(ch <-chan V)

RemoveListener removes a subscriber. The parameter is the same channel that was returned by AddListener.

type ClientContextImpl

type ClientContextImpl struct {
	subsystems.BasicClientContext
	// Used internally to share a diagnosticsManager instance between components.
	DiagnosticsManager *ldevents.DiagnosticsManager
}

ClientContextImpl is the SDK's standard implementation of interfaces.ClientContext.

Directories

Path Synopsis
Package bigsegments is an internal package containing implementation details for the SDK's Big Segment functionality, not including the part that is in go-server-sdk-evaluation.
Package bigsegments is an internal package containing implementation details for the SDK's Big Segment functionality, not including the part that is in go-server-sdk-evaluation.
Package datakinds contains the implementations of ldstoretypes.DataKind for flags and segments.
Package datakinds contains the implementations of ldstoretypes.DataKind for flags and segments.
Package datasource is an internal package containing implementation types for the SDK's data source implementations (streaming, polling, etc.) and related functionality.
Package datasource is an internal package containing implementation types for the SDK's data source implementations (streaming, polling, etc.) and related functionality.
Package datastore is an internal package containing implementation types for the SDK's data store implementations (in-memory vs.
Package datastore is an internal package containing implementation types for the SDK's data store implementations (in-memory vs.
Package endpoints contains internal constants and functions for computing service endpoint URIs.
Package endpoints contains internal constants and functions for computing service endpoint URIs.
Package sharedtest contains types and functions used by SDK unit tests in multiple packages.
Package sharedtest contains types and functions used by SDK unit tests in multiple packages.
mocks
Package mocks contains mocks/spies used within SDK unit tests.
Package mocks contains mocks/spies used within SDK unit tests.

Jump to

Keyboard shortcuts

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