status

package
v0.0.48 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventStatusPublished pubsub.EventType = "status_published"
)

Variables

This section is empty.

Functions

func Debug

func Debug(message string)

func Error

func Error(message string)

func Info

func Info(message string)

func InitService

func InitService() error

func Subscribe

func Subscribe(ctx context.Context) <-chan pubsub.Event[StatusMessage]

func Warn

func Warn(message string)

Types

type Level

type Level string
const (
	LevelInfo  Level = "info"
	LevelWarn  Level = "warn"
	LevelError Level = "error"
	LevelDebug Level = "debug"
)

type Service

type Service interface {
	pubsub.Subscriber[StatusMessage]

	Info(message string)
	Warn(message string)
	Error(message string)
	Debug(message string)
}

func GetService

func GetService() Service

type StatusMessage

type StatusMessage struct {
	Level     Level     `json:"level"`
	Message   string    `json:"message"`
	Timestamp time.Time `json:"timestamp"`
}

Jump to

Keyboard shortcuts

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