logger

package
v0.0.0-...-4feb759 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// GeolocationDBType indicates the type of geolocation database.
	GeolocationDBType string
	// GeolocationDBPath provides the path to the geolocation database.
	GeolocationDBPath string
}

Config provides the configuration for the logger.

type Logger

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

Logger acts as a centralized component for ingesting data from the other components and processing it.

func New

func New(cfg *Config) (*Logger, error)

New creates a new logger instance.

func (*Logger) AddClient

func (l *Logger) AddClient(w http.ResponseWriter, r *http.Request) error

AddClient upgrades the provided HTTP request to websocket.

func (*Logger) Close

func (l *Logger) Close()

Close shuts down the logger.

func (*Logger) Geolocate

func (l *Logger) Geolocate(host string) (*geolocator.Response, error)

func (*Logger) Log

func (l *Logger) Log(action string, data interface{})

Jump to

Keyboard shortcuts

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