middleware

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INVALID_MESSAGE_HANDLER_TOPIC_SYMBOL string = "?"

	TAG_TOPIC          = "topic"
	TAG_OPT_EXPAND_ENV = "@ExpandEnv"
	OPT_ON             = "on"
	OPT_OFF            = "off"
)

Variables

View Source
var (
	NoopLoggingServiceSingleton = NoopLoggingService{}
	NoopEventLogSingleton       = NoopEventLog(0)
)

Functions

func TopicTagResolver

func TopicTagResolver(fieldname, token string) (*structproto.Tag, error)

Types

type CompositeEventLog added in v0.3.3

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

func (CompositeEventLog) Flush added in v0.3.3

func (l CompositeEventLog) Flush()

Flush implements EventLog.

func (CompositeEventLog) OnError added in v0.3.3

func (l CompositeEventLog) OnError(message *nsq.Message, err interface{}, stackTrace []byte)

OnError implements EventLog.

func (CompositeEventLog) OnProcessMessage added in v0.3.3

func (l CompositeEventLog) OnProcessMessage(message *nsq.Message)

OnProcessMessage implements EventLog.

func (CompositeEventLog) OnProcessMessageComplete added in v0.3.3

func (l CompositeEventLog) OnProcessMessageComplete(message *nsq.Message, reply internal.ReplyCode)

OnProcessMessageComplete implements EventLog.

type CompositeLoggingService added in v0.3.3

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

func NewCompositeLoggingService added in v0.3.3

func NewCompositeLoggingService(services ...LoggingService) *CompositeLoggingService

func (*CompositeLoggingService) ConfigureLogger added in v0.3.3

func (s *CompositeLoggingService) ConfigureLogger(l *log.Logger)

ConfigureLogger implements LoggingService.

func (*CompositeLoggingService) CreateEventLog added in v0.3.3

func (s *CompositeLoggingService) CreateEventLog(ev EventEvidence) EventLog

CreateEventLog implements LoggingService.

type ErrorHandlerMiddleware

type ErrorHandlerMiddleware struct {
	Handler ErrorHandler
}

func (*ErrorHandlerMiddleware) Init

func (m *ErrorHandlerMiddleware) Init(app *host.AppModule)

Init implements internal.Middleware.

type EventEvidence

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

func (EventEvidence) ProcessingSpanID

func (e EventEvidence) ProcessingSpanID() trace.SpanID

func (EventEvidence) ProcessingTraceID

func (e EventEvidence) ProcessingTraceID() trace.TraceID

func (EventEvidence) Topic

func (e EventEvidence) Topic() string

type EventLog

type EventLog interface {
	OnError(message *internal.Message, err interface{}, stackTrace []byte)
	OnProcessMessage(message *internal.Message)
	OnProcessMessageComplete(message *internal.Message, reply internal.ReplyCode)
	Flush()
}

type LoggingHandleModule

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

func (*LoggingHandleModule) CanSetSuccessor

func (*LoggingHandleModule) CanSetSuccessor() bool

CanSetSuccessor implements internal.MessageHandleModule.

func (*LoggingHandleModule) OnInitComplete

func (*LoggingHandleModule) OnInitComplete()

OnInitComplete implements internal.MessageHandleModule.

func (*LoggingHandleModule) OnStart

func (*LoggingHandleModule) OnStart(ctx context.Context) error

OnStart implements internal.MessageHandleModule.

func (*LoggingHandleModule) OnStop

OnStop implements internal.MessageHandleModule.

func (*LoggingHandleModule) ProcessMessage

func (m *LoggingHandleModule) ProcessMessage(ctx *internal.Context, message *nsq.Message, state internal.ProcessingState, recover *internal.Recover) error

ProcessMessage implements internal.MessageHandleModule.

func (*LoggingHandleModule) SetSuccessor

func (m *LoggingHandleModule) SetSuccessor(successor internal.MessageHandleModule)

SetSuccessor implements internal.MessageHandleModule.

type LoggingMiddleware

type LoggingMiddleware struct {
	LoggingService LoggingService
}

func (*LoggingMiddleware) Init

func (m *LoggingMiddleware) Init(app *host.AppModule)

Init implements internal.Middleware

type LoggingService

type LoggingService interface {
	CreateEventLog(ev EventEvidence) EventLog
	ConfigureLogger(l *log.Logger)
}

type MessageHandlerBinder

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

func (*MessageHandlerBinder) Bind

func (*MessageHandlerBinder) Deinit

func (*MessageHandlerBinder) Init

type MessageManagerBinder

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

func (*MessageManagerBinder) Bind

func (*MessageManagerBinder) Deinit

func (*MessageManagerBinder) Init

type MessageManagerMiddleware

type MessageManagerMiddleware struct {
	MessageManager interface{}
}

func (*MessageManagerMiddleware) Init

func (m *MessageManagerMiddleware) Init(app *host.AppModule)

type MessageObserverBinder

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

func (*MessageObserverBinder) Bind

Bind implements structproto.StructBinder.

func (*MessageObserverBinder) Deinit

Deinit implements structproto.StructBinder.

func (*MessageObserverBinder) Init

Init implements structproto.StructBinder.

type MessageObserverManagerBinder

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

func (*MessageObserverManagerBinder) Bind

Bind implements structproto.StructBinder.

func (*MessageObserverManagerBinder) Deinit

Deinit implements structproto.StructBinder.

func (*MessageObserverManagerBinder) Init

Init implements structproto.StructBinder.

type MessageObserverManagerMiddleware

type MessageObserverManagerMiddleware struct {
	MessageObserverManager interface{}
}

func (*MessageObserverManagerMiddleware) Init

Init implements internal.Middleware.

type NoopEventLog added in v0.3.3

type NoopEventLog int

func (NoopEventLog) Flush added in v0.3.3

func (n NoopEventLog) Flush()

Flush implements EventLog.

func (NoopEventLog) OnError added in v0.3.3

func (n NoopEventLog) OnError(message *nsq.Message, err interface{}, stackTrace []byte)

OnError implements EventLog.

func (NoopEventLog) OnProcessMessage added in v0.3.3

func (n NoopEventLog) OnProcessMessage(message *nsq.Message)

OnProcessMessage implements EventLog.

func (NoopEventLog) OnProcessMessageComplete added in v0.3.3

func (n NoopEventLog) OnProcessMessageComplete(message *nsq.Message, reply internal.ReplyCode)

OnProcessMessageComplete implements EventLog.

type NoopLoggingService added in v0.3.3

type NoopLoggingService struct{}

func (NoopLoggingService) ConfigureLogger added in v0.3.3

func (n NoopLoggingService) ConfigureLogger(l *log.Logger)

ConfigureLogger implements LoggingService.

func (NoopLoggingService) CreateEventLog added in v0.3.3

func (n NoopLoggingService) CreateEventLog(ev EventEvidence) EventLog

CreateEventLog implements LoggingService.

type TracingMiddleware

type TracingMiddleware struct {
	Enabled bool
}

func (*TracingMiddleware) Init

func (m *TracingMiddleware) Init(app *host.AppModule)

Init implements internal.Middleware.

Jump to

Keyboard shortcuts

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