Documentation
¶
Overview ¶
Package ffclient aids adding instrumentation to have feature flags in your app without any backend server.
Summary ¶
This package and its subpackages contain bits of code to have an easy feature flag solution with no complex installation to do on your infrastructure and without using 3rd party vendor for this.
The ffclient package provides the entry point - initialization and the basic method to get your flags value.
Before using the module you need to initialize it this way:
import (
ffclient "github.com/blackbirdworks/semaphore"
"github.com/blackbirdworks/semaphore/retriever/httpretriever"
...
)
func main() {
client, err := ffclient.New(&ffclient.Config{
PollingInterval: 3 * time.Second,
Retriever: &httpretriever.Retriever{
URL: "https://code.gofeatureflag.org/blob/main/testdata/flag-config.yaml",
},
})
defer client.Close()
...
This example will load a file from an HTTP endpoint and will refresh the flags every 3 seconds.
Now you can evaluate your flags anywhere in your code.
...
evaluationContext := ffcontext.NewEvaluationContext("user-unique-key")
hasFlag, _ := client.BoolVariation("test-flag", evaluationContext, false)
if hasFlag {
//flag "test-flag" is true for the user
} else {
// flag "test-flag" is false for the user
}
...
}
Index ¶
- Constants
- type Config
- type DataExporter
- type ExporterEventType
- type GoFeatureFlag
- func (g *GoFeatureFlag) AllFlagsState(evaluationCtx ffcontext.Context) flagstate.AllFlags
- func (g *GoFeatureFlag) BoolVariation(flagKey string, ctx ffcontext.Context, defaultValue bool) (bool, error)
- func (g *GoFeatureFlag) BoolVariationDetails(flagKey string, ctx ffcontext.Context, defaultValue bool) (model.VariationResult[bool], error)
- func (g *GoFeatureFlag) Close()
- func (g *GoFeatureFlag) CloseWithContext(ctx context.Context)
- func (g *GoFeatureFlag) CollectEventData(event *exporter.FeatureEvent)
- func (g *GoFeatureFlag) CollectTrackingEventData(event *exporter.TrackingEvent)
- func (g *GoFeatureFlag) DroppedEvents() int64
- func (g *GoFeatureFlag) EvaluationService() *flagdef.Service
- func (g *GoFeatureFlag) Float64Variation(flagKey string, ctx ffcontext.Context, defaultValue float64) (float64, error)
- func (g *GoFeatureFlag) Float64VariationDetails(flagKey string, ctx ffcontext.Context, defaultValue float64) (model.VariationResult[float64], error)
- func (g *GoFeatureFlag) ForceRefresh() bool
- func (g *GoFeatureFlag) ForceRefreshWithContext(ctx context.Context) bool
- func (g *GoFeatureFlag) GetCacheRefreshDate() time.Time
- func (g *GoFeatureFlag) GetEvaluationContextEnrichment() map[string]any
- func (g *GoFeatureFlag) GetFlagStates(evaluationCtx ffcontext.Context, flagsToEvaluate []string) flagstate.AllFlags
- func (g *GoFeatureFlag) GetFlagsFromCache() (map[string]flagdef.Flag, error)
- func (g *GoFeatureFlag) GetFlagsFromCacheReadOnly() (map[string]flagdef.Flag, error)
- func (g *GoFeatureFlag) GetFlagsFromCacheWithContext(ctx context.Context) (map[string]flagdef.Flag, error)
- func (g *GoFeatureFlag) GetPollingInterval() int64
- func (g *GoFeatureFlag) IntVariation(flagKey string, ctx ffcontext.Context, defaultValue int) (int, error)
- func (g *GoFeatureFlag) IntVariationDetails(flagKey string, ctx ffcontext.Context, defaultValue int) (model.VariationResult[int], error)
- func (g *GoFeatureFlag) IsOffline() bool
- func (g *GoFeatureFlag) JSONArrayVariation(flagKey string, ctx ffcontext.Context, defaultValue []any) ([]any, error)
- func (g *GoFeatureFlag) JSONArrayVariationDetails(flagKey string, ctx ffcontext.Context, defaultValue []any) (model.VariationResult[[]any], error)
- func (g *GoFeatureFlag) JSONVariation(flagKey string, ctx ffcontext.Context, defaultValue map[string]any) (map[string]any, error)
- func (g *GoFeatureFlag) JSONVariationDetails(flagKey string, ctx ffcontext.Context, defaultValue map[string]any) (model.VariationResult[map[string]any], error)
- func (g *GoFeatureFlag) RawVariation(flagKey string, ctx ffcontext.Context, sdkDefaultValue any) (model.RawVarResult, error)
- func (g *GoFeatureFlag) SetOffline(control bool)
- func (g *GoFeatureFlag) SetOfflineWithContext(ctx context.Context, control bool)
- func (g *GoFeatureFlag) StringVariation(flagKey string, ctx ffcontext.Context, defaultValue string) (string, error)
- func (g *GoFeatureFlag) StringVariationDetails(flagKey string, ctx ffcontext.Context, defaultValue string) (model.VariationResult[string], error)
- func (g *GoFeatureFlag) Track(trackingEventName string, ctx ffcontext.EvaluationContext, ...)
Constants ¶
const DefaultEventQueueSize = 65536
DefaultEventQueueSize is the default value of Config.EventQueueSize.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Retriever is the component in charge to retrieve your flag file
Retriever retriever.Retriever
// LeveledLogger (optional) logger use by the library
// Default: No log
LeveledLogger *slog.Logger
// Name (optional) is the name of the flagset, this is used to identify the flagset inside the
// Semaphore instance. This allow to identify the flagset.
// Default: nil
Name *string
// EvaluationContextEnrichment (optional) will be merged with the evaluation context sent during the evaluation.
// It is useful to add common attributes to all the evaluation, such as a server version, environment, ...
//
// All those fields will be included in the custom attributes of the evaluation context,
// if in the evaluation context you have a field with the same name, it will override the common one.
// Default: nil
EvaluationContextEnrichment map[string]any
// Segments (optional) defines the named segments that the targeting rules can use,
// targetingKey in segment("beta-users"). When Segments is set, a rule that uses a segment it does not define is
// accepted with a warning, and the segment matches nobody. When Segments is nil, no warning is logged and
// SegmentProvider decides every segment term.
// Default: nil
Segments *segment.Catalog
// SegmentProvider (optional) answers the membership lookups of the segment terms of the rules. Without one,
// the lookups are not answered: a segment is not a member by default (a rule that matches its members does not
// match), unless its definition says OnError: unknown and the rule says onError: match.
// Default: nil
SegmentProvider segment.Provider
// PersistentFlagConfigurationFile (optional) if set Semaphore will store flags configuration in this file
// to be able to serve the flags even if none of the retrievers is available during starting time.
//
// By default, the flag configuration is not persisted and stays on the retriever system. By setting a file here,
// you ensure that Semaphore will always start with a configuration but which can be out-dated.
PersistentFlagConfigurationFile string
// FileFormat (optional) is the format of the file to retrieve (available YAML, TOML and JSON)
// Default: YAML
FileFormat string
// Environment (optional) can be checked in feature flag rules
// Default: ""
Environment string
// Notifiers (optional) is the list of notifiers called when a flag change
Notifiers []notifier.Notifier
// DataExporters (optional) are configurations where we store how to output the flags variations results
// Multiple exporters can be used to send data to multiple destinations in parallel without interference.
DataExporters []DataExporter
// Retrievers is the list of components in charge to retrieving your flag files.
// We are dealing with config files in order, if you have the same flag name in multiple files it will be override
// based of the order of the retrievers in the slice.
//
// Note: If both Retriever and Retrievers are set, we will start by calling the Retriever and,
// after we will use the order of Retrievers.
Retrievers []retriever.Retriever
// DataExporter (optional) is the configuration where we store how we should output the flags variations results
DataExporter DataExporter
// PollingInterval (optional) Poll every X time
// The minimum possible is 1 second
// Default: 60 seconds
PollingInterval time.Duration
// EventQueueSize (optional) is the size of the queue between the flag evaluations and the
// data exporters. The evaluations never wait for the exporters: when the queue is full
// (exporters not keeping up) the event is dropped and counted (GoFeatureFlag.DroppedEvents).
// Default: DefaultEventQueueSize.
EventQueueSize int
// ExporterCleanQueueInterval (optional) is the duration between each cleaning of the queue by the thread in charge
// of removing the old events.
// Default: 1 minute
ExporterCleanQueueInterval time.Duration
// StartWithRetrieverError (optional) If true, the SDK will start even if we did not get any flags from the retriever.
// It will serve only default values until all the retrievers returns the flags.
// The init method will not return any error if the flag file is unreachable.
// Default: false
StartWithRetrieverError bool
// Offline (optional) If true, the SDK will not try to retrieve the flag file and will not export any data.
// No notification will be sent neither.
// Default: false
Offline bool
// DisableNotifierOnInit (optional) set to true if you do not want to call any notifier
// when the flags are loaded.
// This is useful if you do not want a Slack/Webhook notification saying that
// the flags have been added every time you start the application.
// Default is set to false for backward compatibility.
// Default: false
DisableNotifierOnInit bool
// EnablePollingJitter (optional) set to true if you want to avoid having true periodicity when
// retrieving your flags. It is useful to avoid having spike on your flag configuration storage
// in case your application is starting multiple instance at the same time.
// We ensure a deviation that is maximum + or - 10% of your polling interval.
// Default: false
EnablePollingJitter bool
// contains filtered or unexported fields
}
Config is the configuration of semaphore. You should also have a retriever to specify where to read the flags file.
func (*Config) GetDataExporters ¶
func (c *Config) GetDataExporters() []DataExporter
GetDataExporters returns the list of DataExporter configured.
func (*Config) GetRetrievers ¶
GetRetrievers returns a retriever.Retriever configure with the retriever available in the config.
func (*Config) Initialize ¶
func (c *Config) Initialize()
Initialize assigns defaults to the configuration.
func (*Config) SetOffline ¶
SetOffline set Semaphore in offline mode.
type DataExporter ¶
type DataExporter struct {
// Exporter is the configuration of your exporter.
// You can see all available exporter in the exporter package.
Exporter exporter.CommonExporter
// ExporterEventType is the type of event the exporter is expecting.
// The default type if not set is FeatureEventExporter.
ExporterEventType ExporterEventType
// FlushInterval is the interval we are waiting to export the data.
// example: if you set your FlushInterval to 1 minutes, we will send
// the data every minute unless we reach the max event in cache before.
FlushInterval time.Duration
// MaxEventInMemory is the maximum number of event you keep in the cache
// before sending the data to the Exporter.
// We will send the data when the MaxEventInMemory is reach or if we have
// waited the FlushInterval.
MaxEventInMemory int64
// MaxQueuedEvents is the hard limit of events kept in memory while they wait to be exported.
// When it is reached (the exporter is slow or failing), new events are dropped and counted
// (see GoFeatureFlag.DroppedEvents) instead of growing the memory without limit.
// Default: max(4 x MaxEventInMemory, 50000).
MaxQueuedEvents int64
}
DataExporter is the configuration of your export target.
type ExporterEventType ¶
type ExporterEventType = string
ExporterEventType is the type of event sent by an exporter.
const ( // TrackingEventExporter is the event type of tracking events sent to the exporters. TrackingEventExporter ExporterEventType = "tracking" // FeatureEventExporter is the event type of feature events sent to the exporters. FeatureEventExporter ExporterEventType = "feature" )
type GoFeatureFlag ¶
type GoFeatureFlag struct {
// contains filtered or unexported fields
}
GoFeatureFlag is the main object of the library it contains the cache, the config, the updater and the exporter.
func New ¶
func New(config *Config) (*GoFeatureFlag, error)
New creates a new semaphore instances that retrieve the config from a YAML file and return everything you need to manage your flags.
func NewWithContext ¶ added in v0.2.0
func NewWithContext(ctx context.Context, given *Config) (*GoFeatureFlag, error)
NewWithContext creates a new semaphore instance using ctx to initialize the configured retrievers.
The configuration is copied: defaults are set on the copy, the given Config is left as it is.
func (*GoFeatureFlag) AllFlagsState ¶
func (g *GoFeatureFlag) AllFlagsState(evaluationCtx ffcontext.Context) flagstate.AllFlags
AllFlagsState return a flagstate.AllFlags that contains all the flags for a specific user.
func (*GoFeatureFlag) BoolVariation ¶
func (g *GoFeatureFlag) BoolVariation( flagKey string, ctx ffcontext.Context, defaultValue bool, ) (bool, error)
BoolVariation return the value of the flag in boolean. An error is return if you don't have init the library before calling the function. If the key does not exist we return the default value. Note: Use this function only if you are using multiple semaphore instances.
func (*GoFeatureFlag) BoolVariationDetails ¶
func (g *GoFeatureFlag) BoolVariationDetails( flagKey string, ctx ffcontext.Context, defaultValue bool, ) (model.VariationResult[bool], error)
BoolVariationDetails return the details of the evaluation for boolean flag. An error is return if you don't have init the library before calling the function. If the key does not exist we return the default value. Note: Use this function only if you are using multiple semaphore instances.
func (*GoFeatureFlag) Close ¶
func (g *GoFeatureFlag) Close()
Close wait until thread are done. The events of the evaluations that finish while Close runs are exported by its final flush; an evaluation that finishes after Close has returned has nowhere to send its event.
func (*GoFeatureFlag) CloseWithContext ¶ added in v0.2.0
func (g *GoFeatureFlag) CloseWithContext(ctx context.Context)
CloseWithContext waits until background workers are done, passing ctx to retriever shutdown. The events of the evaluations that finish while CloseWithContext runs are exported by its final flush; an evaluation that finishes after CloseWithContext has returned has nowhere to send its event.
func (*GoFeatureFlag) CollectEventData ¶
func (g *GoFeatureFlag) CollectEventData(event *exporter.FeatureEvent)
CollectEventData is collecting events and sending them to the data exporter to be stored.
func (*GoFeatureFlag) CollectTrackingEventData ¶
func (g *GoFeatureFlag) CollectTrackingEventData(event *exporter.TrackingEvent)
CollectTrackingEventData is collecting tracking events and sending them to the data exporter to be stored.
func (*GoFeatureFlag) DroppedEvents ¶
func (g *GoFeatureFlag) DroppedEvents() int64
DroppedEvents returns the number of events that have been dropped since the start because the exporters were not able to keep up (queue between the evaluations and the exporters full, or exporter queue at its MaxQueuedEvents limit). It is 0 in a healthy setup.
func (*GoFeatureFlag) EvaluationService ¶
func (g *GoFeatureFlag) EvaluationService() *flagdef.Service
EvaluationService returns the evaluation service of the client: the owner of the caches that evaluating (and validating) its flags uses. Pass it in flag.Context.Service when you evaluate the flags that GetFlagsFromCache returns. It is never nil.
func (*GoFeatureFlag) Float64Variation ¶
func (g *GoFeatureFlag) Float64Variation( flagKey string, ctx ffcontext.Context, defaultValue float64, ) (float64, error)
Float64Variation return the value of the flag in float64. An error is return if you don't have init the library before calling the function. If the key does not exist we return the default value. Note: Use this function only if you are using multiple semaphore instances.
func (*GoFeatureFlag) Float64VariationDetails ¶
func (g *GoFeatureFlag) Float64VariationDetails( flagKey string, ctx ffcontext.Context, defaultValue float64, ) (model.VariationResult[float64], error)
Float64VariationDetails return the details of the evaluation for float64 flag. An error is return if you don't have init the library before calling the function. If the key does not exist we return the default value. Note: Use this function only if you are using multiple semaphore instances.
func (*GoFeatureFlag) ForceRefresh ¶
func (g *GoFeatureFlag) ForceRefresh() bool
ForceRefresh is a function that forces to call the retrievers and refresh the configuration of flags. This function can be called explicitly to refresh the flags if you know that a change has been made in the configuration.
func (*GoFeatureFlag) ForceRefreshWithContext ¶
func (g *GoFeatureFlag) ForceRefreshWithContext(ctx context.Context) bool
ForceRefreshWithContext is a function that forces to call the retrievers and refresh the configuration of flags. This function can be called explicitly to refresh the flags if you know that a change has been made in the configuration.
func (*GoFeatureFlag) GetCacheRefreshDate ¶
func (g *GoFeatureFlag) GetCacheRefreshDate() time.Time
GetCacheRefreshDate gives the last refresh date of the cache.
func (*GoFeatureFlag) GetEvaluationContextEnrichment ¶
func (g *GoFeatureFlag) GetEvaluationContextEnrichment() map[string]any
GetEvaluationContextEnrichment returns the evaluation context enrichment.
func (*GoFeatureFlag) GetFlagStates ¶
func (g *GoFeatureFlag) GetFlagStates( evaluationCtx ffcontext.Context, flagsToEvaluate []string, ) flagstate.AllFlags
GetFlagStates is evaluating all the flags in flagsToEvaluate based on the context provided. If flagsToEvaluate is nil or empty, it will evaluate all the flags available in Semaphore.
func (*GoFeatureFlag) GetFlagsFromCache ¶
func (g *GoFeatureFlag) GetFlagsFromCache() (map[string]flagdef.Flag, error)
GetFlagsFromCache returns all the flags present in the cache with their current state when calling this method. If cache hasn't been initialized, an error reporting this is returned.
func (*GoFeatureFlag) GetFlagsFromCacheReadOnly ¶
func (g *GoFeatureFlag) GetFlagsFromCacheReadOnly() (map[string]flagdef.Flag, error)
GetFlagsFromCacheReadOnly is GetFlagsFromCache without the deep copy of the flags: the flags are the ones the evaluations use. The caller must only read them (evaluate them, look at them) and must not change them, nor hand them to code that does. It is the cheap way to evaluate every flag again and again, a copy rebuilds the state that is memoized for the scheduled rollouts.
func (*GoFeatureFlag) GetFlagsFromCacheWithContext ¶
func (g *GoFeatureFlag) GetFlagsFromCacheWithContext(ctx context.Context) (map[string]flagdef.Flag, error)
GetFlagsFromCacheWithContext returns all the flags present in the cache with their current state when calling this method. If cache hasn't been initialized, an error reporting this is returned. The provided context is used for the operation.
func (*GoFeatureFlag) GetPollingInterval ¶
func (g *GoFeatureFlag) GetPollingInterval() int64
GetPollingInterval is the polling interval between two refreshes of the cache.
func (*GoFeatureFlag) IntVariation ¶
func (g *GoFeatureFlag) IntVariation( flagKey string, ctx ffcontext.Context, defaultValue int, ) (int, error)
IntVariation return the value of the flag in int. An error is return if you don't have init the library before calling the function. If the key does not exist we return the default value. Note: Use this function only if you are using multiple semaphore instances.
func (*GoFeatureFlag) IntVariationDetails ¶
func (g *GoFeatureFlag) IntVariationDetails(flagKey string, ctx ffcontext.Context, defaultValue int, ) (model.VariationResult[int], error)
IntVariationDetails return the details of the evaluation for int flag. An error is return if you don't have init the library before calling the function. If the key does not exist we return the default value. Note: Use this function only if you are using multiple semaphore instances.
func (*GoFeatureFlag) IsOffline ¶
func (g *GoFeatureFlag) IsOffline() bool
IsOffline allows knowing if the feature flag is in offline mode.
func (*GoFeatureFlag) JSONArrayVariation ¶
func (g *GoFeatureFlag) JSONArrayVariation( flagKey string, ctx ffcontext.Context, defaultValue []any, ) ([]any, error)
JSONArrayVariation return the value of the flag in []interface{}. An error is return if you don't have init the library before calling the function. If the key does not exist we return the default value. Note: Use this function only if you are using multiple semaphore instances.
func (*GoFeatureFlag) JSONArrayVariationDetails ¶
func (g *GoFeatureFlag) JSONArrayVariationDetails( flagKey string, ctx ffcontext.Context, defaultValue []any, ) (model.VariationResult[[]any], error)
JSONArrayVariationDetails return the details of the evaluation for []interface{} flag. An error is return if you don't have init the library before calling the function. If the key does not exist we return the default value. Note: Use this function only if you are using multiple semaphore instances.
func (*GoFeatureFlag) JSONVariation ¶
func (g *GoFeatureFlag) JSONVariation( flagKey string, ctx ffcontext.Context, defaultValue map[string]any, ) (map[string]any, error)
JSONVariation return the value of the flag in map[string]interface{}. An error is return if you don't have init the library before calling the function. If the key does not exist we return the default value. Note: Use this function only if you are using multiple semaphore instances.
func (*GoFeatureFlag) JSONVariationDetails ¶
func (g *GoFeatureFlag) JSONVariationDetails( flagKey string, ctx ffcontext.Context, defaultValue map[string]any, ) (model.VariationResult[map[string]any], error)
JSONVariationDetails return the details of the evaluation for []interface{} flag. An error is return if you don't have init the library before calling the function. If the key does not exist we return the default value. Note: Use this function only if you are using multiple semaphore instances.
func (*GoFeatureFlag) RawVariation ¶
func (g *GoFeatureFlag) RawVariation( flagKey string, ctx ffcontext.Context, sdkDefaultValue any, ) (model.RawVarResult, error)
RawVariation return the raw value of the flag (without any types). This raw result is mostly used by software built on top of semaphore such as semaphore relay proxy. If you are using directly the library you should avoid calling this function. The value of an object or array flag is the one of the cache, shared by every evaluation (the relay proxy only serialises it, the copy would cost an allocation per evaluation): never modify it. The typed JSONVariation and JSONArrayVariation methods return a copy. The metadata always belongs to the caller. Note: Use this function only if you are using multiple semaphore instances.
func (*GoFeatureFlag) SetOffline ¶
func (g *GoFeatureFlag) SetOffline(control bool)
SetOffline updates the config Offline parameter.
func (*GoFeatureFlag) SetOfflineWithContext ¶
func (g *GoFeatureFlag) SetOfflineWithContext(ctx context.Context, control bool)
SetOfflineWithContext updates the config Offline parameter, and stops (going offline) or restarts (going back online) the background polling of the retrievers.
Known limitation: going back online does not restart the background polling. StopPolling closes the background updater channel for good, so the StartPolling call below returns immediately. Fixing this requires recreating the background updater, which is tracked separately.
func (*GoFeatureFlag) StringVariation ¶
func (g *GoFeatureFlag) StringVariation( flagKey string, ctx ffcontext.Context, defaultValue string, ) (string, error)
StringVariation return the value of the flag in string. An error is return if you don't have init the library before calling the function. If the key does not exist we return the default value. Note: Use this function only if you are using multiple semaphore instances.
func (*GoFeatureFlag) StringVariationDetails ¶
func (g *GoFeatureFlag) StringVariationDetails( flagKey string, ctx ffcontext.Context, defaultValue string, ) (model.VariationResult[string], error)
StringVariationDetails return the details of the evaluation for string flag. An error is return if you don't have init the library before calling the function. If the key does not exist we return the default value. Note: Use this function only if you are using multiple semaphore instances.
func (*GoFeatureFlag) Track ¶
func (g *GoFeatureFlag) Track( trackingEventName string, ctx ffcontext.EvaluationContext, trackingEventDetails exporter.TrackingEventDetails, )
Track is used to track an event. Note: Use this function only if you are using multiple semaphore instances.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
cli
command
Package main is the entry point of the semaphore command line tool.
|
Package main is the entry point of the semaphore command line tool. |
|
cli/cliapp
Package cliapp wires and runs the semaphore-cli command line.
|
Package cliapp wires and runs the semaphore-cli command line. |
|
cli/config
Package config implements "semaphore-cli config validate" and "semaphore-cli config print --effective": thin commands over the strict loader of the version 2 bootstrap file (cmd/relayproxy/bootstrap).
|
Package config implements "semaphore-cli config validate" and "semaphore-cli config print --effective": thin commands over the strict loader of the version 2 bootstrap file (cmd/relayproxy/bootstrap). |
|
cli/evaluate
Package evaluate implements the command that evaluates a feature flag for a given context.
|
Package evaluate implements the command that evaluates a feature flag for a given context. |
|
cli/evaluate/retrieverconf
Package retrieverconf defines the configuration of the retrievers and their serializable options.
|
Package retrieverconf defines the configuration of the retrievers and their serializable options. |
|
cli/evaluate/retrieverconf/init
Package init creates the retrievers from their configuration.
|
Package init creates the retrievers from their configuration. |
|
cli/generate
Package generate implements the command group that generates Semaphore related files.
|
Package generate implements the command group that generates Semaphore related files. |
|
cli/generate/manifest
Package manifest implements the command that generates a flag manifest from a configuration file.
|
Package manifest implements the command that generates a flag manifest from a configuration file. |
|
cli/generate/manifest/model
Package model defines the flag manifest document structure written by the manifest command.
|
Package model defines the flag manifest document structure written by the manifest command. |
|
cli/helper
Package helper provides the flag type resolution and output helpers shared by the command line commands.
|
Package helper provides the flag type resolution and output helpers shared by the command line commands. |
|
cli/linter
Package linter implements the command that lints a Semaphore flag configuration file.
|
Package linter implements the command that lints a Semaphore flag configuration file. |
|
cli/publish
Package publish implements "semaphore-cli publish": it reads a directory of flag files and flag-set documents, builds the manifest and publishes both to S3 with controlplane/s3publish, and "semaphore-cli publish verify", which checks what the bucket holds.
|
Package publish implements "semaphore-cli publish": it reads a directory of flag files and flag-set documents, builds the manifest and publishes both to S3 with controlplane/s3publish, and "semaphore-cli publish verify", which checks what the bucket holds. |
|
cli/segment
Package segment is the semaphore-cli segment command group: import, add, remove and stat for the members of a dynamic segment in a Valkey or Redis store.
|
Package segment is the semaphore-cli segment command group: import, add, remove and stat for the members of a dynamic segment in a Valkey or Redis store. |
|
jsonschema-generator
command
Package main generates the JSON schema of the relay proxy configuration file.
|
Package main generates the JSON schema of the relay proxy configuration file. |
|
relayproxy
command
Package main is the entry point of the relay proxy server.
|
Package main is the entry point of the relay proxy server. |
|
relayproxy/api
Package api serves the relay proxy HTTP API, its OpenAPI document and its server lifecycle.
|
Package api serves the relay proxy HTTP API, its OpenAPI document and its server lifecycle. |
|
relayproxy/api/middleware
Package middleware holds the HTTP middleware of the relay proxy, as plain http.Handler wrappers.
|
Package middleware holds the HTTP middleware of the relay proxy, as plain http.Handler wrappers. |
|
relayproxy/api/opentelemetry
Package opentelemetry sets up the OpenTelemetry metrics and tracing of the relay proxy.
|
Package opentelemetry sets up the OpenTelemetry metrics and tracing of the relay proxy. |
|
relayproxy/bootstrap
Package bootstrap defines the version 2 bootstrap file of the relay proxy: its schema, a strict loader that reports path- and line-addressed errors, the secret references, the explicit environment overrides, the defaults table, the redacted effective print and the JSON Schema.
|
Package bootstrap defines the version 2 bootstrap file of the relay proxy: its schema, a strict loader that reports path- and line-addressed errors, the secret references, the explicit environment overrides, the defaults table, the redacted effective print and the JSON Schema. |
|
relayproxy/configsync
Package configsync lets the OFREP bulk evaluation answer a client that was notified of a newer configuration than the one the relay has loaded: the relay checks its control plane first, within a bound, and answers with what it then has.
|
Package configsync lets the OFREP bulk evaluation answer a client that was notified of a newer configuration than the one the relay has loaded: the relay checks its control plane first, within a bound, and answers with what it then has. |
|
relayproxy/controlsource
Package controlsource connects the manifest reader to the runtime: it turns every manifestreader.Snapshot into a flagruntime.Content and hands it to the engine.
|
Package controlsource connects the manifest reader to the runtime: it turns every manifestreader.Snapshot into a flagruntime.Content and hands it to the engine. |
|
relayproxy/corehttp
Package corehttp serves the HTTP API of the relay proxy (the evaluation endpoints, the flag configuration, the flag change, the collection of events and the streams of changes) from a relaycore.Core.
|
Package corehttp serves the HTTP API of the relay proxy (the evaluation endpoints, the flag configuration, the flag change, the collection of events and the streams of changes) from a relaycore.Core. |
|
relayproxy/events
Package events holds the runtime-level exporters, the event channel and the notifiers of the relay proxy.
|
Package events holds the runtime-level exporters, the event channel and the notifiers of the relay proxy. |
|
relayproxy/events/kafka
Package kafka implements the SCRAM client used to authenticate against Kafka.
|
Package kafka implements the SCRAM client used to authenticate against Kafka. |
|
relayproxy/flagruntime
Package flagruntime holds the immutable runtime of the relay proxy and the reconcile engine that replaces it.
|
Package flagruntime holds the immutable runtime of the relay proxy and the reconcile engine that replaces it. |
|
relayproxy/handler/manifest
Package manifest implements the HTTP handler that returns the flag manifest of a flagset.
|
Package manifest implements the HTTP handler that returns the flag manifest of a flagset. |
|
relayproxy/handler/ofrep
Package ofrep implements the OFREP evaluation handlers of the relay proxy.
|
Package ofrep implements the OFREP evaluation handlers of the relay proxy. |
|
relayproxy/handler/semaphore
Package semaphore implements the Semaphore HTTP handlers of the relay proxy.
|
Package semaphore implements the Semaphore HTTP handlers of the relay proxy. |
|
relayproxy/helper
Package helper provides the request, header and HTTP error helpers of the relay proxy.
|
Package helper provides the request, header and HTTP error helpers of the relay proxy. |
|
relayproxy/metric
Package metric defines the Prometheus metrics exposed by the relay proxy.
|
Package metric defines the Prometheus metrics exposed by the relay proxy. |
|
relayproxy/model
Package model defines the request and response models of the relay proxy HTTP API.
|
Package model defines the request and response models of the relay proxy HTTP API. |
|
relayproxy/modeldocs
Package modeldocs holds the documentation stubs of the relay proxy OpenAPI document.
|
Package modeldocs holds the documentation stubs of the relay proxy OpenAPI document. |
|
relayproxy/relayapp
Package relayapp wires and runs the relay proxy: the command line, the start, the reloads and the ordered stop.
|
Package relayapp wires and runs the relay proxy: the command line, the start, the reloads and the ordered stop. |
|
relayproxy/relaycore
Package relaycore assembles the config v2 relay core from a loaded bootstrap file: the connections, the object store of the control plane, the state directory, the manifest reader, the source that feeds the reconcile engine, the engine with its holder and evaluator, and the exporters and notifiers of the events package.
|
Package relaycore assembles the config v2 relay core from a loaded bootstrap file: the connections, the object store of the control plane, the state directory, the manifest reader, the source that feeds the reconcile engine, the engine with its holder and evaluator, and the exporters and notifiers of the events package. |
|
relayproxy/segmentobs
Package segmentobs observes the resolvers of the dynamic segments for Prometheus.
|
Package segmentobs observes the resolvers of the dynamic segments for Prometheus. |
|
relayproxy/segmentstore
Package segmentstore tells the relay which kinds of connection of the bootstrap file can serve segments, and in which modes.
|
Package segmentstore tells the relay which kinds of connection of the bootstrap file can serve segments, and in which modes. |
|
relayproxy/service
Package service manages the flagsets and the feature flag clients used by the relay proxy.
|
Package service manages the flagsets and the feature flag clients used by the relay proxy. |
|
relayproxy/service/stream
Package stream implements the SSE and WebSocket streams that push flag changes to clients.
|
Package stream implements the SSE and WebSocket streams that push flag changes to clients. |
|
relayproxy/tlscert
Package tlscert serves the certificate of a TLS listener and reloads it when its files change, without a restart and without touching the connections that are open.
|
Package tlscert serves the certificate of a TLS listener and reloads it when its files change, without a restart and without touching the connections that are open. |
|
cmdhelpers
|
|
|
api/middleware
Package middleware provides the HTTP middlewares that log requests and record their errors.
|
Package middleware provides the HTTP middlewares that log requests and record their errors. |
|
buildinfo
Package buildinfo formats the identity of a Semaphore binary for the --version flags.
|
Package buildinfo formats the identity of a Semaphore binary for the --version flags. |
|
cmdlog
Package cmdlog builds the logger of the relay proxy: a slog.Logger writing JSON or logfmt lines to a writer (stderr by default), with the level and the format of the configuration.
|
Package cmdlog builds the logger of the relay proxy: a slog.Logger writing JSON or logfmt lines to a writer (stderr by default), with the level and the format of the configuration. |
|
configfile
Package configfile reads and parses the configuration files of the command line tools and the relay proxy.
|
Package configfile reads and parses the configuration files of the command line tools and the relay proxy. |
|
err
Package err defines the errors returned when a retriever configuration is invalid.
|
Package err defines the errors returned when a retriever configuration is invalid. |
|
manifest
Package manifest generates flag definitions for the manifest from flag configurations.
|
Package manifest generates flag definitions for the manifest from flag configurations. |
|
manifest/model
Package model defines the flag definition and flag type models of the flag manifest.
|
Package model defines the flag definition and flag type models of the flag manifest. |
|
Package controlplane is the document format of the Semaphore control plane: the manifest, the flag-set documents and the flag objects that a publisher writes to a store (for example S3) and that the relay proxy reads.
|
Package controlplane is the document format of the Semaphore control plane: the manifest, the flag-set documents and the flag objects that a publisher writes to a store (for example S3) and that the relay proxy reads. |
|
filepublish
Package filepublish is the file-store counterpart of an S3 bucket for s3publish.Publisher: a Store implements s3publish.API over a directory, so the upload protocol (objects first, manifest last, conditional write of the manifest) is the one of S3 and is not copied.
|
Package filepublish is the file-store counterpart of an S3 bucket for s3publish.Publisher: a Store implements s3publish.API over a directory, so the upload protocol (objects first, manifest last, conditional write of the manifest) is the one of S3 and is not copied. |
|
flagcheck
Package flagcheck validates the bytes of a flag object with the engine of the relay: the same decoder and the same validity checks the relay applies when it loads a flag file, and that "semaphore-cli lint" applies.
|
Package flagcheck validates the bytes of a flag object with the engine of the relay: the same decoder and the same validity checks the relay applies when it loads a flag file, and that "semaphore-cli lint" applies. |
|
s3publish
Package s3publish publishes control-plane documents to an S3 bucket so that a reader polling the manifest never sees a half-written state.
|
Package s3publish publishes control-plane documents to an S3 bucket so that a reader polling the manifest never sees a half-written state. |
|
Package exporter defines the data exporter of semaphore
|
Package exporter defines the data exporter of semaphore |
|
azureexporter
Package azureexporter implements the exporter that sends evaluation events to Azure Blob Storage.
|
Package azureexporter implements the exporter that sends evaluation events to Azure Blob Storage. |
|
bigqueryexporter
Package bigqueryexporter implements the exporter that writes evaluation events to BigQuery.
|
Package bigqueryexporter implements the exporter that writes evaluation events to BigQuery. |
|
fileexporter
Package fileexporter implements the exporter that writes evaluation events to local files.
|
Package fileexporter implements the exporter that writes evaluation events to local files. |
|
gcstorageexporter
Package gcstorageexporter implements the exporter that writes evaluation events to Google Cloud Storage.
|
Package gcstorageexporter implements the exporter that writes evaluation events to Google Cloud Storage. |
|
kafkaexporter
Package kafkaexporter implements the exporter that publishes evaluation events to Kafka.
|
Package kafkaexporter implements the exporter that publishes evaluation events to Kafka. |
|
kinesisexporter
Package kinesisexporter implements the exporter that sends evaluation events to Amazon Kinesis.
|
Package kinesisexporter implements the exporter that sends evaluation events to Amazon Kinesis. |
|
logsexporter
Package logsexporter implements the exporter that writes evaluation events to the logs.
|
Package logsexporter implements the exporter that writes evaluation events to the logs. |
|
opentelemetryexporter
Package opentelemetryexporter implements the exporter that sends evaluation events as OpenTelemetry logs.
|
Package opentelemetryexporter implements the exporter that sends evaluation events as OpenTelemetry logs. |
|
pubsubexporter
Package pubsubexporter implements the exporter that publishes evaluation events to Google Pub/Sub.
|
Package pubsubexporter implements the exporter that publishes evaluation events to Google Pub/Sub. |
|
pubsubexporterv2
Package pubsubexporterv2 implements the exporter that publishes evaluation events to Google Pub/Sub, v2 client.
|
Package pubsubexporterv2 implements the exporter that publishes evaluation events to Google Pub/Sub, v2 client. |
|
redshiftexporter
Package redshiftexporter implements the exporter that loads evaluation events into Amazon Redshift.
|
Package redshiftexporter implements the exporter that loads evaluation events into Amazon Redshift. |
|
s3exporterv2
Package s3exporterv2 implements the exporter that uploads evaluation events to Amazon S3.
|
Package s3exporterv2 implements the exporter that uploads evaluation events to Amazon S3. |
|
sqsexporter
Package sqsexporter implements the exporter that sends evaluation events to Amazon SQS.
|
Package sqsexporter implements the exporter that sends evaluation events to Amazon SQS. |
|
webhookexporter
Package webhookexporter implements the exporter that posts evaluation events to a webhook.
|
Package webhookexporter implements the exporter that posts evaluation events to a webhook. |
|
Package ffcontext exposes the evaluation context types and helpers of the public API.
|
Package ffcontext exposes the evaluation context types and helpers of the public API. |
|
Package internal holds the helpers shared by the packages of this module that are not part of the public API.
|
Package internal holds the helpers shared by the packages of this module that are not part of the public API. |
|
cache
Package cache caches the loaded flag configurations in memory for the evaluation.
|
Package cache caches the loaded flag configurations in memory for the evaluation. |
|
connection
Package connection builds and shares the AWS clients of the relay: exactly one client per named connection (one bucket or endpoint, one region, one credentials identity) per process.
|
Package connection builds and shares the AWS clients of the relay: exactly one client per named connection (one bucket or endpoint, one region, one credentials identity) per process. |
|
docstest
Package docstest holds the tests that run the examples of the documentation: the bootstrap files and control-plane documents that the pages show are valid, and the getting-started page is run command by command against the built binaries.
|
Package docstest holds the tests that run the examples of the documentation: the bootstrap files and control-plane documents that the pages show are valid, and the getting-started page is run command by command against the built binaries. |
|
flagstate
Package flagstate builds the state of a flag evaluation returned by the all flags and flag evaluation APIs.
|
Package flagstate builds the state of a flag evaluation returned by the all flags and flag evaluation APIs. |
|
fleet
Package fleet generates a seeded deployment of many flag sets for the fleet end-to-end test (issue #84): the bootstrap file, the documents to publish (flag sets and flags) and the manifest, a list of evaluation contexts per flag set, and the result that each evaluation must give.
|
Package fleet generates a seeded deployment of many flag sets for the fleet end-to-end test (issue #84): the bootstrap file, the documents to publish (flag sets and flags) and the manifest, a list of evaluation contexts per flag set, and the result that each evaluation must give. |
|
folderloader
Package folderloader holds the provider independent logic of the "folder mode" of the retrievers (S3, GCS, Azure Blob...): list the files under a prefix, download and parse the ones that changed, and merge all of them into a single flag set.
|
Package folderloader holds the provider independent logic of the "folder mode" of the retrievers (S3, GCS, Azure Blob...): list the files under a prefix, download and parse the ones that changed, and merge all of them into a single flag set. |
|
loadtest
Package loadtest contains the flag fixtures, the exporter behaviours and the soak harness used to measure the throughput and the memory stability of semaphore.
|
Package loadtest contains the flag fixtures, the exporter behaviours and the soak harness used to measure the throughput and the memory stability of semaphore. |
|
loadtest/cmd/soak
command
Command soak runs a max-rate load against the library or a real relay proxy (loopback HTTP), with event tracking on and a selectable exporter behaviour, and prints a time series and a "memory stable" verdict.
|
Command soak runs a max-rate load against the library or a real relay proxy (loopback HTTP), with event tracking on and a selectable exporter behaviour, and prints a time series and a "memory stable" verdict. |
|
loadtest/cmd/soak/soakapp
Package soakapp parses the command line and runs the load-test soak command.
|
Package soakapp parses the command line and runs the load-test soak command. |
|
loadtest/relay
Package relay starts an in-process relay proxy for the benchmarks and the soak harness.
|
Package relay starts an in-process relay proxy for the benchmarks and the soak harness. |
|
loadtest/segments
Package segments holds the load and chaos tests of the dynamic segments against a real Valkey and a real relay proxy, started from the harness in internal/loadtest/relay.
|
Package segments holds the load and chaos tests of the dynamic segments against a real Valkey and a real relay proxy, started from the harness in internal/loadtest/relay. |
|
manifestreader
Package manifestreader polls the control-plane manifest and delivers verified objects.
|
Package manifestreader polls the control-plane manifest and delivers verified objects. |
|
manifestreader/readertest
Package readertest is the conformance suite of the manifest reader over a store: what a connection type gives the relay once its manifestreader.ObjectStore is plugged into a manifestreader.Reader.
|
Package readertest is the conformance suite of the manifest reader over a store: what a connection type gives the relay once its manifestreader.ObjectStore is plugged into a manifestreader.Reader. |
|
manifestreader/statedir
Package statedir keeps the last accepted manifest and its verified objects in a directory, so a restart serves the last content even when the store is unreachable, and costs one conditional GET (a 304) and no object GET when it is not.
|
Package statedir keeps the last accepted manifest and its verified objects in a directory, so a restart serves the last content even when the store is unreachable, and costs one conditional GET (a 304) and no object GET when it is not. |
|
manifestreader/storetest
Package storetest is the conformance suite of manifestreader.ObjectStore: the contract of a store as executable cases.
|
Package storetest is the conformance suite of manifestreader.ObjectStore: the contract of a store as executable cases. |
|
notification
Package notification dispatches the flag change notifications to the configured notifiers.
|
Package notification dispatches the flag change notifications to the configured notifiers. |
|
protocol
Package protocol holds the protocol and format names shared by the production code and the tests: HTTP header names, media types, the names of the supported configuration formats and network names.
|
Package protocol holds the protocol and format names shared by the production code and the tests: HTTP header names, media types, the names of the supported configuration formats and network names. |
|
schemadoc
Package schemadoc turns the JSON Schemas of the repository into the Markdown schema reference of the documentation.
|
Package schemadoc turns the JSON Schemas of the repository into the Markdown schema reference of the documentation. |
|
signer
Package signer signs webhook payloads with a shared secret.
|
Package signer signs webhook payloads with a shared secret. |
|
testproxy
Package testproxy is a small TCP forwarder for tests: it sits between a client and a server and can add a delay to every chunk, cut the open connections and refuse new ones.
|
Package testproxy is a small TCP forwarder for tests: it sits between a client and a server and can add a delay to every chunk, cut the open connections and refuse new ones. |
|
model
|
|
|
dto
Package dto exposes the flag configuration DTO types of the public API.
|
Package dto exposes the flag configuration DTO types of the public API. |
|
modules
|
|
|
core/clock
Package clock is the one place that reads the wall clock for the data that semaphore stamps, compares or evaluates against (evaluation dates, event creation dates, cache refresh dates, rate-limit windows, token lifetimes, log timestamps).
|
Package clock is the one place that reads the wall clock for the data that semaphore stamps, compares or evaluates against (evaluation dates, event creation dates, cache refresh dates, rate-limit windows, token lifetimes, log timestamps). |
|
core/dto
Package dto defines the flag configuration DTOs and converts them to and from internal flags.
|
Package dto defines the flag configuration DTOs and converts them to and from internal flags. |
|
core/evaluation
Package evaluation evaluates a flag against an evaluation context and returns the variation result.
|
Package evaluation evaluates a flag against an evaluation context and returns the variation result. |
|
core/ffcontext
Package ffcontext defines the evaluation context used to evaluate the flags.
|
Package ffcontext defines the evaluation context used to evaluate the flags. |
|
core/flagdef
Package flagdef defines the flags, their rules and the queries used to resolve them.
|
Package flagdef defines the flags, their rules and the queries used to resolve them. |
|
core/internalerror
Package internalerror defines the errors raised while a flag is resolved internally.
|
Package internalerror defines the errors raised while a flag is resolved internally. |
|
core/legacy
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.
|
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. |
|
core/model
Package model defines the variation result models returned by an evaluation.
|
Package model defines the variation result models returned by an evaluation. |
|
core/segment
Package segment holds the model of the named segments that the targeting rules of a flag test an attribute against (targetingKey in segment("beta-users")): the definitions, the seam that answers the membership questions of a request, the failure policies and an in-memory provider.
|
Package segment holds the model of the named segments that the targeting rules of a flag test an attribute against (targetingKey in segment("beta-users")): the definitions, the seam that answers the membership questions of a request, the failure policies and an in-memory provider. |
|
core/segment/redissegment
Package redissegment is a segment.Provider that answers segment membership lookups from a Redis or Valkey store with go-redis (segment type segment.TypeRedis; the valkey-go provider, type segment.TypeValkey, is a separate package).
|
Package redissegment is a segment.Provider that answers segment membership lookups from a Redis or Valkey store with go-redis (segment type segment.TypeRedis; the valkey-go provider, type segment.TypeValkey, is a separate package). |
|
core/segment/resolver
Package resolver wraps a segment.Provider with what a network store needs on the evaluation path: an in-process cache, coalescing of identical concurrent lookups and a circuit breaker for each segment.
|
Package resolver wraps a segment.Provider with what a network store needs on the evaluation path: an in-process cache, coalescing of identical concurrent lookups and a circuit breaker for each segment. |
|
core/segment/segmentadmin
Package segmentadmin is the write side of the dynamic segments: the code that loads members into a Valkey or Redis store, the counterpart of the read side in valkeysegment and redissegment.
|
Package segmentadmin is the write side of the dynamic segments: the code that loads members into a Valkey or Redis store, the counterpart of the read side in valkeysegment and redissegment. |
|
core/segment/segmentadmin/admintest
Package admintest holds an in-memory segmentadmin.Store with failure injection, for tests of the code that writes segments (the import and the commands of the CLI) that must not need a server.
|
Package admintest holds an in-memory segmentadmin.Store with failure injection, for tests of the code that writes segments (the import and the commands of the CLI) that must not need a server. |
|
core/segment/segmenttest
Package segmenttest is the conformance suite of segment.Provider: the contract of the seam as executable cases.
|
Package segmenttest is the conformance suite of segment.Provider: the contract of the seam as executable cases. |
|
core/segment/snapshot
Package snapshot holds the member set of a segment of the snapshot mode: it pulls the members through a segment.SnapshotSource, keeps them in memory behind an atomic pointer and swaps them when the version changes.
|
Package snapshot holds the member set of a segment of the snapshot mode: it pulls the members through a segment.SnapshotSource, keeps them in memory behind an atomic pointer and swaps them when the version changes. |
|
core/segment/valkeysegment
Package valkeysegment is the segment.Provider of segment type segment.TypeValkey.
|
Package valkeysegment is the segment.Provider of segment type segment.TypeValkey. |
|
core/testhelpers/clocktest
Package clocktest pins clock.Now for the tests of a package.
|
Package clocktest pins clock.Now for the tests of a package. |
|
core/testhelpers/leakwait
Package leakwait is the goroutine leak check that the TestMain of a package runs once its tests ended.
|
Package leakwait is the goroutine leak check that the TestMain of a package runs once its tests ended. |
|
core/testhelpers/testconvert
Package testconvert provides helpers that build pointers to basic values in tests.
|
Package testconvert provides helpers that build pointers to basic values in tests. |
|
Package notifier defines the notifier interface and the change descriptions sent to the notifiers.
|
Package notifier defines the notifier interface and the change descriptions sent to the notifiers. |
|
discordnotifier
Package discordnotifier implements the notifier that sends flag changes to Discord.
|
Package discordnotifier implements the notifier that sends flag changes to Discord. |
|
logsnotifier
Package logsnotifier implements the notifier that writes flag changes to the logs.
|
Package logsnotifier implements the notifier that writes flag changes to the logs. |
|
microsoftteamsnotifier
Package microsoftteamsnotifier implements the notifier that sends flag changes to Microsoft Teams.
|
Package microsoftteamsnotifier implements the notifier that sends flag changes to Microsoft Teams. |
|
slacknotifier
Package slacknotifier implements the notifier that sends flag changes to Slack.
|
Package slacknotifier implements the notifier that sends flag changes to Slack. |
|
webhooknotifier
Package webhooknotifier implements the notifier that posts flag changes to a webhook.
|
Package webhooknotifier implements the notifier that posts flag changes to a webhook. |
|
openfeature
|
|
|
provider_tests/ofrep-conformance
Package ofrepconformance validates HTTP responses from the Semaphore relay proxy against the vendored OpenFeature Remote Evaluation Protocol (OFREP) OpenAPI specification.
|
Package ofrepconformance validates HTTP responses from the Semaphore relay proxy against the vendored OpenFeature Remote Evaluation Protocol (OFREP) OpenAPI specification. |
|
pkgs
|
|
|
evalcore
Package evalcore provides the hashing, context conversion and JSON helpers of the core module.
|
Package evalcore provides the hashing, context conversion and JSON helpers of the core module. |
|
stringsx
Package stringsx provides the string and flagset helpers shared by the packages of this module.
|
Package stringsx provides the string and flagset helpers shared by the packages of this module. |
|
Package retriever defines the retriever interfaces and the manager that refreshes the flag configurations.
|
Package retriever defines the retriever interfaces and the manager that refreshes the flag configurations. |
|
azblobstorageretriever
Package azblobstorageretriever retrieves flag configurations from Azure Blob Storage.
|
Package azblobstorageretriever retrieves flag configurations from Azure Blob Storage. |
|
bitbucketretriever
Package bitbucketretriever retrieves flag configurations from Bitbucket.
|
Package bitbucketretriever retrieves flag configurations from Bitbucket. |
|
fileretriever
Package fileretriever retrieves flag configurations from local files.
|
Package fileretriever retrieves flag configurations from local files. |
|
gcstorageretriever
Package gcstorageretriever retrieves flag configurations from Google Cloud Storage.
|
Package gcstorageretriever retrieves flag configurations from Google Cloud Storage. |
|
githubretriever
Package githubretriever retrieves flag configurations from GitHub repositories.
|
Package githubretriever retrieves flag configurations from GitHub repositories. |
|
gitlabretriever
Package gitlabretriever retrieves flag configurations from GitLab repositories.
|
Package gitlabretriever retrieves flag configurations from GitLab repositories. |
|
httpretriever
Package httpretriever retrieves flag configurations over HTTP.
|
Package httpretriever retrieves flag configurations over HTTP. |
|
k8sretriever
Package k8sretriever retrieves flag configurations from Kubernetes resources.
|
Package k8sretriever retrieves flag configurations from Kubernetes resources. |
|
mongodbretriever
Package mongodbretriever retrieves flag configurations from MongoDB.
|
Package mongodbretriever retrieves flag configurations from MongoDB. |
|
postgresqlretriever
Package postgresqlretriever retrieves flag configurations from PostgreSQL.
|
Package postgresqlretriever retrieves flag configurations from PostgreSQL. |
|
redisretriever
Package redisretriever retrieves flag configurations from Redis.
|
Package redisretriever retrieves flag configurations from Redis. |
|
s3retrieverv2
Package s3retrieverv2 retrieves flag configurations from Amazon S3.
|
Package s3retrieverv2 retrieves flag configurations from Amazon S3. |
|
shared
Package shared provides the HTTP call helper shared by the retrievers.
|
Package shared provides the HTTP call helper shared by the retrievers. |
|
Package rules evaluates the rules of the flags against the attributes of a context.
|
Package rules evaluates the rules of the flags against the attributes of a context. |
|
cmd
command
Command cmd evaluates the rule in rules.txt against the JSON object in test.json.
|
Command cmd evaluates the rule in rules.txt against the JSON object in test.json. |
|
parser
Package parser parses and compiles the JSON query rules and evaluates them.
|
Package parser parses and compiles the JSON query rules and evaluates them. |
|
Package testhelpers provides the shared test helpers, file helpers and generated mocks of this module.
|
Package testhelpers provides the shared test helpers, file helpers and generated mocks of this module. |
|
fixtures
Package fixtures holds the constants shared by the tests of more than one package: flag keys, user keys, variation names, rule names, API keys, fixture file paths and a few common literals.
|
Package fixtures holds the constants shared by the tests of more than one package: flag keys, user keys, variation names, rule names, API keys, fixture file paths and a few common literals. |
|
gopherstack
Package gopherstack starts the gopherstack AWS emulator (https://github.com/blackbirdworks/gopherstack) in a Docker container, to run end-to-end tests of the AWS-backed components (S3, Kinesis, SQS).
|
Package gopherstack starts the gopherstack AWS emulator (https://github.com/blackbirdworks/gopherstack) in a Docker container, to run end-to-end tests of the AWS-backed components (S3, Kinesis, SQS). |
|
mock
Package mock provides mocks of the exporters, notifiers and services used in tests.
|
Package mock provides mocks of the exporters, notifiers and services used in tests. |
|
mock/mockretriever
Package mockretriever provides mock implementations of various retriever interfaces for testing purposes in the semaphore project.
|
Package mockretriever provides mock implementations of various retriever interfaces for testing purposes in the semaphore project. |
|
s3fake
Package s3fake is an in-memory S3 bucket for tests: GetObject, HeadObject and PutObject with the conditional write semantics of S3 (If-None-Match: * and If-Match answer 412 PreconditionFailed, If-Match on a missing key answers NoSuchKey), a verified ChecksumSHA256, a log of every call in order, and a hook to inject failures or play another writer.
|
Package s3fake is an in-memory S3 bucket for tests: GetObject, HeadObject and PutObject with the conditional write semantics of S3 (If-None-Match: * and If-Match answer 412 PreconditionFailed, If-Match on a missing key answers NoSuchKey), a verified ChecksumSHA256, a log of every call in order, and a hook to inject failures or play another writer. |
|
slogutil
Package slogutil provides slog helpers that capture log records in tests.
|
Package slogutil provides slog helpers that capture log records in tests. |
|
tlstest
Package tlstest makes the certificates of the TLS tests.
|
Package tlstest makes the certificates of the TLS tests. |