...

Package internal

import "github.com/launchdarkly/go-server-sdk/v6/internal"
Overview
Index
Subdirectories

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.

Constants

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

const SDKVersion = "6.0.3"

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.

type AtomicBoolean

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.)

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

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

Broadcaster is our generalized implementation of broadcasters.

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

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

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

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

Subdirectories

Name Synopsis
..