middleware

package
v0.0.0-...-bc63a83 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const IRCLoggedKey = "irc_logged"

IRCLoggedKey is the context key that indicates a request has been logged to IRC

Variables

This section is empty.

Functions

func IRCLogger

func IRCLogger() echo.MiddlewareFunc

IRCLogger returns a middleware which logs requests to IRC with default config

func IRCLoggerWithConfig

func IRCLoggerWithConfig(config IRCLoggerConfig) echo.MiddlewareFunc

IRCLoggerWithConfig returns a middleware which logs requests to IRC using provided config

func SkipIfLoggedToIRC

func SkipIfLoggedToIRC(c echo.Context) bool

SkipIfLoggedToIRC returns a skipper function for the default logger to avoid duplicate logging for requests already logged to IRC

Types

type IRCLoggerConfig

type IRCLoggerConfig struct {
	// IRC connection settings
	Server   string
	Port     int
	Nick     string
	User     string
	Password string
	Channel  string
	UseTLS   bool

	// Skipper defines a function to skip middleware
	Skipper middleware.Skipper

	// FormatFunc formats the log message to be sent to IRC
	FormatFunc func(values middleware.RequestLoggerValues) string

	// LogValuesFunc defines a function to get/alter log values
	LogValuesFunc func(c echo.Context) middleware.RequestLoggerValues
}

IRCLoggerConfig holds configuration for IRC logger middleware

func DefaultIRCLoggerConfig

func DefaultIRCLoggerConfig() IRCLoggerConfig

DefaultIRCLoggerConfig returns a default configuration for IRCLogger middleware

Jump to

Keyboard shortcuts

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