model

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: 5 Imported by: 1 module, 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 OFREPSSEEventTypeRefetchEvaluation = "refetchEvaluation"

OFREPSSEEventTypeRefetchEvaluation tells the provider that the flag configuration has changed and that it must re-fetch its evaluations.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllFlagRequest

type AllFlagRequest struct {
	// LegacyUser captures the removed `user` request field so that the API can reject it
	// with an explicit error instead of silently ignoring it. It is never documented.
	LegacyUser any `json:"user,omitempty" swaggerignore:"true"`
	// EvaluationContext The representation of a EvaluationContext for your feature flag system.
	EvaluationContext *EvaluationContextRequest `json:"evaluationContext,omitempty" xml:"evaluationContext,omitempty" form:"evaluationContext" query:"evaluationContext"` //nolint:lll // struct tags (json, yaml, toml, jsonschema, mapstructure) can not be wrapped
}

type CollectEvalDataRequest

type CollectEvalDataRequest struct {
	// Meta are the extra information added during the configuration
	Meta exporter.FeatureEventMetadata `json:"meta"`

	// Events is the list of the event we send in the payload
	// here the type is any because we will unmarshal later in the different event types
	Events []map[string]any `json:"events"`
}

CollectEvalDataRequest is the request to collect data in.

type CollectEvalDataResponse

type CollectEvalDataResponse struct {
	// IngestedContentCount number of model.FeatureEvents that have been sent to the data exporter
	IngestedContentCount int `json:"ingestedContentCount" xml:"ingestedContentCount" form:"ingestedContentCount" query:"ingestedContentCount"` //nolint:lll // struct tags (json, yaml, toml, jsonschema, mapstructure) can not be wrapped
}

CollectEvalDataResponse is the object returned by the health API.

type EvalFlagRequest

type EvalFlagRequest struct {
	AllFlagRequest `json:",inline"`

	// The value will we use if we are not able to get the variation of the flag.
	DefaultValue any `json:"defaultValue" xml:"defaultValue" form:"defaultValue" query:"defaultValue"`
}

type EvaluationContextRequest

type EvaluationContextRequest struct {
	// Custom is a map containing all extra information for this user.
	Custom map[string]any `` //nolint:lll // struct tags (json, yaml, toml, jsonschema, mapstructure) can not be wrapped
	/* 171-byte string literal not displayed */
	// Key is the identifier of the evaluation context.
	Key string `json:"key" xml:"key" form:"key" query:"key" example:"08b5ffb7-7109-42f4-a6f2-b85560fbd20f"`
}

EvaluationContextRequest The representation of a EvaluationContext for your feature flag system.

type FlagEval

type FlagEval struct {
	Value any `json:"value"`
}

type HealthResponse

type HealthResponse struct {
	// Set to true if the HTTP server is started
	Initialized bool `json:"initialized" example:"true"`
}

HealthResponse is the object returned by the health API.

type InfoResponse

type InfoResponse struct {
	// LatestCacheRefresh is the last time when your flag file was read and stored in the internal cache.
	// This field is used for backward compatibility when using the default flagset.
	LatestCacheRefresh *time.Time `json:"cacheRefresh,omitempty" example:"2022-06-13T11:22:55.941628+02:00"`

	// Flagsets contains the cache refresh dates for each flagset when using multiple flagsets.
	// The format is {"flagset name": "2022-06-13T11:22:55.941628+02:00"}
	Flagsets map[string]time.Time `json:"flagsets,omitempty" example:"default:2022-06-13T11:22:55.941628+02:00,feature-flags:2022-06-13T11:22:55.941628+02:00"` //nolint:lll // struct tags (json, yaml, toml, jsonschema, mapstructure) can not be wrapped
}

InfoResponse is the object returned by the info API.

type ManifestDefinitionSuccessResponse

type ManifestDefinitionSuccessResponse struct {
	Key          string         `json:"key"`
	FlagType     model.FlagType `json:"type"`
	DefaultValue any            `json:"defaultValue"`
	Description  string         `json:"description"`
}

type ManifestError

type ManifestError struct {
	ErrorDetails ManifestErrorDetails `json:"error"`
}

type ManifestErrorDetails

type ManifestErrorDetails struct {
	Message string `json:"message" example:"Authorization header required"`
	Status  int    `json:"status"  example:"401"`
}

type ManifestSuccessResponse

type ManifestSuccessResponse struct {
	Flags []ManifestDefinitionSuccessResponse `json:"flags"`
}

ManifestSuccessResponse is the machine-readable manifest envelope for CLI and tooling.

type OFREPBulkEvaluateSuccessResponse

type OFREPBulkEvaluateSuccessResponse struct {
	Flags        []OFREPFlagBulkEvaluateSuccessResponse `json:"flags"`
	EventStreams []OFREPEventStream                     `json:"eventStreams,omitempty"`
}

type OFREPCommonResponseError

type OFREPCommonResponseError struct {
	ErrorCode    flag.ErrorCode `json:"errorCode"`
	ErrorDetails string         `json:"errorDetails"`
}

func (*OFREPCommonResponseError) Error

func (o *OFREPCommonResponseError) Error() string

type OFREPEvalFlagRequest

type OFREPEvalFlagRequest struct {
	Context map[string]any `` /* 193-byte string literal not displayed */
}

type OFREPEvaluateResponseError

type OFREPEvaluateResponseError struct {
	OFREPCommonResponseError `json:",inline" yaml:",inline" toml:",inline"`

	Key string `json:"key"`
}

type OFREPEvaluateSuccessResponse

type OFREPEvaluateSuccessResponse struct {
	Key      string         `json:"key"`
	Value    any            `json:"value"`
	Reason   string         `json:"reason"`
	Variant  string         `json:"variant"`
	Metadata map[string]any `json:"metadata,omitempty"`
}

OFREPEvaluateSuccessResponse is the OFREP evaluation result (also the bulk result items, whose strong ETag hashes the serialized bytes).

type OFREPEventStream

type OFREPEventStream struct {
	Type               string `json:"type"`
	URL                string `json:"url"`
	InactivityDelaySec int    `json:"inactivityDelaySec,omitempty"`
}

OFREPEventStream describes a stream a provider can subscribe to in order to be notified of flag changes instead of polling, as defined by OpenFeature ADR-0008.

type OFREPFlagBulkEvaluateSuccessResponse

type OFREPFlagBulkEvaluateSuccessResponse struct {
	OFREPEvaluateSuccessResponse `json:",inline"`

	ErrorCode    string `json:"errorCode,omitempty"`
	ErrorDetails string `json:"errorDetails,omitempty"`
}

type OFREPSSEEvent

type OFREPSSEEvent struct {
	// Type of the event, providers must ignore the types they don't know.
	Type string `json:"type" example:"refetchEvaluation"`
	// LastModified is the unix timestamp (in seconds) of the flag configuration change.
	LastModified int64 `json:"lastModified,omitempty" example:"1771622898"`
}

OFREPSSEEvent is the payload of the events sent on the OFREP SSE stream, as defined by OpenFeature ADR-0008.

Jump to

Keyboard shortcuts

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