Documentation ¶
Index ¶
- Constants
- func Handler(handlerID string, m Middleware, h http.Handler) http.Handler
- func HandlerProvider(handlerID string, m Middleware) func(http.Handler) http.Handler
- type ConnectService
- func (s *ConnectService) EventStream(ctx context.Context, req *connect.Request[emptypb.Empty], ...) error
- func (s *ConnectService) Notify(n Notification)
- 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) error
- type ConnectServiceConfiguration
- type HTTPProperties
- type HTTPReqProperties
- type IService
- type IServiceConfiguration
- type MetricsRecorder
- type Middleware
- type Notification
- type NotificationType
- type Recorder
- type Reporter
Constants ¶
View Source
const ErrorPrefix = "FlagdError:"
Variables ¶
This section is empty.
Functions ¶
func HandlerProvider ¶ added in v0.2.3
Types ¶
type ConnectService ¶ added in v0.2.0
type ConnectService struct { Logger *log.Entry Eval eval.IEvaluator ConnectServiceConfiguration *ConnectServiceConfiguration // contains filtered or unexported fields }
func (*ConnectService) EventStream ¶ added in v0.2.3
func (s *ConnectService) EventStream( ctx context.Context, req *connect.Request[emptypb.Empty], stream *connect.ServerStream[schemaV1.EventStreamResponse], ) error
func (*ConnectService) Notify ¶ added in v0.2.3
func (s *ConnectService) Notify(n Notification)
func (*ConnectService) ResolveBoolean ¶ added in v0.2.0
func (s *ConnectService) ResolveBoolean( ctx context.Context, req *connect.Request[schemaV1.ResolveBooleanRequest], ) (*connect.Response[schemaV1.ResolveBooleanResponse], error)
func (*ConnectService) ResolveFloat ¶ added in v0.2.0
func (s *ConnectService) ResolveFloat( ctx context.Context, req *connect.Request[schemaV1.ResolveFloatRequest], ) (*connect.Response[schemaV1.ResolveFloatResponse], error)
func (*ConnectService) ResolveInt ¶ added in v0.2.0
func (s *ConnectService) ResolveInt( ctx context.Context, req *connect.Request[schemaV1.ResolveIntRequest], ) (*connect.Response[schemaV1.ResolveIntResponse], error)
func (*ConnectService) ResolveObject ¶ added in v0.2.0
func (s *ConnectService) ResolveObject( ctx context.Context, req *connect.Request[schemaV1.ResolveObjectRequest], ) (*connect.Response[schemaV1.ResolveObjectResponse], error)
func (*ConnectService) ResolveString ¶ added in v0.2.0
func (s *ConnectService) ResolveString( ctx context.Context, req *connect.Request[schemaV1.ResolveStringRequest], ) (*connect.Response[schemaV1.ResolveStringResponse], error)
func (*ConnectService) Serve ¶ added in v0.2.0
func (s *ConnectService) Serve(ctx context.Context, eval eval.IEvaluator) error
type ConnectServiceConfiguration ¶ added in v0.2.0
type HTTPProperties ¶ added in v0.2.3
type HTTPReqProperties ¶ added in v0.2.3
type IService ¶
type IService interface { Serve(ctx context.Context, eval eval.IEvaluator) error Notify(n Notification) }
IService implementations define handlers for a particular transport, which call the IEvaluator implementation.
type IServiceConfiguration ¶
type IServiceConfiguration interface{}
type MetricsRecorder ¶ added in v0.2.3
type MetricsRecorder struct {
// contains filtered or unexported fields
}
func NewRecorder ¶ added in v0.2.3
func NewRecorder(cfg prometheusConfig) *MetricsRecorder
func (MetricsRecorder) AddInflightRequests ¶ added in v0.2.3
func (r MetricsRecorder) AddInflightRequests(p HTTPProperties, quantity int)
func (MetricsRecorder) ObserveHTTPRequestDuration ¶ added in v0.2.3
func (r MetricsRecorder) ObserveHTTPRequestDuration(p HTTPReqProperties, duration time.Duration, )
func (MetricsRecorder) ObserveHTTPResponseSize ¶ added in v0.2.3
func (r MetricsRecorder) ObserveHTTPResponseSize(p HTTPReqProperties, sizeBytes int64)
type Middleware ¶ added in v0.2.3
type Middleware struct {
// contains filtered or unexported fields
}
func New ¶ added in v0.2.3
func New(cfg middlewareConfig) Middleware
func (Middleware) Measure ¶ added in v0.2.3
func (m Middleware) Measure(handlerID string, reporter Reporter, next func())
type Notification ¶ added in v0.2.3
type Notification struct { Type NotificationType `json:"type"` Data map[string]interface{} `json:"data"` }
type NotificationType ¶ added in v0.2.3
type NotificationType string
const ( ConfigurationChange NotificationType = "configuration_change" ProviderReady NotificationType = "provider_ready" KeepAlive NotificationType = "keep_alive" )
type Recorder ¶ added in v0.2.3
type Recorder interface { // ObserveHTTPRequestDuration measures the duration of an HTTP request. ObserveHTTPRequestDuration(props HTTPReqProperties, duration time.Duration) // ObserveHTTPResponseSize measures the size of an HTTP response in bytes. ObserveHTTPResponseSize(props HTTPReqProperties, sizeBytes int64) // AddInflightRequests increments and decrements the number of inflight request being // processed. AddInflightRequests(props HTTPProperties, quantity int) }
Click to show internal directories.
Click to hide internal directories.