logger_handler

package
v0.0.0-...-0b3c072 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogHandlerHandlerName = "LoggerHandler"
	ResponseTopic         = "logger/response"
)

Variables

This section is empty.

Functions

func CloseFiles

func CloseFiles[T comparable](files map[T]*CSVFile) (err error)

func FlushFiles

func FlushFiles[T comparable](files map[T]*CSVFile) (err error)

Types

type ActiveLogger

type ActiveLogger struct {
	Ids   common.Set[string]
	Input chan<- Loggable
}

type CSVFile

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

func NewCSVFile

func NewCSVFile(path, name string) (CSVFile, error)

func (*CSVFile) Close

func (file *CSVFile) Close() error

func (*CSVFile) Flush

func (file *CSVFile) Flush() error

func (*CSVFile) Write

func (file *CSVFile) Write(data []string) error

type Config

type Config struct {
	Topics        LoggerTopics `toml:"topics"`
	BasePath      string       `toml:"base_path"`
	FlushInterval string       `toml:"flush_interval"`
}

type Loggable

type Loggable interface {
	Id() string
	Log() []string
}

type Logger

type Logger interface {
	Ids() common.Set[string]
	Start(basePath string) chan<- Loggable
}

type LoggerHandler

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

func NewLoggerHandler

func NewLoggerHandler(loggers map[string]Logger, config Config) LoggerHandler

func (*LoggerHandler) HandlerName

func (handler *LoggerHandler) HandlerName() string

func (*LoggerHandler) Log

func (handler *LoggerHandler) Log(loggable Loggable)

func (*LoggerHandler) NotifyDisconnect

func (handler *LoggerHandler) NotifyDisconnect(client wsModels.Client)

func (*LoggerHandler) UpdateMessage

func (handler *LoggerHandler) UpdateMessage(client wsModels.Client, msg wsModels.Message)

type LoggerTopics

type LoggerTopics struct {
	Enable string `toml:"enable"`
}

Jump to

Keyboard shortcuts

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