pubsub

package
v5.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Logger provides functionality for logging and subscribing to logs.

func NewLogger

func NewLogger() *Logger

NewLogger initializes and returns a new instance of Logger.

func (*Logger) Close added in v5.1.1

func (l *Logger) Close()

func (*Logger) Publish

func (l *Logger) Publish(msg string)

Publish sends a log message to the logger.

func (*Logger) Subscribe

func (l *Logger) Subscribe() <-chan *string

Subscribe provides a read-only channel to receive log messages. This allows external components to "listen" for new logs.

func (*Logger) Write

func (l *Logger) Write(p []byte) (n int, err error)

Write allows the Logger to be used as a Writer and in structured logging.

Jump to

Keyboard shortcuts

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