legacy

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package legacy holds what the Semaphore rename needs to keep the names of GO Feature Flag working: the canonical Semaphore name is always read first and the legacy name is accepted as an alias. Using a legacy name logs one warning per Warner and per kind of name, never one per request.

Index

Constants

View Source
const (
	KindConfigFile        = "config-file"
	KindFlagFile          = "flag-file"
	KindEnvPrefix         = "env-prefix"
	KindEvaluationContext = "evaluation-context-key"
)

Kinds of legacy names, one warning is logged per kind.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogFunc

type LogFunc func(kind, message string)

LogFunc receives the warning for one kind of legacy name.

type Warner

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

Warner logs one warning per kind of legacy name. Whoever reads names that may be legacy owns a Warner (the relay's configuration loader, the evaluation Service of a client, a CLI command), so that two of them never share the "already warned" state.

func NewWarner

func NewWarner(logf LogFunc) *Warner

NewWarner creates a Warner that sends its warnings to logf (they are dropped when logf is nil).

func (*Warner) Warn

func (w *Warner) Warn(kind, message string)

Warn logs message the first time it is called for kind, and does nothing afterwards. A nil Warner does nothing.

Jump to

Keyboard shortcuts

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