flaki

package
v0.0.0-...-d5eddb0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2018 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

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 Endpoints

type Endpoints struct {
	NextIDEndpoint      endpoint.Endpoint
	NextValidIDEndpoint endpoint.Endpoint
}

Endpoints wraps a service behind a set of endpoints.

type Flaki

type Flaki interface {
	NextIDString() (string, error)
	NextValidIDString() string
}

Flaki is the interface of the distributed unique IDs generator.

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.

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module is the module using the Flaki generator to generate unique IDs.

func NewModule

func NewModule(flaki Flaki) *Module

NewModule returns a Flaki module.

func (*Module) NextID

func (m *Module) NextID(_ context.Context) (string, error)

NextID generates a unique string ID.

func (*Module) NextValidID

func (m *Module) NextValidID(_ context.Context) string

NextValidID generates a unique string ID.

type Sentry

type Sentry interface {
	CaptureError(err error, tags map[string]string, interfaces ...sentry.Interface) string
}

Sentry interface.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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