Documentation ¶
Index ¶
- Constants
- func BindEventSubscriber(injector *dingo.Injector) *dingo.Binding
- func BindTemplateFunc(injector *dingo.Injector, name string, fnc TemplateFunc)
- type DefaultEventRouter
- type Event
- type EventRouter
- type LogKey
- type Logger
- type NullLogger
- func (NullLogger) Debug(args ...interface{})
- func (NullLogger) Debugf(log string, args ...interface{})
- func (NullLogger) Error(args ...interface{})
- func (NullLogger) Fatal(args ...interface{})
- func (n NullLogger) Flush()
- func (NullLogger) Info(args ...interface{})
- func (NullLogger) Panic(args ...interface{})
- func (NullLogger) Warn(args ...interface{})
- func (n NullLogger) WithContext(ctx context.Context) Logger
- func (n NullLogger) WithField(key LogKey, value interface{}) Logger
- func (n NullLogger) WithFields(fields map[LogKey]interface{}) Logger
- type PartialTemplateEngine
- type ServerShutdownEvent
- type ServerStartEvent
- type SessionModule
- type ShutdownEvent
- type StartupEvent
- type StdLogger
- func (l *StdLogger) Debug(args ...interface{})
- func (l *StdLogger) Debugf(f string, args ...interface{})
- func (l *StdLogger) Error(args ...interface{})
- func (l *StdLogger) Flush()
- func (l *StdLogger) Info(args ...interface{})
- func (l *StdLogger) Warn(args ...interface{})
- func (l *StdLogger) WithContext(ctx context.Context) Logger
- func (l *StdLogger) WithField(key LogKey, value interface{}) Logger
- func (l *StdLogger) WithFields(fields map[LogKey]interface{}) Logger
- type TemplateEngine
- type TemplateFunc
Constants ¶
const ( LogKeyAccesslog LogKey = "accesslog" // LogKeyAccesslog marks a logmessage belonging to an (incoming) call (value should be 1) LogKeyApicall = "apicall" // LogKeyApicall marks a logmessage belonging to an (outgoing) api call (value should be 1) LogKeyArea = "area" LogKeyBusinessID = "businessId" LogKeyCategory = "category" LogKeyModule = "module" LogKeySubCategory = "sub_category" LogKeyClientIP = "client_ip" LogKeyCode = "code" LogKeyConnectionStatus = "connection_status" LogKeyCorrelationID = "correlationId" LogKeyTraceID = "traceID" LogKeySpanID = "spanID" LogKeyLevel = "level" LogKeyMessage = "message" LogKeyMethod = "method" LogKeySession = "session" LogKeyPath = "path" LogKeyReferer = "referer" LogKeyRequest = "request" LogKeyRequestTime = "request_time" LogKeyRequestedEndpoint = "requested_endpoint" LogKeyRequestedURL = "requested_url" LogKeyResponse = "response" LogKeyResponseCode = "response_code" LogKeyResponseTime = "response_time" LogKeySource = "source" LogKeyTimestamp = "@timestamp" LogKeyTrace = "trace" )
Common logger field keys
Variables ¶
This section is empty.
Functions ¶
func BindEventSubscriber ¶
BindEventSubscriber is a helper to bind a private event Subscriber via Dingo
func BindTemplateFunc ¶
func BindTemplateFunc(injector *dingo.Injector, name string, fnc TemplateFunc)
BindTemplateFunc makes sure a template function is correctly bound via dingo
Types ¶
type DefaultEventRouter ¶
type DefaultEventRouter struct {
// contains filtered or unexported fields
}
DefaultEventRouter is a default event routing implementation
func (*DefaultEventRouter) Dispatch ¶
func (d *DefaultEventRouter) Dispatch(ctx context.Context, event Event)
Dispatch calls the event's Dispatch method on each subscriber
func (*DefaultEventRouter) Inject ¶
func (d *DefaultEventRouter) Inject(provider eventSubscriberProvider, logger Logger)
Inject eventSubscriberProvider dependency
type EventRouter ¶
EventRouter routes events
type Logger ¶
type Logger interface { WithContext(ctx context.Context) Logger Debug(args ...interface{}) Info(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) Fatal(args ...interface{}) Panic(args ...interface{}) Debugf(log string, args ...interface{}) WithField(key LogKey, value interface{}) Logger WithFields(fields map[LogKey]interface{}) Logger Flush() }
Logger defines a standard Flamingo logger interfaces
type NullLogger ¶
type NullLogger struct{}
NullLogger does not log
func (NullLogger) Debugf ¶
func (NullLogger) Debugf(log string, args ...interface{})
Debugf null-implementation
func (NullLogger) WithContext ¶
func (n NullLogger) WithContext(ctx context.Context) Logger
WithContext null-implementation
func (NullLogger) WithField ¶
func (n NullLogger) WithField(key LogKey, value interface{}) Logger
WithField null-implementation
func (NullLogger) WithFields ¶
func (n NullLogger) WithFields(fields map[LogKey]interface{}) Logger
WithFields null-implementation
type PartialTemplateEngine ¶
type PartialTemplateEngine interface {
RenderPartials(ctx context.Context, templateName string, data interface{}, partials []string) (map[string]io.Reader, error)
}
PartialTemplateEngine is used for progressive enhancements / rendering of partial template areas usually this is requested via the appropriate javascript headers and taken care of in the framework renderer
type ServerShutdownEvent ¶
type ServerShutdownEvent struct{}
ServerShutdownEvent is dispatched when a server is stopped (not for CLI commands)
type ServerStartEvent ¶
type ServerStartEvent struct{}
ServerStartEvent is dispatched when a server is started (not for CLI commands)
type SessionModule ¶
type SessionModule struct {
// contains filtered or unexported fields
}
SessionModule for session management
func (*SessionModule) Configure ¶
func (m *SessionModule) Configure(injector *dingo.Injector)
Configure DI
func (*SessionModule) CueConfig ¶ added in v3.1.0
func (*SessionModule) CueConfig() string
CueConfig defines the session config scheme
func (*SessionModule) FlamingoLegacyConfigAlias ¶ added in v3.1.0
func (m *SessionModule) FlamingoLegacyConfigAlias() map[string]string
FlamingoLegacyConfigAlias maps legacy config to new
func (*SessionModule) Inject ¶
func (m *SessionModule) Inject(config *struct { // session config is optional to allow usage of the DefaultConfig Backend string `inject:"config:flamingo.session.backend"` Secret string `inject:"config:flamingo.session.secret"` FileName string `inject:"config:flamingo.session.file"` Secure bool `inject:"config:flamingo.session.cookie.secure"` // float64 is used due to the injection as config from json - int is not possible on this StoreLength float64 `inject:"config:flamingo.session.store.length"` MaxAge float64 `inject:"config:flamingo.session.max.age"` Path string `inject:"config:flamingo.session.cookie.path"` RedisURL string `inject:"config:flamingo.session.redis.url"` RedisHost string `inject:"config:flamingo.session.redis.host"` RedisPassword string `inject:"config:flamingo.session.redis.password"` RedisIdleConnections float64 `inject:"config:flamingo.session.redis.idle.connections"` RedisMaxAge float64 `inject:"config:flamingo.session.redis.maxAge"` })
Inject dependencies
type ShutdownEvent ¶
type ShutdownEvent struct{}
ShutdownEvent is dispatched when the application shuts down
type StartupEvent ¶
type StartupEvent struct{}
StartupEvent is dispatched when the application starts
type StdLogger ¶
StdLogger uses the go stdlib logger for logging
func (*StdLogger) WithContext ¶
WithContext currently does nothing
func (*StdLogger) WithFields ¶
WithFields currently logs the fields
type TemplateEngine ¶
type TemplateEngine interface {
Render(context context.Context, name string, data interface{}) (io.Reader, error)
}
TemplateEngine defines the basic template engine
type TemplateFunc ¶
TemplateFunc defines an interface for a custom function to be used in gotemplates/pug templates