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

featureflags

package
v1.17.0 Latest Latest
Warning

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

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

Documentation

Overview

Package featureflags shares connector-service flags without requiring telemetry or a session.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache shares values per workspace (normalized host when workspace ID is unavailable). Acquire a reference before reading, and Release it when the consumer closes.

func GetCache

func GetCache() *Cache

GetCache returns the process-wide cache shared by driver consumers.

func (*Cache) Acquire

func (c *Cache) Acquire(host string, workspaceID ...string) *featureFlagContext

Acquire increments the reference count without making a request.

func (*Cache) GetBool

func (c *Cache) GetBool(ctx context.Context, request Request, name string) (bool, error)

GetBool defaults to false for absent/null flags; malformed values return false and an error.

func (*Cache) GetDouble

func (c *Cache) GetDouble(ctx context.Context, request Request, name string) (float64, error)

func (*Cache) GetInt32

func (c *Cache) GetInt32(ctx context.Context, request Request, name string) (int32, error)

func (*Cache) GetInt64

func (c *Cache) GetInt64(ctx context.Context, request Request, name string) (int64, error)

func (*Cache) GetString

func (c *Cache) GetString(ctx context.Context, request Request, name string) (string, error)

func (*Cache) GetStringList

func (c *Cache) GetStringList(ctx context.Context, request Request, name string) ([]string, error)

func (*Cache) Release

func (c *Cache) Release(host string, workspaceID ...string)

Release removes the entry when its last consumer closes.

type Request

type Request struct {
	Host, WorkspaceID, DriverVersion, UserAgent string
	HTTPClient                                  *http.Client
}

Request provides caller-owned authenticated transport, usable before opening a session. Cache entries retain only values, never credentials or HTTP clients.

Jump to

Keyboard shortcuts

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