Documentation ¶
Index ¶
- func MakeComponentInstrumentingMW(histogram metrics.Histogram) func(IDGeneratorComponent) IDGeneratorComponent
- func MakeComponentLoggingMW(logger log.Logger) func(IDGeneratorComponent) IDGeneratorComponent
- func MakeComponentTracingMW(tracer opentracing.Tracer) func(IDGeneratorComponent) IDGeneratorComponent
- func MakeComponentTrackingMW(sentry Sentry, logger log.Logger) func(IDGeneratorComponent) IDGeneratorComponent
- func MakeEndpointInstrumentingMW(h metrics.Histogram) endpoint.Middleware
- func MakeEndpointLoggingMW(logger log.Logger) endpoint.Middleware
- func MakeEndpointTracingMW(tracer opentracing.Tracer, operationName string) endpoint.Middleware
- func MakeGRPCNextIDHandler(e endpoint.Endpoint) *grpc_transport.Server
- func MakeGRPCNextValidIDHandler(e endpoint.Endpoint) *grpc_transport.Server
- func MakeGRPCTracingMW(tracer opentracing.Tracer, componentName, operationName string) func(grpc_transport.Handler) grpc_transport.Handler
- func MakeHTTPNextIDHandler(e endpoint.Endpoint) *http_transport.Server
- func MakeHTTPNextValidIDHandler(e endpoint.Endpoint) *http_transport.Server
- func MakeHTTPTracingMW(tracer opentracing.Tracer, componentName, operationName string) func(http.Handler) http.Handler
- func MakeModuleInstrumentingCounterMW(counter metrics.Counter) func(IDGeneratorModule) IDGeneratorModule
- func MakeModuleInstrumentingMW(histogram metrics.Histogram) func(IDGeneratorModule) IDGeneratorModule
- func MakeModuleLoggingMW(logger log.Logger) func(IDGeneratorModule) IDGeneratorModule
- func MakeModuleTracingMW(tracer opentracing.Tracer) func(IDGeneratorModule) IDGeneratorModule
- func MakeNextIDEndpoint(c IDGeneratorComponent) endpoint.Endpoint
- func MakeNextValidIDEndpoint(c IDGeneratorComponent) endpoint.Endpoint
- func NewGRPCServer(nextIDHandler, nextValidIDHandler grpc_transport.Handler) fb.FlakiServer
- type Component
- type Endpoints
- type Flaki
- type IDGeneratorComponent
- type IDGeneratorModule
- type Module
- type Sentry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeComponentInstrumentingMW ¶
func MakeComponentInstrumentingMW(histogram metrics.Histogram) func(IDGeneratorComponent) IDGeneratorComponent
MakeComponentInstrumentingMW makes an Instrumenting middleware at component level.
func MakeComponentLoggingMW ¶
func MakeComponentLoggingMW(logger log.Logger) func(IDGeneratorComponent) IDGeneratorComponent
MakeComponentLoggingMW makes a logging middleware at component level.
func MakeComponentTracingMW ¶
func MakeComponentTracingMW(tracer opentracing.Tracer) func(IDGeneratorComponent) IDGeneratorComponent
MakeComponentTracingMW makes a tracing middleware at component level.
func MakeComponentTrackingMW ¶
func MakeComponentTrackingMW(sentry Sentry, logger log.Logger) func(IDGeneratorComponent) IDGeneratorComponent
MakeComponentTrackingMW makes an error tracking middleware, where the errors are logged and sent to Sentry.
func MakeEndpointInstrumentingMW ¶
func MakeEndpointInstrumentingMW(h metrics.Histogram) endpoint.Middleware
MakeEndpointInstrumentingMW makes an Instrumenting middleware at endpoint level.
func MakeEndpointLoggingMW ¶
func MakeEndpointLoggingMW(logger log.Logger) endpoint.Middleware
MakeEndpointLoggingMW makes a logging middleware.
func MakeEndpointTracingMW ¶
func MakeEndpointTracingMW(tracer opentracing.Tracer, operationName string) endpoint.Middleware
MakeEndpointTracingMW makes a tracing middleware at endpoint level.
func MakeGRPCNextIDHandler ¶
func MakeGRPCNextIDHandler(e endpoint.Endpoint) *grpc_transport.Server
MakeGRPCNextIDHandler makes a GRPC handler for the NextID endpoint.
func MakeGRPCNextValidIDHandler ¶
func MakeGRPCNextValidIDHandler(e endpoint.Endpoint) *grpc_transport.Server
MakeGRPCNextValidIDHandler makes a GRPC handler for the NextValidID endpoint.
func MakeGRPCTracingMW ¶
func MakeGRPCTracingMW(tracer opentracing.Tracer, componentName, operationName string) func(grpc_transport.Handler) grpc_transport.Handler
MakeGRPCTracingMW makes a tracing middleware at transport level.
func MakeHTTPNextIDHandler ¶
func MakeHTTPNextIDHandler(e endpoint.Endpoint) *http_transport.Server
MakeHTTPNextIDHandler makes a HTTP handler for the NextID endpoint.
func MakeHTTPNextValidIDHandler ¶
func MakeHTTPNextValidIDHandler(e endpoint.Endpoint) *http_transport.Server
MakeHTTPNextValidIDHandler makes a HTTP handler for the NextValidID endpoint.
func MakeHTTPTracingMW ¶
func MakeHTTPTracingMW(tracer opentracing.Tracer, componentName, operationName string) func(http.Handler) http.Handler
MakeHTTPTracingMW try to extract an existing span from the HTTP headers. It it exists, we continue the span, if not we create a new one.
func MakeModuleInstrumentingCounterMW ¶
func MakeModuleInstrumentingCounterMW(counter metrics.Counter) func(IDGeneratorModule) IDGeneratorModule
MakeModuleInstrumentingCounterMW makes an Instrumenting middleware at module level.
func MakeModuleInstrumentingMW ¶
func MakeModuleInstrumentingMW(histogram metrics.Histogram) func(IDGeneratorModule) IDGeneratorModule
MakeModuleInstrumentingMW makes an Instrumenting middleware at module level.
func MakeModuleLoggingMW ¶
func MakeModuleLoggingMW(logger log.Logger) func(IDGeneratorModule) IDGeneratorModule
MakeModuleLoggingMW makes a logging middleware at module level.
func MakeModuleTracingMW ¶
func MakeModuleTracingMW(tracer opentracing.Tracer) func(IDGeneratorModule) IDGeneratorModule
MakeModuleTracingMW makes a tracing middleware at module level.
func MakeNextIDEndpoint ¶
func MakeNextIDEndpoint(c IDGeneratorComponent) endpoint.Endpoint
MakeNextIDEndpoint makes the NextIDEndpoint.
func MakeNextValidIDEndpoint ¶
func MakeNextValidIDEndpoint(c IDGeneratorComponent) endpoint.Endpoint
MakeNextValidIDEndpoint makes the NextValidIDEndpoint.
func NewGRPCServer ¶
func NewGRPCServer(nextIDHandler, nextValidIDHandler grpc_transport.Handler) fb.FlakiServer
NewGRPCServer makes a set of handler available as a FlakiServer.
Types ¶
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
Component is the flaki component.
func NewComponent ¶
func NewComponent(module IDGeneratorModule) *Component
NewComponent returns a flaki component.
func (*Component) NextID ¶
func (c *Component) NextID(ctx context.Context, req *fb.FlakiRequest) (*fb.FlakiReply, error)
NextID generates a unique string ID.
func (*Component) NextValidID ¶
func (c *Component) NextValidID(ctx context.Context, req *fb.FlakiRequest) *fb.FlakiReply
NextValidID generates a unique string ID.
type IDGeneratorComponent ¶
type IDGeneratorComponent interface { NextID(context.Context, *fb.FlakiRequest) (*fb.FlakiReply, error) NextValidID(context.Context, *fb.FlakiRequest) *fb.FlakiReply }
IDGeneratorComponent is the flaki component interface.
type IDGeneratorModule ¶
type IDGeneratorModule interface { NextID(context.Context) (string, error) NextValidID(context.Context) string }
IDGeneratorModule is the interface of the flaki Module.