Documentation
¶
Index ¶
Constants ¶
View Source
const (
EventLogCreated pubsub.EventType = "log_created"
)
Variables ¶
This section is empty.
Functions ¶
func InitService ¶
func NewSlogWriter ¶
func RecoverPanic ¶
func RecoverPanic(name string, cleanup func())
RecoverPanic is a common function to handle panics gracefully. It logs the error, creates a panic log file with stack trace, and executes an optional cleanup function.
Types ¶
type Log ¶
type Service ¶
type Service interface {
pubsub.Subscriber[Log]
Create(ctx context.Context, timestamp time.Time, level, message string, attributes map[string]string, sessionID string) error
ListBySession(ctx context.Context, sessionID string) ([]Log, error)
ListAll(ctx context.Context, limit int) ([]Log, error)
}
func GetService ¶
func GetService() Service
Click to show internal directories.
Click to hide internal directories.