model

package
v1.56.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 5 Imported by: 4

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 {
	// Deprecated: User The representation of a user for your feature flag system.
	User *UserRequest `` // nolint: lll
	/* 158-byte string literal not displayed */
	// 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
}

type CollectEvalDataRequest added in v1.7.0

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 added in v1.7.0

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
}

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 added in v1.12.0

type EvaluationContextRequest struct {
	// Key is the identifier of the UserRequest.
	Key string `json:"key" xml:"key" form:"key" query:"key" example:"08b5ffb7-7109-42f4-a6f2-b85560fbd20f"`

	// Custom is a map containing all extra information for this user.
	Custom map[string]any `` // nolint: lll
	/* 177-byte string literal not displayed */
}

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
}

InfoResponse is the object returned by the info API

type ManifestDefinitionSuccessResponse added in v1.53.0

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

type ManifestError added in v1.53.0

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

type ManifestErrorDetails added in v1.53.0

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

type ManifestSuccessResponse added in v1.53.0

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

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

type OFREPBulkEvaluateSuccessResponse added in v1.24.0

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

type OFREPCommonResponseError added in v1.43.0

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

func (*OFREPCommonResponseError) Error added in v1.43.0

func (o *OFREPCommonResponseError) Error() string

type OFREPEvalFlagRequest added in v1.24.0

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

nolint: lll

type OFREPEvaluateResponseError added in v1.43.0

type OFREPEvaluateResponseError struct {
	OFREPCommonResponseError `       json:",inline" yaml:",inline" toml:",inline"`
	Key                      string `json:"key"`
}

type OFREPEvaluateSuccessResponse added in v1.24.0

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"`
}

type OFREPEventStream added in v1.56.0

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 added in v1.24.0

type OFREPFlagBulkEvaluateSuccessResponse struct {
	OFREPEvaluateSuccessResponse `json:",inline"`
	ErrorCode                    string `json:"errorCode,omitempty"`
	ErrorDetails                 string `json:"errorDetails,omitempty"`
}

type OFREPSSEEvent added in v1.56.0

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.

type UserRequest deprecated

type UserRequest struct {
	// Key is the identifier of the UserRequest.
	Key string `json:"key" xml:"key" form:"key" query:"key" example:"08b5ffb7-7109-42f4-a6f2-b85560fbd20f"`

	// Anonymous set if this is a logged-in user or not.
	Anonymous bool `json:"anonymous" xml:"anonymous" form:"anonymous" query:"anonymous" example:"false"`

	// Custom is a map containing all extra information for this user.
	Custom map[string]any `` // nolint: lll
	/* 177-byte string literal not displayed */
}

Deprecated: UserRequest The representation of a user for your feature flag system.

Jump to

Keyboard shortcuts

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