Documentation ¶
Index ¶
- Constants
- func Handler(handlerID string, m Middleware, h http.Handler) http.Handler
- type Configuration
- type ConnectService
- func (s *ConnectService) EventStream(ctx context.Context, req *connect.Request[schemaV1.EventStreamRequest], ...) error
- func (s *ConnectService) Notify(n Notification)
- func (s *ConnectService) ResolveAll(ctx context.Context, req *connect.Request[schemaV1.ResolveAllRequest]) (*connect.Response[schemaV1.ResolveAllResponse], error)
- func (s *ConnectService) ResolveBoolean(ctx context.Context, req *connect.Request[schemaV1.ResolveBooleanRequest]) (*connect.Response[schemaV1.ResolveBooleanResponse], error)
- func (s *ConnectService) ResolveFloat(ctx context.Context, req *connect.Request[schemaV1.ResolveFloatRequest]) (*connect.Response[schemaV1.ResolveFloatResponse], error)
- func (s *ConnectService) ResolveInt(ctx context.Context, req *connect.Request[schemaV1.ResolveIntRequest]) (*connect.Response[schemaV1.ResolveIntResponse], error)
- func (s *ConnectService) ResolveObject(ctx context.Context, req *connect.Request[schemaV1.ResolveObjectRequest]) (*connect.Response[schemaV1.ResolveObjectResponse], error)
- func (s *ConnectService) ResolveString(ctx context.Context, req *connect.Request[schemaV1.ResolveStringRequest]) (*connect.Response[schemaV1.ResolveStringResponse], error)
- func (s *ConnectService) Serve(ctx context.Context, eval eval.IEvaluator, svcConf Configuration) error
- type ConnectServiceConfiguration
- type HTTPProperties
- type HTTPReqProperties
- type IService
- type Middleware
- type Notification
- type NotificationType
- type OTelMetricsRecorder
- func (r OTelMetricsRecorder) OTelInFlightRequestEnd(p HTTPReqProperties)
- func (r OTelMetricsRecorder) OTelInFlightRequestStart(p HTTPReqProperties)
- func (r OTelMetricsRecorder) OTelObserveHTTPRequestDuration(p HTTPReqProperties, duration time.Duration)
- func (r OTelMetricsRecorder) OTelObserveHTTPResponseSize(p HTTPReqProperties, sizeBytes int64)
- type ReadinessProbe
- type Recorder
- type Reporter
Constants ¶
View Source
const ErrorPrefix = "FlagdError:"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Configuration ¶
type Configuration struct {
ReadinessProbe ReadinessProbe
}
type ConnectService ¶
type ConnectService struct { Logger *logger.Logger Eval eval.IEvaluator ConnectServiceConfiguration *ConnectServiceConfiguration // contains filtered or unexported fields }
func (*ConnectService) EventStream ¶
func (s *ConnectService) EventStream( ctx context.Context, req *connect.Request[schemaV1.EventStreamRequest], stream *connect.ServerStream[schemaV1.EventStreamResponse], ) error
func (*ConnectService) Notify ¶
func (s *ConnectService) Notify(n Notification)
func (*ConnectService) ResolveAll ¶
func (s *ConnectService) ResolveAll( ctx context.Context, req *connect.Request[schemaV1.ResolveAllRequest], ) (*connect.Response[schemaV1.ResolveAllResponse], error)
func (*ConnectService) ResolveBoolean ¶
func (s *ConnectService) ResolveBoolean( ctx context.Context, req *connect.Request[schemaV1.ResolveBooleanRequest], ) (*connect.Response[schemaV1.ResolveBooleanResponse], error)
func (*ConnectService) ResolveFloat ¶
func (s *ConnectService) ResolveFloat( ctx context.Context, req *connect.Request[schemaV1.ResolveFloatRequest], ) (*connect.Response[schemaV1.ResolveFloatResponse], error)
func (*ConnectService) ResolveInt ¶
func (s *ConnectService) ResolveInt( ctx context.Context, req *connect.Request[schemaV1.ResolveIntRequest], ) (*connect.Response[schemaV1.ResolveIntResponse], error)
func (*ConnectService) ResolveObject ¶
func (s *ConnectService) ResolveObject( ctx context.Context, req *connect.Request[schemaV1.ResolveObjectRequest], ) (*connect.Response[schemaV1.ResolveObjectResponse], error)
func (*ConnectService) ResolveString ¶
func (s *ConnectService) ResolveString( ctx context.Context, req *connect.Request[schemaV1.ResolveStringRequest], ) (*connect.Response[schemaV1.ResolveStringResponse], error)
func (*ConnectService) Serve ¶
func (s *ConnectService) Serve(ctx context.Context, eval eval.IEvaluator, svcConf Configuration) error
type HTTPProperties ¶
type HTTPReqProperties ¶
type IService ¶
type IService interface { Serve(ctx context.Context, eval eval.IEvaluator, svcConf Configuration) error Notify(n Notification) }
IService implementations define handlers for a particular transport, which call the IEvaluator implementation.
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg middlewareConfig) Middleware
func (Middleware) Measure ¶
func (m Middleware) Measure(handlerID string, reporter Reporter, next func())
type Notification ¶
type Notification struct { Type NotificationType `json:"type"` Data map[string]interface{} `json:"data"` }
type NotificationType ¶
type NotificationType string
const ( ConfigurationChange NotificationType = "configuration_change" ProviderReady NotificationType = "provider_ready" KeepAlive NotificationType = "keep_alive" )
type OTelMetricsRecorder ¶
type OTelMetricsRecorder struct {
// contains filtered or unexported fields
}
func (OTelMetricsRecorder) OTelInFlightRequestEnd ¶
func (r OTelMetricsRecorder) OTelInFlightRequestEnd(p HTTPReqProperties)
func (OTelMetricsRecorder) OTelInFlightRequestStart ¶
func (r OTelMetricsRecorder) OTelInFlightRequestStart(p HTTPReqProperties)
func (OTelMetricsRecorder) OTelObserveHTTPRequestDuration ¶
func (r OTelMetricsRecorder) OTelObserveHTTPRequestDuration(p HTTPReqProperties, duration time.Duration)
func (OTelMetricsRecorder) OTelObserveHTTPResponseSize ¶
func (r OTelMetricsRecorder) OTelObserveHTTPResponseSize(p HTTPReqProperties, sizeBytes int64)
type ReadinessProbe ¶
type ReadinessProbe func() bool
type Recorder ¶
type Recorder interface { // OTelObserveHTTPRequestDuration measures the duration of an HTTP request. OTelObserveHTTPRequestDuration(props HTTPReqProperties, duration time.Duration) // OTelObserveHTTPResponseSize measures the size of an HTTP response in bytes. OTelObserveHTTPResponseSize(props HTTPReqProperties, sizeBytes int64) // OTelInFlightRequestStart count the active requests. OTelInFlightRequestStart(props HTTPReqProperties) // OTelInFlightRequestEnd count the finished requests. OTelInFlightRequestEnd(props HTTPReqProperties) }
Click to show internal directories.
Click to hide internal directories.