event

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToMap

func ConvertToMap(v any) any

ConvertToMap converts any value (including structs, slices of structs) to map[string]any or []any by marshaling to JSON and unmarshaling back. This ensures the redactor can process all fields. If conversion fails, the original value is returned to avoid impacting the server.

func CopySessionToEvent

func CopySessionToEvent(session *core.Session, event *Event)

CopySessionToEvent copies session metadata fields to the event.

func LogEvent

func LogEvent(logger interface{ Infof(string, ...any) }, evt *Event, title string)

LogEvent logs an event in a formatted, human-readable way for debugging.

func NewEventID

func NewEventID() string

NewEventID generates a new unique event ID with the MCPCat prefix.

Types

type Event

type Event = core.Event

func CreateIdentifyEvent

func CreateIdentifyEvent(session *core.Session) *Event

CreateIdentifyEvent creates an Event for mcpcat:identify event type.

func NewEvent

func NewEvent(session *core.Session, eventType string, duration *int32, isError bool, errorDetails error) *Event

NewEvent creates an SDK-agnostic Event from session data and basic metadata.

Jump to

Keyboard shortcuts

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