ofrep

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 17 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

Index

Constants

View Source
const (
	// MetadataCacheable is the response metadata key telling a provider that it can cache the value.
	MetadataCacheable = "semaphore_cacheable"
	// LegacyMetadataCacheable is the key GO Feature Flag used for the same information. The upstream
	// providers read it, so it is still sent next to MetadataCacheable.
	LegacyMetadataCacheable = "gofeatureflag_cacheable"
)

ofrepSSEPath is the path of the relay proxy endpoint streaming flag changes over SSE.

Variables

This section is empty.

Functions

func NewEvaluateError

func NewEvaluateError(
	key string,
	errorCode flag.ErrorCode,
	errorDetails string,
) *model.OFREPEvaluateResponseError

func NewOFREPCommonError

func NewOFREPCommonError(
	errorCode flag.ErrorCode,
	errorDetails string,
) *model.OFREPCommonResponseError

Types

type EvaluateCtrl

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

func NewOFREPEvaluate

func NewOFREPEvaluate(
	flagsetManager service.FlagsetManager,
	metrics metric.Metrics,
	eventStream config.OfrepEventStream,
	opts ...Option,
) EvaluateCtrl

func (*EvaluateCtrl) BulkEvaluate

func (h *EvaluateCtrl) BulkEvaluate(c *echo.Context) error

BulkEvaluate is the entry point to evaluate in bulk flags using the OpenFeature Remote Evaluation Protocol @Summary Open-Feature Remote Evaluation Protocol bulk evaluation API. @Tags OpenFeature Remote Evaluation Protocol (OFREP) @Description Making a **POST** request to the URL `/ofrep/v1/evaluate/flags` will give you the value of the list @Description of feature flags for this evaluation context. @Description @Description If no flags are provided, the API will evaluate all available flags in the configuration. @Security ApiKeyAuth @Security XApiKeyAuth @Produce json @Accept json @Param If-None-Match header string false "The request will be processed only if ETag doesn't match." @Param data body model.OFREPEvalFlagRequest true "Evaluation Context and list of flag for this API call" @Success 200 {object} model.OFREPBulkEvaluateSuccessResponse "OFREP successful evaluation response" @Success 304 {string} string "Etag: \"117-0193435c612c50d93b798619d9464856263dbf9f\"" @Failure 400 {object} model.OFREPCommonResponseError "Bad evaluation request" @Failure 401 {object} modeldocs.HTTPErrorDoc "Unauthorized - You need credentials to access the API" @Failure 403 {object} modeldocs.HTTPErrorDoc "Forbidden - You are not authorized to access the API" @Failure 500 {object} modeldocs.HTTPErrorDoc "Internal server error" @Router /ofrep/v1/evaluate/flags [post]

func (*EvaluateCtrl) Evaluate

func (h *EvaluateCtrl) Evaluate(c *echo.Context) error

Evaluate is the entry point to evaluate a flag using the OpenFeature Remote Evaluation Protocol @Summary Evaluate a feature flag using the OpenFeature Remote Evaluation Protocol @Tags OpenFeature Remote Evaluation Protocol (OFREP) @Description Making a **POST** request to the URL `/ofrep/v1/evaluate/flags/{your_flag_name}` will give you the @Description value of the flag for this evaluation context @Description @Security ApiKeyAuth @Security XApiKeyAuth @Produce json @Accept json @Param data body model.OFREPEvalFlagRequest true "Evaluation Context for this API call" @Param flag_key path string true "Name of your feature flag" @Success 200 {object} model.OFREPEvaluateSuccessResponse "Success" @Failure 400 {object} model.OFREPEvaluateResponseError "Bad Request" @Failure 401 {object} modeldocs.HTTPErrorDoc "Unauthorized" @Failure 404 {object} model.OFREPEvaluateResponseError "Flag Not Found" @Failure 500 {object} modeldocs.HTTPErrorDoc "Internal server error" @Router /ofrep/v1/evaluate/flags/{flag_key} [post]

type Option

type Option func(*EvaluateCtrl)

Option customizes an EvaluateCtrl.

func WithLegacyMetadataOnly

func WithLegacyMetadataOnly(legacyOnly bool) Option

WithLegacyMetadataOnly stops the controller from adding the Semaphore metadata keys (semaphore_cacheable) next to the legacy ones.

Jump to

Keyboard shortcuts

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