options

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SdkKeyEnvVar #nosec G101 -- This is just the env var name
	SdkKeyEnvVar       = "REFORGE_BACKEND_SDK_KEY"
	LegacyApiKeyEnvVar = "PREFAB_API_KEY"
	APIURLVar          = "REFORGE_API_URL"
)

Variables

View Source
var ContextTelemetryModes = struct {
	PeriodicExample ContextTelemetryMode
	Shapes          ContextTelemetryMode
	None            ContextTelemetryMode
}{
	PeriodicExample: "periodic_example",
	Shapes:          "shapes",
	None:            "",
}

Functions

func GetDefaultAPIURLs

func GetDefaultAPIURLs() []string

Types

type ConfigSource

type ConfigSource struct {
	Store   StoreType
	Raw     string
	Path    string
	Default bool
}

func GetDefaultConfigSources

func GetDefaultConfigSources() []ConfigSource

func ParseConfigSource

func ParseConfigSource(rawSource string) (ConfigSource, error)

type ContextTelemetryMode

type ContextTelemetryMode string

type OnInitializationFailure

type OnInitializationFailure int
const (
	ReturnError    OnInitializationFailure = iota // ReturnError = 0
	ReturnNilMatch                                // ReturnNilMatch = 1
)

type Options

type Options struct {
	GlobalContext                *contexts.ContextSet
	Configs                      map[string]interface{}
	SdkKey                       string
	APIURLs                      []string
	Sources                      []ConfigSource
	CustomStores                 []interface{} // ConfigStoreGetter implementations
	CustomEnvLookup              interface{}   // EnvLookup implementation
	EnvironmentNames             []string
	ProjectEnvID                 int64
	InitializationTimeoutSeconds float64
	OnInitializationFailure      OnInitializationFailure
	ContextTelemetryMode         ContextTelemetryMode
	CollectEvaluationSummaries   bool
	TelemetrySyncInterval        time.Duration
	TelemetryHost                string
	InstanceHash                 string
	LoggerKey                    string
}

func GetDefaultOptions

func GetDefaultOptions() Options

func (*Options) PrefabAPIURLEnvVarOrSetting

func (o *Options) PrefabAPIURLEnvVarOrSetting() ([]string, error)

func (*Options) SdkKeySettingOrEnvVar

func (o *Options) SdkKeySettingOrEnvVar() (string, error)

func (*Options) TelemetryEnabled

func (o *Options) TelemetryEnabled() bool

type StoreType

type StoreType string
const (
	APIStore StoreType = "API"
	DataFile StoreType = "DataFile"
	Memory   StoreType = "Memory"

	MemoryStoreKey = "memory://configs"
)

Jump to

Keyboard shortcuts

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