Documentation
¶
Overview ¶
Package model defines the request and response models of the relay proxy HTTP API.
Index ¶
- Constants
- type AllFlagRequest
- type CollectEvalDataRequest
- type CollectEvalDataResponse
- type ConfigInfo
- type DynamicStatesInfo
- type EvalFlagRequest
- type EvaluationContextRequest
- type EventAcceleratorInfo
- type FlagEval
- type FlagSetInfo
- type FlagSourceIncompleteInfo
- type FlagSourceInfo
- type FlagSourceInvalidInfo
- type FlagSourceObjectInfo
- type HealthResponse
- type InfoResponse
- type ListenerInfo
- type LiveResponse
- type ManifestDefinitionSuccessResponse
- type ManifestError
- type ManifestErrorDetails
- type ManifestSuccessResponse
- type OFREPBulkEvaluateSuccessResponse
- type OFREPCommonResponseError
- type OFREPEvalFlagRequest
- type OFREPEvaluateResponseError
- type OFREPEvaluateSuccessResponse
- type OFREPEventStream
- type OFREPFlagBulkEvaluateSuccessResponse
- type OFREPNotFoundResponseError
- type OFREPSSEEvent
- type ObjectInfo
- type OpenTelemetryInfo
- type OpenTelemetrySignal
- type ProblemInfo
- type PublicInfo
- type ReadyResponse
- type ReloadInfo
- type RequestLimitInfo
- type SegmentBindingsInfo
- type SegmentCountsInfo
- type SegmentSnapshotInfo
- type SegmentStoreInfo
- type StalenessInfo
- type StateInfo
- type UnknownFieldsInfo
- type WithdrawnInfo
Constants ¶
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 `hidden:"true" json:"user,omitempty"`
// EvaluationContext The representation of a EvaluationContext for your feature flag system.
EvaluationContext *EvaluationContextRequest `form:"evaluationContext" json:"evaluationContext,omitempty" query:"evaluationContext" xml:"evaluationContext,omitempty"` //nolint:lll // struct tags (json, yaml, toml, jsonschema, mapstructure) can not be wrapped
}
AllFlagRequest is the request body of the all flags evaluation API.
type CollectEvalDataRequest ¶
type CollectEvalDataRequest struct {
// Meta are the extra information added during the configuration
Meta exporter.FeatureEventMetadata `json:"meta" required:"false"`
// 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" required:"false"`
}
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 `form:"ingestedContentCount" json:"ingestedContentCount" query:"ingestedContentCount" xml:"ingestedContentCount"` //nolint:lll // struct tags (json, yaml, toml, jsonschema, mapstructure) can not be wrapped
}
CollectEvalDataResponse is the object returned by the health API.
type ConfigInfo ¶ added in v0.2.0
type ConfigInfo struct {
// FlagSources is the state of the change source and of the flag data it feeds: the flag set files the relay found.
FlagSources *FlagSourceInfo `json:"flagSources,omitempty"`
// RequestLimits are the connections that have maxRequestsPerSecond, with the requests each one refused because
// the limit was reached; left out when no connection has a limit.
RequestLimits []RequestLimitInfo `json:"requestLimits,omitempty"`
// EventAccelerator is the state of the event accelerator (S3 notifications through SQS); absent
// when the file does not configure it. A queue that is down shows here and never makes the relay not ready.
EventAccelerator *EventAcceleratorInfo `json:"eventAccelerator,omitempty"`
// LastRejected is the most recent rejected round, kept until a later applied round supersedes it; absent then.
LastRejected *ReloadInfo `json:"lastRejected,omitempty"`
// Reloads counts the rounds by outcome: applied, rejected, ignored.
Reloads map[string]uint64 `json:"reloads"`
// Staleness says how long ago the held configuration was last confirmed by the sources.
Staleness StalenessInfo `json:"staleness"`
// LastReload is the most recent round of any outcome.
LastReload ReloadInfo `json:"lastReload"`
// LastApplied is the most recent applied round.
LastApplied ReloadInfo `json:"lastApplied"`
// FlagSets are the flag sets by name.
FlagSets []FlagSetInfo `json:"flagSets"`
// Objects are the source objects by name.
Objects []ObjectInfo `json:"objects"`
// SegmentStores are the connections that can serve dynamic segments, with their state; left out when the file has
// none.
SegmentStores []SegmentStoreInfo `json:"segmentStores,omitempty"`
// SegmentBindings is what the flag sets share of the dynamic segments; left out when none is served.
SegmentBindings *SegmentBindingsInfo `json:"segmentBindings,omitempty"`
// UnknownFields reports unknown fields noticed in flag files and segments files, by kind; absent when zero.
UnknownFields []UnknownFieldsInfo `json:"unknownFields,omitempty"`
// Withdrawn lists the flag sets that the sources do not hold any more.
Withdrawn []WithdrawnInfo `json:"withdrawn"`
// PendingRestart names the settings that changed and need a restart.
PendingRestart []string `json:"pendingRestart"`
// Public says which flag sets serve the requests without an API key: the flag sets defined without a key.
Public PublicInfo `json:"public"`
// State says how the cache directory is doing.
State StateInfo `json:"state"`
// DisabledAdminKeys counts the admin keys that are not accepted because a flag set defines the same key.
DisabledAdminKeys int `json:"disabledAdminKeys"`
// Generation is the applied generation, Snapshot the local swap counter.
Generation uint64 `json:"generation"`
Snapshot uint64 `json:"snapshot"`
}
ConfigInfo is what /info says about the config v2 runtime. It never holds an API key, an admin key, a secret or the bytes of an object.
type DynamicStatesInfo ¶ added in v0.2.0
type DynamicStatesInfo struct {
// Valid is the number of dynamic segments that the connections can serve.
Valid int `json:"valid"`
// Rejected is the number of dynamic definitions that were rejected.
Rejected int `json:"rejected"`
// StoreError is the number of served segments, among Valid, whose store failed on the last call or whose breaker
// is open: they answer not a member with STORE_ERROR. Healthy is the number of the others.
StoreError int `json:"storeError"`
// Healthy is the number of served segments, among Valid, whose store answers.
Healthy int `json:"healthy"`
}
DynamicStatesInfo is the dynamic segments of a flag set by state. A rejected definition is one that the connections of the bootstrap file cannot serve (a connection that is not in the file, a store that cannot serve the mode): it is rejected alone, the rest of its document is applied, and it answers as a segment without a provider. The reasons are in the log, never in this answer.
type EvalFlagRequest ¶
type EvalFlagRequest struct {
AllFlagRequest
// The value will we use if we are not able to get the variation of the flag.
DefaultValue any `form:"defaultValue" json:"defaultValue" query:"defaultValue" required:"false" xml:"defaultValue"`
}
EvalFlagRequest is the request body of a single flag evaluation API.
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
/* 194-byte string literal not displayed */
// Key is the identifier of the evaluation context.
Key string `example:"08b5ffb7-7109-42f4-a6f2-b85560fbd20f" form:"key" json:"key" query:"key" required:"false" xml:"key"` //nolint:lll // struct tags can not be wrapped
}
EvaluationContextRequest The representation of a EvaluationContext for your feature flag system.
type EventAcceleratorInfo ¶ added in v1.0.0
type EventAcceleratorInfo struct {
LastMessage *time.Time `json:"lastMessage,omitempty"`
LastDeleteError *time.Time `json:"lastDeleteError,omitempty"`
Messages map[string]uint64 `json:"messages"`
Polls map[string]uint64 `json:"polls"`
State string `json:"state"`
ReceiveErrors uint64 `json:"receiveErrors"`
DeleteErrors uint64 `json:"deleteErrors"`
MinIntervalSeconds float64 `json:"minIntervalSeconds"`
}
EventAcceleratorInfo is the state of the event accelerator. It holds no queue address and no error text.
type FlagEval ¶
type FlagEval struct {
Value any `json:"value"`
}
FlagEval is the response body of a flag evaluation.
type FlagSetInfo ¶ added in v0.2.0
type FlagSetInfo struct {
Name string `json:"name"`
State string `json:"state"`
Problems []ProblemInfo `json:"problems"`
Flags int `json:"flags"`
APIKeys int `json:"apiKeys"`
Rejected int `json:"rejected"`
// Segments counts the segments of the flag set by kind; it is left out for a flag set without segments.
Segments *SegmentCountsInfo `json:"segments,omitempty"`
}
FlagSetInfo is the state of one flag set: ready, degraded or pending.
type FlagSourceIncompleteInfo ¶ added in v1.3.0
type FlagSourceIncompleteInfo struct {
// Source is the connection and the prefix.
Source string `json:"source"`
// Reason is one of unavailable, refused, unresolved.
Reason string `json:"reason"`
// Detail is bounded text about the failure.
Detail string `json:"detail"`
}
FlagSourceIncompleteInfo is a place that the last pass could not list.
type FlagSourceInfo ¶ added in v1.3.0
type FlagSourceInfo struct {
// LastPass is the time of the last successful pass; absent before one.
LastPass *time.Time `json:"lastPass,omitempty"`
// LastErrorAt is the time of LastError.
LastErrorAt *time.Time `json:"lastErrorAt,omitempty"`
// ContentChecksum is the sha256 of the computed content without its generation: the same on relays that read
// the same files, whatever their generation numbers are.
ContentChecksum string `json:"contentChecksum"`
// LastError is why the last pass failed; empty when it succeeded.
LastError string `json:"lastError,omitempty"`
// Objects lists the objects of the computed content: the files the relay serves from.
Objects []FlagSourceObjectInfo `json:"objects"`
// Invalid lists the flag set files that cannot be served as they are.
Invalid []FlagSourceInvalidInfo `json:"invalid"`
// IncompleteSources lists the places (a connection and a prefix) that the last pass could not list: their flag sets
// stay exactly as they were.
IncompleteSources []FlagSourceIncompleteInfo `json:"incompleteSources,omitempty"`
// WaitingFor names the sources that a relay that is not ready yet still waits for (a connection and a prefix).
WaitingFor []string `json:"waitingFor,omitempty"`
// StartTimedOut says that flagSets.startTimeout ended the wait of the start: the relay is ready without the
// sources of incompleteSources, and the API keys of their flag sets answer as unknown keys until they are listed.
StartTimedOut bool `json:"startTimedOut,omitempty"`
// Generation is the computed generation of this relay, not comparable between relays.
Generation uint64 `json:"generation"`
// Passes and Failures count the passes and the failed ones.
Passes uint64 `json:"passes"`
Failures uint64 `json:"failures"`
// FlagSets and Flags count what the last successful pass computed.
FlagSets int `json:"flagSets"`
Flags int `json:"flags"`
}
FlagSourceInfo is the state of the flag sources: the relay reads flag set files and computes what it serves.
type FlagSourceInvalidInfo ¶ added in v1.3.0
type FlagSourceInvalidInfo struct {
File string `json:"file"`
Reason string `json:"reason"`
// KeptPrevious tells that the flag set serves its last good version.
KeptPrevious bool `json:"keptPrevious"`
}
FlagSourceInvalidInfo is a flag set file that cannot be served as it is.
type FlagSourceObjectInfo ¶ added in v1.3.0
type FlagSourceObjectInfo struct {
Name string `json:"name"`
Kind string `json:"kind"`
Connection string `json:"connection"`
Key string `json:"key"`
Checksum string `json:"checksum"`
Size int64 `json:"size"`
}
FlagSourceObjectInfo is one object of the computed content.
type HealthResponse ¶
type HealthResponse struct {
// Set to true if the HTTP server is started
Initialized bool `example:"true" json:"initialized"`
}
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 `example:"2022-06-13T11:22:55.941628+02:00" json:"cacheRefresh,omitempty"`
// 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 `example:"{\"default\":\"2022-06-13T11:22:55.941628+02:00\"}" json:"flagsets,omitempty"` //nolint:lll // struct tags (json, yaml, toml, jsonschema, mapstructure) can not be wrapped
// Config is the state of the config v2 runtime: generation, reloads, flag sets and objects.
Config *ConfigInfo `json:"config,omitempty"`
// OpenTelemetry says whether OpenTelemetry is on, and how: per signal the exporter, the protocol and the host of the
// endpoint. It holds no path, query, header or credential.
OpenTelemetry *OpenTelemetryInfo `json:"openTelemetry,omitempty"`
// Listeners are the listeners that serve TLS, with the certificate each serves now; left out when none does.
Listeners []ListenerInfo `json:"listeners,omitempty"`
}
InfoResponse is the object returned by the info API.
type ListenerInfo ¶ added in v0.3.0
type ListenerInfo struct {
// NotBefore and NotAfter are the validity of the certificate.
NotBefore time.Time `json:"notBefore"`
NotAfter time.Time `json:"notAfter"`
// Name is the name of the listener role: "api" or "ops".
Name string `json:"name"`
// Source is where the certificate comes from: "files", "env" or "selfSigned".
Source string `json:"source"`
// Fingerprint is the SHA-256 of the DER certificate, in lower case hexadecimal.
Fingerprint string `json:"fingerprintSha256"`
// Certificate is the PEM certificate (public part), set for a generated certificate so that a client can pin it.
Certificate string `json:"certificate,omitempty"`
// Names are the DNS names and IP addresses of the certificate.
Names []string `json:"names"`
}
ListenerInfo is the certificate a TLS listener serves. It never holds a private key.
type LiveResponse ¶ added in v0.2.0
type LiveResponse struct {
// Live is true while the process serves.
Live bool `example:"true" json:"live"`
}
LiveResponse is the body of /livez.
type ManifestDefinitionSuccessResponse ¶
type ManifestDefinitionSuccessResponse struct {
Key string `json:"key"`
FlagType model.FlagType `enum:"boolean,string,integer,float,object" json:"type"`
DefaultValue any `json:"defaultValue"`
Description string `json:"description"`
}
ManifestDefinitionSuccessResponse is the response body of a successful flag manifest request.
type ManifestError ¶
type ManifestError struct {
ErrorDetails ManifestErrorDetails `json:"error"`
}
ManifestError is the error response of the flag manifest API.
type ManifestErrorDetails ¶
type ManifestErrorDetails struct {
Message string `example:"Authorization header required" json:"message"`
Status int `example:"401" json:"status"`
}
ManifestErrorDetails holds the details of a flag manifest error.
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"`
}
OFREPBulkEvaluateSuccessResponse is the response body of a successful OFREP bulk evaluation.
type OFREPCommonResponseError ¶
type OFREPCommonResponseError struct {
ErrorCode flagdef.ErrorCode `` //nolint:lll // struct tags can not be wrapped
/* 141-byte string literal not displayed */
ErrorDetails string `json:"errorDetails"`
// Reason is ERROR in a 400 body (the .NET OFREP provider copies it from the error body).
Reason string `enum:"ERROR" json:"reason,omitempty"`
}
OFREPCommonResponseError is the error response shared by the OFREP endpoints.
func (*OFREPCommonResponseError) Error ¶
func (o *OFREPCommonResponseError) Error() string
type OFREPEvalFlagRequest ¶
type OFREPEvalFlagRequest struct {
Context map[string]any `` /* 216-byte string literal not displayed */
}
OFREPEvalFlagRequest is the request body of an OFREP flag evaluation.
type OFREPEvaluateResponseError ¶
type OFREPEvaluateResponseError struct {
OFREPCommonResponseError `yaml:",inline"`
Key string `json:"key"`
}
OFREPEvaluateResponseError is the error response of an OFREP flag evaluation.
type OFREPEvaluateSuccessResponse ¶
type OFREPEvaluateSuccessResponse struct {
Key string `json:"key"`
Value any `json:"value,omitempty"`
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).
func (*OFREPEvaluateSuccessResponse) MarshalJSONTo ¶ added in v0.3.0
func (r *OFREPEvaluateSuccessResponse) MarshalJSONTo(enc *jsontext.Encoder) error
MarshalJSONTo is the streaming method that encoding/json calls (in the Go versions that build it on encoding/json/v2). A result whose value is a stored encoding is written from a struct that holds the bytes as raw JSON: an interface that holds a value of a type with a method of its own costs the encoder two allocations, the raw field none. Any other result is left to the default encoding (the method reports it unsupported before it writes anything), so what it writes and what it allocates are what they were.
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
ErrorCode string `json:"errorCode,omitempty"`
ErrorDetails string `json:"errorDetails,omitempty"`
}
OFREPFlagBulkEvaluateSuccessResponse is the result of one flag in an OFREP bulk evaluation.
func (*OFREPFlagBulkEvaluateSuccessResponse) MarshalJSONTo ¶ added in v0.3.0
func (r *OFREPFlagBulkEvaluateSuccessResponse) MarshalJSONTo(enc *jsontext.Encoder) error
MarshalJSONTo is the streaming method of the item: see OFREPEvaluateSuccessResponse.MarshalJSONTo. It is defined here too because the method of the embedded result would otherwise be promoted and drop the error fields.
type OFREPNotFoundResponseError ¶ added in v1.0.0
type OFREPNotFoundResponseError struct {
ErrorCode flagdef.ErrorCode `enum:"FLAG_NOT_FOUND" json:"errorCode"`
ErrorDetails string `json:"errorDetails"`
Key string `json:"key"`
}
OFREPNotFoundResponseError is the 404 response of an OFREP flag evaluation (the flag does not exist): no reason.
type OFREPSSEEvent ¶
type OFREPSSEEvent struct {
// Type of the event, providers must ignore the types they don't know.
Type string `example:"refetchEvaluation" json:"type"`
// ETag identifies the flag configuration that the change leads to. A provider sends it back as the
// flagConfigEtag query parameter of its re-fetch, so that a relay that has not loaded that configuration yet
// checks its control plane before it answers.
ETag string `example:"3f9a1c" json:"etag,omitempty"`
// LastModified is the unix timestamp (in seconds) of the flag configuration change.
LastModified int64 `example:"1771622898" json:"lastModified,omitempty"`
}
OFREPSSEEvent is the payload of the events sent on the OFREP SSE stream, as defined by OpenFeature ADR-0008.
type ObjectInfo ¶ added in v0.2.0
type ObjectInfo struct {
Name string `json:"name"`
Kind string `json:"kind"`
State string `json:"state"`
// Reason is the closed code of the failure of the last load of the object, empty when it loaded.
Reason string `json:"reason,omitempty"`
// ChecksumHeld is the checksum of the content served, ChecksumListed the one the manifest lists.
ChecksumHeld string `json:"checksumHeld"`
ChecksumListed string `json:"checksumListed,omitempty"`
Flags int `json:"flags"`
Rejected int `json:"rejected"`
// Kept is the number of rejected flags that are served from an earlier version of the object. The cache directory
// holds the bytes of the object, not that earlier version: a restart serves none of these flags.
Kept int `json:"kept"`
}
ObjectInfo is the state of one source object: ok, stale, missing, pending or invalid.
type OpenTelemetryInfo ¶ added in v1.3.0
type OpenTelemetryInfo struct {
// Traces and Metrics describe a signal that is on; they are left out for a signal that is off.
Traces *OpenTelemetrySignal `json:"traces,omitempty"`
Metrics *OpenTelemetrySignal `json:"metrics,omitempty"`
// Reason is why OpenTelemetry is off; empty when it is on.
Reason string `json:"reason,omitempty"`
// ServiceName is the name of the service of the resource.
ServiceName string `json:"serviceName,omitempty"`
// ServiceNameSource says where the service name comes from: "bootstrap", "environment" or "default".
ServiceNameSource string `json:"serviceNameSource,omitempty"`
// Propagators are the headers that the propagator reads and writes.
Propagators []string `json:"propagators,omitempty"`
// Enabled is true when at least one signal is on.
Enabled bool `json:"enabled"`
}
OpenTelemetryInfo is the state of OpenTelemetry of the relay.
type OpenTelemetrySignal ¶ added in v1.3.0
type OpenTelemetrySignal struct {
// Exporter is "otlp", "console" or another exporter that OTEL_*_EXPORTER names.
Exporter string `json:"exporter"`
// Protocol is the protocol of the OTLP exporter; empty for another exporter.
Protocol string `json:"protocol,omitempty"`
// Endpoint is the host and port of the collector, nothing else; empty for an exporter without an endpoint.
Endpoint string `json:"endpoint,omitempty"`
// Sampler is the sampler of the traces: the name that selects it, with its argument when there is one.
Sampler string `json:"sampler,omitempty"`
// SamplerSource says where the sampler comes from: "bootstrap", "environment" or "default".
SamplerSource string `json:"samplerSource,omitempty"`
// SamplerConfigured is the setting as it was written, when the SDK did not take it as it is (an unknown name, a bad
// ratio); Sampler is what runs.
SamplerConfigured string `json:"samplerConfigured,omitempty"`
// Source says where the exporter and the endpoint come from: "environment", "bootstrap" or "default".
Source string `json:"source"`
}
OpenTelemetrySignal is one signal (traces or metrics) that is on.
type ProblemInfo ¶ added in v0.2.0
ProblemInfo is a reported problem of a flag set: a closed code and the object it is about. The free text of the problem is not served, for it can quote the content of an object.
type PublicInfo ¶ added in v0.2.0
type PublicInfo struct {
// Sets are the names of the flag sets, sorted.
Sets []string `json:"sets"`
Flags int `json:"flags"`
Present bool `json:"present"`
}
PublicInfo is the status of the public namespace: the flag sets defined without an API key, merged. Present says that a request without a key is served.
type ReadyResponse ¶ added in v0.2.0
type ReadyResponse struct {
// State is set when ready: empty, serving or degraded.
State string `example:"serving" json:"state,omitempty"`
// Reason is set when not ready: starting, waiting-for-flag-sets, waiting-for-segment-stores or shutting-down.
Reason string `example:"waiting-for-flag-sets" json:"reason,omitempty"`
// Ready is true when the relay is able to serve.
Ready bool `example:"true" json:"ready"`
}
ReadyResponse is the body of /readyz and /startupz. It holds a fixed word and a flag, nothing else: no key, name, path, count or error text. The sources a relay waits for are in /info (ops listener).
type ReloadInfo ¶ added in v0.2.0
type ReloadInfo struct {
// At is when the round ended; absent before the first round.
At *time.Time `json:"at,omitempty"`
Outcome string `json:"outcome"`
Code string `json:"code"`
Generation uint64 `json:"generation"`
}
ReloadInfo is the result of one round.
The free text of a round (the detail) is not served: it can quote the content of an object. The code is a closed reason; the detail is in the logs.
type RequestLimitInfo ¶ added in v1.3.0
type RequestLimitInfo struct {
// Connection is the name of the connection.
Connection string `json:"connection"`
// MaxPerSecond is the limit of maxRequestsPerSecond.
MaxPerSecond int `json:"maxPerSecond"`
// Refused counts the requests that were not made because the limit was reached.
Refused uint64 `json:"refused"`
}
RequestLimitInfo is the request limit of one connection.
type SegmentBindingsInfo ¶ added in v0.2.0
type SegmentBindingsInfo struct {
// Snapshots is the state of the held sets (snapshot mode) of each connection.
Snapshots []SegmentSnapshotInfo `json:"snapshots,omitempty"`
// Live is the number of bindings that the served runtime uses.
Live int `json:"live"`
}
SegmentBindingsInfo is the shared state of the dynamic segments: one binding serves every flag set and every generation that uses one segments object on one connection.
type SegmentCountsInfo ¶ added in v0.2.0
type SegmentCountsInfo struct {
// DynamicStates tells how many of the dynamic definitions are valid and how many were rejected; it is left out
// when the flag set has no dynamic segment and no rejection.
DynamicStates *DynamicStatesInfo `json:"dynamicStates,omitempty"`
// UnresolvedNames are the first segment names (sorted, bounded) that flags of the flag set use and no segments
// object of the flag set defines; Unresolved is how many there are. Names only.
UnresolvedNames []string `json:"unresolvedNames,omitempty"`
Static int `json:"static"`
Dynamic int `json:"dynamic"`
Unresolved int `json:"unresolved,omitempty"`
}
SegmentCountsInfo is the number of segments of a flag set: static (members in the document) and dynamic (members in a store).
type SegmentSnapshotInfo ¶ added in v0.2.0
type SegmentSnapshotInfo struct {
Connection string `json:"connection"`
Loaded int `json:"loaded"`
Stale int `json:"stale"`
Missing int `json:"missing"`
NeverLoaded int `json:"neverLoaded"`
Members int `json:"members"`
}
SegmentSnapshotInfo counts the held sets of one connection by state: loaded, stale (the last refresh failed or the set is over the limit), missing (the store does not have the segment) and never loaded; Members is the total.
type SegmentStoreInfo ¶ added in v0.2.0
type SegmentStoreInfo struct {
Name string `json:"name"`
Kind string `json:"kind"`
State string `json:"state"`
}
SegmentStoreInfo is the state of one connection that can serve dynamic segments: idle (no segment uses it), connecting, connected or error (the last dial failed; it is dialled again until it works).
type StalenessInfo ¶ added in v0.2.0
type StalenessInfo struct {
// LastConfirmed is the last pass that confirmed the held flag data, absent when there was none.
LastConfirmed *time.Time `json:"lastConfirmed,omitempty"`
// LastSuccessfulReload is the last applied round, absent when there was none.
LastSuccessfulReload *time.Time `json:"lastSuccessfulReload,omitempty"`
// AgeSeconds is the time since LastConfirmed, 0 when there was none.
AgeSeconds float64 `json:"ageSeconds"`
}
StalenessInfo is the age of the configuration.
type StateInfo ¶ added in v0.2.0
type StateInfo struct {
// LastSaveError is the closed code of the failure of the last write (no-space, denied, io, unsafe), empty when it
// worked.
LastSaveError string `json:"lastSaveError"`
// Saves and SaveErrors count the writes that ended, and the ones that failed.
Saves uint64 `json:"saves"`
SaveErrors uint64 `json:"saveErrors"`
// KeptFlags is the number of flags, over all objects, that are served from an earlier version of their object
// and that a restart from the cache directory would not serve (see ObjectInfo.Kept).
KeptFlags int `json:"keptFlags"`
// Enabled tells that a cache directory is in use.
Enabled bool `json:"enabled"`
}
StateInfo is the cache directory as /info shows it: whether one is in use, and whether the writes work. A write that fails never stops the relay from serving; this is where it shows.
type UnknownFieldsInfo ¶ added in v0.2.0
type UnknownFieldsInfo struct {
// Kind is the document kind ("flags", "segments").
Kind string `json:"kind"`
// Fields lists the first field paths (bounded, sorted), never field values.
Fields []string `json:"fields,omitempty"`
// Count is the total number of unknown fields across documents of this kind.
Count int `json:"count"`
}
UnknownFieldsInfo reports unknown fields noticed when decoding flag files and segments files of one kind.
type WithdrawnInfo ¶ added in v0.2.0
WithdrawnInfo is a flag set whose file was removed.
Source Files
¶
- collect_eval_data_request.go
- collect_eval_data_response.go
- doc.go
- flag_eval_response.go
- health_response.go
- info_accelerator.go
- info_config.go
- info_flagsources.go
- info_flagsources_claims.go
- info_resources.go
- info_response.go
- info_segments.go
- info_unknown.go
- manifest_error.go
- manifest_success.go
- ofrep_bulk_success_response.go
- ofrep_error_response.go
- ofrep_requests.go
- ofrep_sse_event.go
- ofrep_success_response.go
- probe_response.go
- user_request.go