Versions in this module Expand all Collapse all v0 v0.0.2 May 29, 2024 v0.0.1 May 28, 2024 Changes in this version + var ErrHandlerNotFound = errors.New("handler not found") + func GetSubjectFromContext(ctx context.Context) string + func SaveSubjectToContext(ctx context.Context, subject string) context.Context + type CorrelationIDProcessor struct + func NewCorrelationIDProcessor(opts ...CorrelationIDProcessorOpt) *CorrelationIDProcessor + func (p *CorrelationIDProcessor) MWInjectCorrelationID(next Handler) Handler + func (p *CorrelationIDProcessor) ShouldSkip(cid, action, subj string) bool + type CorrelationIDProcessorOpt func(*CorrelationIDProcessor) + func CorrelationIDProcessorWithLogger(logger *zap.Logger) CorrelationIDProcessorOpt + func CorrelationIDProcessorWithSkipStrategyCustom(sr map[string]map[string]struct{}) CorrelationIDProcessorOpt + func CorrelationIDProcessorWithSkipStrategySkipAll() CorrelationIDProcessorOpt + func CorrelationIDProcessorWithSkipStrategyUpdateOnly() CorrelationIDProcessorOpt + type EventRouter interface + Approve func(string, Handler, ...Middleware) + Create func(string, Handler, ...Middleware) + Delete func(string, Handler, ...Middleware) + Deny func(string, Handler, ...Middleware) + Process func(context.Context, string, *govevents.Event) error + Revoke func(string, Handler, ...Middleware) + Subjects func() []string + Update func(string, Handler, ...Middleware) + Use func(mw Middleware) + type Handler func(context.Context, *govevents.Event) error + type Middleware func(Handler) Handler + type Option func(*Router) + func WithCorrelationIDProcessor(p *CorrelationIDProcessor) Option + func WithLogger(logger *zap.Logger) Option + func WithMiddleware(mw Middleware) Option + func WithTracer(tracer trace.Tracer) Option + type Router struct + func NewRouter(opts ...Option) *Router + func (r *Router) Approve(subj string, handler Handler, middlewares ...Middleware) + func (r *Router) Create(subj string, handler Handler, middlewares ...Middleware) + func (r *Router) Delete(subj string, handler Handler, middlewares ...Middleware) + func (r *Router) Deny(subj string, handler Handler, middlewares ...Middleware) + func (r *Router) Process(ctx context.Context, subj string, event *govevents.Event) error + func (r *Router) Revoke(subj string, handler Handler, middlewares ...Middleware) + func (r *Router) Subjects() []string + func (r *Router) Update(subj string, handler Handler, middlewares ...Middleware) + func (r *Router) Use(mw Middleware)