Help us shape the future of Go! Take the 2026 Go Developer Survey

launchdarkly

package
v0.4.121 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const WireGuardTokenModeFlag = "wireguard-token-mode"

WireGuardTokenModeFlag is the boolean flag that, when on for a user, makes the agent build that user's WireGuard tunnels through the token gateway regardless of the local wire_guard_token_mode config.

Variables

This section is empty.

Functions

func NewContextWithClient

func NewContextWithClient(ctx context.Context, ldClient *Client) context.Context

Types

type Client

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

func ClientFromContext

func ClientFromContext(ctx context.Context) *Client

func NewClient

func NewClient(ctx context.Context, userInfo UserInfo) (*Client, error)

func NewServiceClient added in v0.3.122

func NewServiceClient() (*Client, error)

func NewUserClient added in v0.4.118

func NewUserClient(userID int) *Client

NewUserClient returns a client that evaluates flags for the user with the given numeric id and no organization. Unlike NewClient it neither fetches anything nor starts the background poller: callers Refresh it whenever they want a current value, which suits long-lived processes like the agent that re-evaluate at well-defined moments.

func (*Client) GetCompressionStrength added in v0.3.188

func (ldClient *Client) GetCompressionStrength() any

func (*Client) GetFeatureFlagValue

func (ldClient *Client) GetFeatureFlagValue(key string, defaultValue any) any

func (*Client) ManagedBuilderEnabled added in v0.3.149

func (ldClient *Client) ManagedBuilderEnabled() bool

func (*Client) ManagedPostgresEnabled added in v0.3.122

func (ldClient *Client) ManagedPostgresEnabled() bool

func (*Client) Refresh added in v0.4.118

func (ldClient *Client) Refresh(ctx context.Context) error

Refresh re-fetches the flags from LaunchDarkly. Until a Refresh succeeds every flag reads as its default.

func (*Client) UnmanagedPostgresEnabled added in v0.3.122

func (ldClient *Client) UnmanagedPostgresEnabled() bool

func (*Client) UseZstdEnabled added in v0.3.188

func (ldClient *Client) UseZstdEnabled() bool

func (*Client) WireGuardTokenModeEnabled added in v0.4.118

func (ldClient *Client) WireGuardTokenModeEnabled() bool

WireGuardTokenModeEnabled reports whether WireGuardTokenModeFlag is on. Anything but a boolean true (unset, false, a mistyped flag) counts as off.

type FeatureFlag

type FeatureFlag struct {
	FlagVersion int  `json:"flagVersion"`
	TrackEvents bool `json:"trackEvents"`
	Value       any  `json:"value"`
	Version     int  `json:"version"`
	Variation   int  `json:"variation"`
}

type UserInfo

type UserInfo struct {
	OrganizationID string
	UserID         int
}

Jump to

Keyboard shortcuts

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