MCPcopy Create free account
hub / github.com/astercloud/aster / NewEvent

Function NewEvent

pkg/session/session.go:271–283  ·  view source on GitHub ↗

NewEvent 创建新事件

(invocationID string)

Source from the content-addressed store, hash-verified

269
270// NewEvent 创建新事件
271func NewEvent(invocationID string) *Event {
272 return &Event{
273 ID: generateEventID(),
274 InvocationID: invocationID,
275 Timestamp: time.Now(),
276 Actions: EventActions{
277 StateDelta: make(map[string]any),
278 ArtifactDelta: make(map[string]int64),
279 CustomActions: make(map[string]any),
280 },
281 Metadata: make(map[string]any),
282 }
283}
284
285// generateEventID 生成事件 ID
286func generateEventID() string {

Callers 2

mainFunction · 0.92
TestNewEventFunction · 0.85

Calls 1

generateEventIDFunction · 0.70

Tested by 1

TestNewEventFunction · 0.68