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

Function main

examples/session-postgres/main.go:18–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16)
17
18func main() {
19 ctx := context.Background()
20
21 // ====== 示例 1: 基础连接和配置 ======
22 fmt.Println("=== Example 1: Basic Connection ===")
23 service := setupPostgreSQLService()
24 defer func() { _ = service.Close() }()
25
26 // ====== 示例 2: 创建 Session ======
27 fmt.Println("\n=== Example 2: Create Session ===")
28 sess := createSessionExample(ctx, service)
29
30 // ====== 示例 3: 追加事件 ======
31 fmt.Println("\n=== Example 3: Append Events ===")
32 appendEventsExample(ctx, service, sess.ID)
33
34 // ====== 示例 4: 状态管理 ======
35 fmt.Println("\n=== Example 4: State Management ===")
36 stateManagementExample(ctx, service, sess.ID)
37
38 // ====== 示例 5: 工件版本管理 ======
39 fmt.Println("\n=== Example 5: Artifact Versioning ===")
40 artifactVersioningExample(ctx, service, sess.ID)
41
42 // ====== 示例 6: 查询和过滤 ======
43 fmt.Println("\n=== Example 6: Query and Filter ===")
44 queryExample(ctx, service, sess.UserID)
45
46 fmt.Println("\n✅ All examples completed successfully!")
47}
48
49// setupPostgreSQLService 设置 PostgreSQL 服务
50func setupPostgreSQLService() *postgres.Service {

Callers

nothing calls this directly

Calls 7

setupPostgreSQLServiceFunction · 0.85
stateManagementExampleFunction · 0.85
queryExampleFunction · 0.85
createSessionExampleFunction · 0.70
appendEventsExampleFunction · 0.70
CloseMethod · 0.65

Tested by

no test coverage detected