go-duck-cli 1.0.8 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -15
- package/generators/ai_docs.js +130 -0
- package/generators/broker.js +63 -0
- package/generators/config.js +149 -7
- package/generators/devops.js +210 -43
- package/generators/docs.js +23 -4
- package/generators/elasticsearch.js +263 -0
- package/generators/kratos.js +229 -41
- package/generators/metering.js +280 -48
- package/generators/migrations.js +92 -198
- package/generators/mqtt.js +2 -39
- package/generators/multitenancy.js +274 -71
- package/generators/nats.js +39 -0
- package/generators/outbox.js +171 -0
- package/generators/postgrest.js +7 -3
- package/generators/postman.js +405 -0
- package/generators/repository.js +27 -0
- package/generators/router.js +27 -0
- package/generators/security.js +95 -14
- package/generators/serverless.js +147 -0
- package/generators/storage.js +589 -0
- package/generators/swagger.js +84 -60
- package/generators/telemetry.js +23 -32
- package/generators/websocket.js +55 -21
- package/index.js +481 -116
- package/package.json +6 -4
- package/parser/gdl.js +163 -24
- package/templates/docs/index.html.hbs +5 -5
- package/templates/docs/layout.hbs +221 -62
- package/templates/docs/pages/audit.hbs +83 -35
- package/templates/docs/pages/cli.hbs +18 -0
- package/templates/docs/pages/configuration.hbs +241 -0
- package/templates/docs/pages/datadog.hbs +46 -0
- package/templates/docs/pages/elasticsearch.hbs +121 -0
- package/templates/docs/pages/federation.hbs +241 -0
- package/templates/docs/pages/gdl-advanced.hbs +91 -0
- package/templates/docs/pages/gdl-annotations.hbs +137 -0
- package/templates/docs/pages/gdl-entities.hbs +134 -0
- package/templates/docs/pages/gdl-relationships.hbs +80 -0
- package/templates/docs/pages/gdl.hbs +60 -204
- package/templates/docs/pages/graphql.hbs +58 -44
- package/templates/docs/pages/grpc.hbs +53 -90
- package/templates/docs/pages/hybrid-store.hbs +127 -0
- package/templates/docs/pages/index.hbs +418 -149
- package/templates/docs/pages/keycloak.hbs +43 -0
- package/templates/docs/pages/legend.hbs +116 -0
- package/templates/docs/pages/mosquitto.hbs +39 -0
- package/templates/docs/pages/multitenancy.hbs +139 -71
- package/templates/docs/pages/otel.hbs +40 -0
- package/templates/docs/pages/realtime.hbs +38 -12
- package/templates/docs/pages/redis.hbs +40 -0
- package/templates/docs/pages/rest.hbs +120 -202
- package/templates/docs/pages/saga.hbs +94 -0
- package/templates/docs/pages/security.hbs +150 -44
- package/templates/docs/pages/serverless.hbs +157 -0
- package/templates/docs/pages/storage.hbs +127 -0
- package/templates/docs/pages/wizard.hbs +683 -0
- package/templates/docs/triple_identity_registry.png +0 -0
- package/templates/go/controller.go.hbs +287 -283
- package/templates/go/entity.go.hbs +17 -15
- package/templates/go/main.go.hbs +47 -180
- package/templates/go/migrator.go.hbs +65 -0
- package/templates/go/router.go.hbs +272 -0
- package/templates/graphql/resolver.go.hbs +53 -34
- package/templates/graphql/schema.graphql.hbs +17 -5
- package/templates/kratos/service.go.hbs +169 -34
- package/templates/proto/entity.proto.hbs +10 -14
- package/test_nested.gdl +21 -0
- package/templates/docs/intro.mp4 +0 -0
- package/test_parser.js +0 -9
|
@@ -1,39 +1,87 @@
|
|
|
1
|
-
<
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<p class="text-indigo-900"><strong>Note:</strong> All Audit Logs are automatically driven completely via Keycloak JWT Token Extraction!</p>
|
|
1
|
+
<div class="prose prose-slate max-w-none">
|
|
2
|
+
<div class="flex items-center space-x-3 mb-8 text-amber-700">
|
|
3
|
+
<div class="p-4 bg-gradient-to-br from-amber-600 to-orange-700 rounded-2xl shadow-lg shadow-amber-200">
|
|
4
|
+
<svg class="w-8 h-8 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
5
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" />
|
|
6
|
+
</svg>
|
|
7
|
+
</div>
|
|
8
|
+
<h1 class="text-5xl font-black text-slate-900 m-0 tracking-tight leading-tight">Forensic Accountability <br><span class="text-amber-600 italic">& Metering Engine.</span></h1>
|
|
10
9
|
</div>
|
|
11
10
|
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
<p class="text-2xl text-slate-500 font-medium mb-12 leading-relaxed">
|
|
12
|
+
Achieve sub-millisecond accountability. GO-DUCK generates a forensic-grade auditing and hierarchical metering engine that tracks every action across your entire distributed ecosystem.
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<!-- Key Stats Block -->
|
|
16
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-8 mb-20">
|
|
17
|
+
<div class="bg-amber-50 p-8 rounded-3xl border border-amber-100 shadow-sm">
|
|
18
|
+
<h3 class="text-xl font-bold mb-4 flex items-center text-amber-900">
|
|
19
|
+
🔍 Row-Level Forensics
|
|
20
|
+
</h3>
|
|
21
|
+
<p class="text-amber-800/80 mb-4 font-medium italic">
|
|
22
|
+
Any GDL entity marked <code>@Audited</code> automatically tracks "Who did What and When" at the row level—persisting exact deltas into the global <code>audit_log</code>.
|
|
23
|
+
</p>
|
|
24
|
+
<div class="flex flex-wrap gap-2">
|
|
25
|
+
<span class="px-3 py-1 bg-white rounded-lg border border-amber-200 text-xs font-bold text-amber-700 uppercase">Keycloak Role Tracking</span>
|
|
26
|
+
<span class="px-3 py-1 bg-white rounded-lg border border-amber-200 text-xs font-bold text-amber-700 uppercase">Tenant Partitioning</span>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="bg-slate-900 p-8 rounded-3xl border border-slate-800 shadow-xl border-t-4 border-t-amber-500">
|
|
30
|
+
<h3 class="text-xl font-bold mb-4 flex items-center text-amber-400">
|
|
31
|
+
📊 Hierarchical SaaS Metering
|
|
32
|
+
</h3>
|
|
33
|
+
<p class="text-indigo-100/70 mb-4 font-medium italic">
|
|
34
|
+
Track and limit API bandwidth in real-time via Redis. Automatically enforce dynamic quotas targeted at <strong>Individual Users</strong> or <strong>Realm Roles</strong>.
|
|
35
|
+
</p>
|
|
36
|
+
<div class="px-4 py-2 bg-indigo-500/20 rounded-xl border border-indigo-400/20 text-xs font-mono text-indigo-200">
|
|
37
|
+
X-Quota-Remaining: 984
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
21
41
|
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
42
|
+
<!-- The Accountability Loop Section -->
|
|
43
|
+
<section class="mb-20">
|
|
44
|
+
<div class="bg-slate-950 rounded-[2.5rem] p-12 text-white shadow-2xl relative overflow-hidden">
|
|
45
|
+
<h2 class="text-3xl font-black mb-8 leading-tight tracking-tight">The Forensic Loop <br><span class="text-amber-500 italic font-medium tracking-wide italic leading-snug">Immutable Evidence.</span></h2>
|
|
46
|
+
|
|
47
|
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8 mb-12">
|
|
48
|
+
<div class="p-8 bg-white/5 rounded-3xl backdrop-blur-sm border border-white/10 hover:bg-white/10 transition-all duration-300">
|
|
49
|
+
<div class="text-amber-500 text-4xl font-black mb-4">01</div>
|
|
50
|
+
<h6 class="font-bold mb-2">Interception</h6>
|
|
51
|
+
<p class="text-xs text-slate-400 leading-relaxed font-medium">Middleware extracts Keycloak Role, UserID, and TenantID from the incoming request envelope.</p>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="p-8 bg-white/5 rounded-3xl backdrop-blur-sm border border-white/10 hover:bg-white/10 transition-all duration-300">
|
|
54
|
+
<div class="text-amber-500 text-4xl font-black mb-4">02</div>
|
|
55
|
+
<h6 class="font-bold mb-2">Verification</h6>
|
|
56
|
+
<p class="text-xs text-slate-400 leading-relaxed font-medium">The SaaS Metering engine checks Redis for remaining bandwidth. Rejects if Daily/Monthly limits are exceeded.</p>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="p-8 bg-white/5 rounded-3xl backdrop-blur-sm border border-white/10 hover:bg-white/10 transition-all duration-300">
|
|
59
|
+
<div class="text-amber-500 text-4xl font-black mb-4">03</div>
|
|
60
|
+
<h6 class="font-bold mb-2">Persistence</h6>
|
|
61
|
+
<p class="text-xs text-slate-400 leading-relaxed font-medium">After the mutation succeeds, the GORM hook persists the full audit delta atomically within the same silo transaction.</p>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</section>
|
|
29
66
|
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</
|
|
39
|
-
</
|
|
67
|
+
<!-- Detailed Audit Fields Section -->
|
|
68
|
+
<section class="mb-16">
|
|
69
|
+
<h2 class="text-3xl font-black text-slate-900 mb-8 tracking-tight italic tracking-widest text-center uppercase">Audit Schema Excellence</h2>
|
|
70
|
+
<div class="overflow-x-auto rounded-[2rem] border border-slate-200">
|
|
71
|
+
<table class="min-w-full divide-y divide-slate-200">
|
|
72
|
+
<thead class="bg-slate-50">
|
|
73
|
+
<tr>
|
|
74
|
+
<th class="px-6 py-4 text-left text-xs font-black text-slate-500 uppercase tracking-[0.1em]">Event Attribute</th>
|
|
75
|
+
<th class="px-6 py-4 text-left text-xs font-black text-slate-500 uppercase tracking-[0.1em]">Security Value</th>
|
|
76
|
+
</tr>
|
|
77
|
+
</thead>
|
|
78
|
+
<tbody class="bg-white divide-y divide-slate-100">
|
|
79
|
+
<tr><td class="px-6 py-4 font-bold text-slate-900">Actor Identity</td><td class="px-6 py-4 text-sm text-slate-600 font-medium italic">Captures the Subject (UserID) and Realm Role of the initiator.</td></tr>
|
|
80
|
+
<tr><td class="px-6 py-4 font-bold text-slate-900">Historical Delta</td><td class="px-6 py-4 text-sm text-slate-600 font-medium italic">Full JSONB diff of the object before and after the mutation.</td></tr>
|
|
81
|
+
<tr><td class="px-6 py-4 font-bold text-slate-900">Trace Propogation</td><td class="px-6 py-4 text-sm text-slate-600 font-medium italic">Links the audit log directly to the OpenTelemetry TraceID.</td></tr>
|
|
82
|
+
<tr><td class="px-6 py-4 font-bold text-slate-900">Tenant Isolation</td><td class="px-6 py-4 text-sm text-slate-600 font-medium italic">Audit logs are partitioned by Silo, ensuring no cross-tenant leakage.</td></tr>
|
|
83
|
+
</tbody>
|
|
84
|
+
</table>
|
|
85
|
+
</div>
|
|
86
|
+
</section>
|
|
87
|
+
</div>
|
|
@@ -81,3 +81,21 @@ go-duck import-gdl my_new_schema.gdl -o ./MY_APP</code></pre>
|
|
|
81
81
|
</ul>
|
|
82
82
|
</div>
|
|
83
83
|
</section>
|
|
84
|
+
|
|
85
|
+
<!-- NEXT STEPS -->
|
|
86
|
+
<div class="flex flex-col md:flex-row gap-4 mt-20">
|
|
87
|
+
<a href="gdl-advanced.html" class="flex-1 p-6 bg-slate-100 rounded-2xl text-slate-900 hover:bg-slate-200 transition-colors group">
|
|
88
|
+
<div class="text-xs font-bold text-slate-500 uppercase tracking-widest mb-2">Previous Category</div>
|
|
89
|
+
<div class="text-xl font-bold flex items-center text-slate-800">
|
|
90
|
+
<svg class="w-5 h-5 mr-2 group-hover:-translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 17l-5-5m0 0l5-5m-5 5h12" /></svg>
|
|
91
|
+
🔮 Advanced GDL
|
|
92
|
+
</div>
|
|
93
|
+
</a>
|
|
94
|
+
<a href="configuration.html" class="flex-1 p-6 bg-indigo-700 rounded-2xl text-white hover:bg-indigo-800 transition-colors group text-right">
|
|
95
|
+
<div class="text-xs font-bold text-indigo-200 uppercase tracking-widest mb-2">Next Category</div>
|
|
96
|
+
<div class="text-xl font-bold flex items-center justify-end">
|
|
97
|
+
⚙️ Master Configuration
|
|
98
|
+
<svg class="w-5 h-5 ml-2 group-hover:translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7l5 5m0 0l-5 5m5-5H6" /></svg>
|
|
99
|
+
</div>
|
|
100
|
+
</a>
|
|
101
|
+
</div>
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
<div class="prose prose-slate max-w-none">
|
|
2
|
+
<!-- Hero Section -->
|
|
3
|
+
<div class="flex items-center space-x-3 mb-10 text-indigo-700">
|
|
4
|
+
<div class="p-4 bg-gradient-to-br from-indigo-600 to-violet-800 rounded-3xl shadow-xl shadow-indigo-100">
|
|
5
|
+
<svg class="w-10 h-10 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
6
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
|
|
7
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
|
8
|
+
</svg>
|
|
9
|
+
</div>
|
|
10
|
+
<div>
|
|
11
|
+
<h1 class="text-4xl font-black text-slate-900 m-0 tracking-tight leading-none">Master Configuration</h1>
|
|
12
|
+
<p class="text-indigo-600 font-bold tracking-widest uppercase text-[10px] mt-2 ml-1">The Fullest config.yaml Technical Reference</p>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<p class="text-xl text-slate-600 mb-12 italic border-l-4 border-indigo-500 pl-6 leading-relaxed">
|
|
17
|
+
The <code>config.yaml</code> file is the "Central Nervous System" of your GO-DUCK microservice. It controls everything from high-performance server tuning to distributed resilience and multi-cloud object storage.
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<!-- YAML PREVIEW -->
|
|
21
|
+
<div class="bg-slate-900 rounded-[2.5rem] p-10 text-white mb-16 shadow-2xl relative overflow-hidden group">
|
|
22
|
+
<div class="absolute inset-0 bg-gradient-to-br from-indigo-900/40 to-transparent"></div>
|
|
23
|
+
<div class="flex justify-between items-center mb-6 relative z-10">
|
|
24
|
+
<h3 class="text-emerald-400 font-mono text-sm tracking-widest uppercase">The "Fullest" Template</h3>
|
|
25
|
+
<span class="px-3 py-1 bg-white/10 rounded-full text-[10px] font-bold tracking-widest text-slate-400 uppercase">YAML 1.2</span>
|
|
26
|
+
</div>
|
|
27
|
+
<pre class="bg-transparent border-none p-0 m-0 overflow-x-auto relative z-10"><code class="language-yaml">go-duck:
|
|
28
|
+
name: "go-duck-master-app"
|
|
29
|
+
version: "1.0.0"
|
|
30
|
+
|
|
31
|
+
# --- Network & Server ---
|
|
32
|
+
server:
|
|
33
|
+
port: 8080
|
|
34
|
+
read-timeout: "30s"
|
|
35
|
+
write-timeout: "30s"
|
|
36
|
+
grpc:
|
|
37
|
+
addr: ":9000"
|
|
38
|
+
network: "tcp"
|
|
39
|
+
cors:
|
|
40
|
+
allow-origins: ["*"]
|
|
41
|
+
allow-methods: ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]
|
|
42
|
+
|
|
43
|
+
# --- Persistence (Hybrid Store) ---
|
|
44
|
+
datasource:
|
|
45
|
+
host: "localhost"
|
|
46
|
+
port: 5432
|
|
47
|
+
username: "postgres"
|
|
48
|
+
password: "password"
|
|
49
|
+
database: "go_duck_db"
|
|
50
|
+
max-open-conns: 25
|
|
51
|
+
mongodb:
|
|
52
|
+
enabled: true
|
|
53
|
+
uri: "mongodb://localhost:27017"
|
|
54
|
+
database: "go_duck_mongo"
|
|
55
|
+
|
|
56
|
+
# --- Messaging Hub ---
|
|
57
|
+
messaging:
|
|
58
|
+
mqtt:
|
|
59
|
+
enabled: true
|
|
60
|
+
broker: "tcp://localhost:1883"
|
|
61
|
+
nats:
|
|
62
|
+
enabled: true
|
|
63
|
+
url: "nats://localhost:4222"
|
|
64
|
+
|
|
65
|
+
# --- Object Storage ---
|
|
66
|
+
storage:
|
|
67
|
+
s3: { enabled: false, bucket: "bucket-name", region: "us-east-1" }
|
|
68
|
+
gcs: { enabled: false, bucket: "bucket-name", credentials-file: "keys.json" }
|
|
69
|
+
minio: { enabled: true, bucket: "dev", endpoint: "localhost:9000" }
|
|
70
|
+
|
|
71
|
+
# --- Search Engine ---
|
|
72
|
+
elasticsearch:
|
|
73
|
+
enabled: true
|
|
74
|
+
addresses: ["http://localhost:9200"]
|
|
75
|
+
auto_sync: true</code></pre>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<!-- PARAMETER REFERENCE -->
|
|
79
|
+
<h2 class="text-3xl font-black text-slate-900 mb-8 tracking-tight">Technical Guideline Reference</h2>
|
|
80
|
+
|
|
81
|
+
<!-- SECTION: PROJECT -->
|
|
82
|
+
<section class="mb-16">
|
|
83
|
+
<h3 class="text-xl font-bold text-indigo-700 mb-4 flex items-center">
|
|
84
|
+
<span class="w-2 h-2 rounded-full bg-indigo-600 mr-2"></span>
|
|
85
|
+
1. Project Identity (go-duck)
|
|
86
|
+
</h3>
|
|
87
|
+
<div class="overflow-hidden border border-slate-200 rounded-2xl shadow-sm">
|
|
88
|
+
<table class="w-full text-left border-collapse">
|
|
89
|
+
<thead class="bg-slate-50 border-b border-slate-200">
|
|
90
|
+
<tr>
|
|
91
|
+
<th class="p-4 text-xs font-black text-slate-500 uppercase tracking-widest">Parameter</th>
|
|
92
|
+
<th class="p-4 text-xs font-black text-slate-500 uppercase tracking-widest">Purpose</th>
|
|
93
|
+
</tr>
|
|
94
|
+
</thead>
|
|
95
|
+
<tbody class="text-sm">
|
|
96
|
+
<tr class="border-b border-slate-100">
|
|
97
|
+
<td class="p-4 font-mono text-indigo-600">name</td>
|
|
98
|
+
<td class="p-4 text-slate-600">The root Go module name. Used for all internal imports and project scaffolding.</td>
|
|
99
|
+
</tr>
|
|
100
|
+
<tr>
|
|
101
|
+
<td class="p-4 font-mono text-indigo-600">version</td>
|
|
102
|
+
<td class="p-4 text-slate-600">Semantic versioning injected into Swagger docs and internal build manifests.</td>
|
|
103
|
+
</tr>
|
|
104
|
+
</tbody>
|
|
105
|
+
</table>
|
|
106
|
+
</div>
|
|
107
|
+
</section>
|
|
108
|
+
|
|
109
|
+
<!-- SECTION: PERSISTENCE -->
|
|
110
|
+
<section class="mb-16">
|
|
111
|
+
<h3 class="text-xl font-bold text-emerald-700 mb-4 flex items-center">
|
|
112
|
+
<span class="w-2 h-2 rounded-full bg-emerald-600 mr-2"></span>
|
|
113
|
+
2. Hybrid Persistence (datasource)
|
|
114
|
+
</h3>
|
|
115
|
+
<div class="overflow-hidden border border-slate-200 rounded-2xl shadow-sm">
|
|
116
|
+
<table class="w-full text-left border-collapse">
|
|
117
|
+
<thead class="bg-slate-50 border-b border-slate-200">
|
|
118
|
+
<tr>
|
|
119
|
+
<th class="p-4 text-xs font-black text-slate-500 uppercase tracking-widest">Parameter</th>
|
|
120
|
+
<th class="p-4 text-xs font-black text-slate-500 uppercase tracking-widest">Purpose</th>
|
|
121
|
+
</tr>
|
|
122
|
+
</thead>
|
|
123
|
+
<tbody class="text-sm">
|
|
124
|
+
<tr class="border-b border-slate-100">
|
|
125
|
+
<td class="p-4 font-mono text-emerald-600">host/port/database</td>
|
|
126
|
+
<td class="p-4 text-slate-600">PostgreSQL connection details for the Relational Silo and Multi-Tenant Registry.</td>
|
|
127
|
+
</tr>
|
|
128
|
+
<tr class="border-b border-slate-100">
|
|
129
|
+
<td class="p-4 font-mono text-emerald-600">max-open-conns</td>
|
|
130
|
+
<td class="p-4 text-slate-600">GORM connection pool limit. Critical for preventing port exhaustion in federated environments.</td>
|
|
131
|
+
</tr>
|
|
132
|
+
<tr>
|
|
133
|
+
<td class="p-4 font-mono text-emerald-600">mongodb.enabled</td>
|
|
134
|
+
<td class="p-4 text-slate-600">Toggles the NoSQL Document engine. If true, the app supports <code>@isDocument</code> and recursive GDL structures.</td>
|
|
135
|
+
</tr>
|
|
136
|
+
</tbody>
|
|
137
|
+
</table>
|
|
138
|
+
</div>
|
|
139
|
+
</section>
|
|
140
|
+
|
|
141
|
+
<!-- SECTION: MESSAGING -->
|
|
142
|
+
<section class="mb-16">
|
|
143
|
+
<h3 class="text-xl font-bold text-sky-700 mb-4 flex items-center">
|
|
144
|
+
<span class="w-2 h-2 rounded-full bg-sky-600 mr-2"></span>
|
|
145
|
+
3. Unified Messaging Hub (messaging)
|
|
146
|
+
</h3>
|
|
147
|
+
<div class="overflow-hidden border border-slate-200 rounded-2xl shadow-sm">
|
|
148
|
+
<table class="w-full text-left border-collapse">
|
|
149
|
+
<thead class="bg-slate-50 border-b border-slate-200">
|
|
150
|
+
<tr>
|
|
151
|
+
<th class="p-4 text-xs font-black text-slate-500 uppercase tracking-widest">Parameter</th>
|
|
152
|
+
<th class="p-4 text-xs font-black text-slate-500 uppercase tracking-widest">Purpose</th>
|
|
153
|
+
</tr>
|
|
154
|
+
</thead>
|
|
155
|
+
<tbody class="text-sm">
|
|
156
|
+
<tr class="border-b border-slate-100">
|
|
157
|
+
<td class="p-4 font-mono text-sky-600">mqtt.broker</td>
|
|
158
|
+
<td class="p-4 text-slate-600">Real-time notification hub. Broadcasts schema mutations directly to the frontend for UI reactivity.</td>
|
|
159
|
+
</tr>
|
|
160
|
+
<tr>
|
|
161
|
+
<td class="p-4 font-mono text-sky-600">nats.url</td>
|
|
162
|
+
<td class="p-4 text-slate-600">High-performance internal streaming. Powering the CQRS logic and cross-microservice events.</td>
|
|
163
|
+
</tr>
|
|
164
|
+
</tbody>
|
|
165
|
+
</table>
|
|
166
|
+
</div>
|
|
167
|
+
</section>
|
|
168
|
+
|
|
169
|
+
<!-- SECTION: STORAGE -->
|
|
170
|
+
<section class="mb-16">
|
|
171
|
+
<h3 class="text-xl font-bold text-amber-700 mb-4 flex items-center">
|
|
172
|
+
<span class="w-2 h-2 rounded-full bg-amber-600 mr-2"></span>
|
|
173
|
+
4. Universal Storage Bridge (storage)
|
|
174
|
+
</h3>
|
|
175
|
+
<p class="text-sm text-slate-500 mb-4 italic leading-relaxed">GO-DUCK provides a unified Go Interface for 7 different providers. Switch providers by simply changing the 'enabled' flag.</p>
|
|
176
|
+
<div class="overflow-hidden border border-slate-200 rounded-2xl shadow-sm">
|
|
177
|
+
<table class="w-full text-left border-collapse">
|
|
178
|
+
<thead class="bg-slate-50 border-b border-slate-200">
|
|
179
|
+
<tr>
|
|
180
|
+
<th class="p-4 text-xs font-black text-slate-500 uppercase tracking-widest">Provider</th>
|
|
181
|
+
<th class="p-4 text-xs font-black text-slate-500 uppercase tracking-widest">Key Configuration</th>
|
|
182
|
+
</tr>
|
|
183
|
+
</thead>
|
|
184
|
+
<tbody class="text-sm text-slate-600">
|
|
185
|
+
<tr class="border-b border-slate-100 italic">
|
|
186
|
+
<td class="p-4 font-bold text-slate-900">AWS S3 / R2</td>
|
|
187
|
+
<td class="p-4">bucket, region, access-key, secret-key</td>
|
|
188
|
+
</tr>
|
|
189
|
+
<tr class="border-b border-slate-100 italic font-medium">
|
|
190
|
+
<td class="p-4 font-bold text-slate-900">Google GCS</td>
|
|
191
|
+
<td class="p-4 italic underline decoration-amber-200 underline-offset-4">credentials-file (JSON service account path)</td>
|
|
192
|
+
</tr>
|
|
193
|
+
<tr class="border-b border-slate-100 italic">
|
|
194
|
+
<td class="p-4 font-bold text-slate-900">SFTP / SSH</td>
|
|
195
|
+
<td class="p-4">host, port, username, key-file</td>
|
|
196
|
+
</tr>
|
|
197
|
+
<tr>
|
|
198
|
+
<td class="p-4 font-bold text-slate-900">GitHub Bootstrap</td>
|
|
199
|
+
<td class="p-4 italic">owner, repo, token, files (Automated infrastructure discovery)</td>
|
|
200
|
+
</tr>
|
|
201
|
+
</tbody>
|
|
202
|
+
</table>
|
|
203
|
+
</div>
|
|
204
|
+
</section>
|
|
205
|
+
|
|
206
|
+
<!-- RESILIENCE & SEARCH -->
|
|
207
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-8 mb-20">
|
|
208
|
+
<div class="p-8 bg-rose-50 rounded-[2.5rem] border border-rose-100">
|
|
209
|
+
<h4 class="text-lg font-black text-rose-900 mb-4 uppercase tracking-tighter">Distributed Resilience</h4>
|
|
210
|
+
<ul class="text-sm text-rose-700 italic space-y-4">
|
|
211
|
+
<li><strong>Circuit Breaker:</strong> Prevents cascading failures when DB/MQ or Search is down.</li>
|
|
212
|
+
<li><strong>Rate Limit:</strong> Distributed Redis-backed throttler (RPS/Burst) targeting by Keycloak Identity.</li>
|
|
213
|
+
</ul>
|
|
214
|
+
</div>
|
|
215
|
+
<div class="p-8 bg-blue-50 rounded-[2.5rem] border border-blue-100">
|
|
216
|
+
<h4 class="text-lg font-black text-blue-900 mb-4 uppercase tracking-tighter">Industrial Search</h4>
|
|
217
|
+
<ul class="text-sm text-blue-700 italic space-y-4">
|
|
218
|
+
<li><strong>Elasticsearch:</strong> Full-text engine with Spring-style query string mapping.</li>
|
|
219
|
+
<li><strong>Auto Sync:</strong> Real-time indexing triggered by Repository mutators.</li>
|
|
220
|
+
</ul>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
<!-- NEXT LINK -->
|
|
225
|
+
<div class="flex flex-col md:flex-row gap-4 mt-20">
|
|
226
|
+
<a href="cli.html" class="flex-1 p-6 bg-slate-100 rounded-2xl text-slate-900 hover:bg-slate-200 transition-colors group">
|
|
227
|
+
<div class="text-xs font-bold text-slate-500 uppercase tracking-widest mb-2">Previous Category</div>
|
|
228
|
+
<div class="text-xl font-bold flex items-center text-slate-800">
|
|
229
|
+
<svg class="w-5 h-5 mr-2 group-hover:-translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 17l-5-5m0 0l5-5m-5 5h12" /></svg>
|
|
230
|
+
💻 CLI Reference
|
|
231
|
+
</div>
|
|
232
|
+
</a>
|
|
233
|
+
<a href="rest.html" class="flex-1 p-6 bg-indigo-700 rounded-2xl text-white hover:bg-indigo-800 transition-colors group text-right">
|
|
234
|
+
<div class="text-xs font-bold text-indigo-200 uppercase tracking-widest mb-2">Next Category</div>
|
|
235
|
+
<div class="text-xl font-bold flex items-center justify-end">
|
|
236
|
+
📡 REST & Search API
|
|
237
|
+
<svg class="w-5 h-5 ml-2 group-hover:translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7l5 5m0 0l-5 5m5-5H6" /></svg>
|
|
238
|
+
</div>
|
|
239
|
+
</a>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<h1 class="text-4xl font-extrabold text-gray-900 mb-4">Datadog & Cloud Monitoring</h1>
|
|
2
|
+
<p class="text-lg text-gray-600 mb-8">Harness the power of enterprise-grade observability with GO-DUCK's native Datadog integration for logs, metrics, and APM.</p>
|
|
3
|
+
|
|
4
|
+
<section class="mb-10">
|
|
5
|
+
<h2 class="text-2xl font-bold text-gray-800 mb-4 border-b pb-2">Overview</h2>
|
|
6
|
+
<p class="mb-4 text-gray-700">GO-DUCK provides a specialized <code>logger</code> package that abstracts the complexity of streaming logs and metrics to Datadog. It supports environment-based configuration, ensuring you only pay for what you need in production while keeping local development logs clean.</p>
|
|
7
|
+
</section>
|
|
8
|
+
|
|
9
|
+
<section class="mb-10">
|
|
10
|
+
<h2 class="text-2xl font-bold text-gray-800 mb-4 border-b pb-2">Log Streaming</h2>
|
|
11
|
+
<p class="mb-4">Our logger is designed to be Datadog-ready. When <code>datadog.enabled</code> is set to true, logs are formatted as JSON and sent directly to the Datadog API or via a local Datadog Agent.</p>
|
|
12
|
+
|
|
13
|
+
<div class="bg-blue-50 border-l-4 border-blue-500 p-4 mb-6 rounded-r">
|
|
14
|
+
<p class="text-blue-900"><strong>Pro-Tip:</strong> Use structured logging with <code>logger.Info("User logged in", zap.String("userID", user.ID))</code> to enable powerful faceted searches in the Datadog Log Explorer.</p>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<h3 class="font-semibold mb-2 mt-6 text-xl">Configuration</h3>
|
|
18
|
+
<pre><code class="language-yaml">go-duck:
|
|
19
|
+
logging:
|
|
20
|
+
level: "info"
|
|
21
|
+
datadog:
|
|
22
|
+
enabled: true
|
|
23
|
+
api-key: "${DD_API_KEY}"
|
|
24
|
+
site: "datadoghq.com"
|
|
25
|
+
service: "{{appName}}"
|
|
26
|
+
env: "production"</code></pre>
|
|
27
|
+
</section>
|
|
28
|
+
|
|
29
|
+
<section class="mb-10">
|
|
30
|
+
<h2 class="text-2xl font-bold text-gray-800 mb-4 border-b pb-2">Custom Metrics (DogStatsD)</h2>
|
|
31
|
+
<p class="mb-4 text-gray-700">The generated code includes a pre-initialized Statsd client. You can push custom business metrics directly from your Go services:</p>
|
|
32
|
+
<ul class="list-disc pl-8 mb-4 text-gray-700 space-y-2">
|
|
33
|
+
<li><code>logger.Count("orders.placed", 1, tags, 1.0)</code> - Tracks volume.</li>
|
|
34
|
+
<li><code>logger.Histogram("payment.latency", duration, tags, 1.0)</code> - Tracks performance distribution.</li>
|
|
35
|
+
<li><code>logger.Gauge("active.users", count, tags, 1.0)</code> - Tracks point-in-time value.</li>
|
|
36
|
+
</ul>
|
|
37
|
+
</section>
|
|
38
|
+
|
|
39
|
+
<section class="mb-10">
|
|
40
|
+
<h2 class="text-2xl font-bold text-gray-800 mb-4 border-b pb-2">External Resources</h2>
|
|
41
|
+
<ul class="space-y-2">
|
|
42
|
+
<li><a href="https://docs.datadoghq.com/logs/" target="_blank" class="text-indigo-600 hover:underline">Datadog Logs Documentation →</a></li>
|
|
43
|
+
<li><a href="https://docs.datadoghq.com/metrics/dogstatsd/" target="_blank" class="text-indigo-600 hover:underline">DogStatsD Guide →</a></li>
|
|
44
|
+
<li><a href="https://docs.datadoghq.com/tracing/" target="_blank" class="text-indigo-600 hover:underline">Datadog APM & Distributed Tracing →</a></li>
|
|
45
|
+
</ul>
|
|
46
|
+
</section>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<div class="prose prose-slate max-w-none">
|
|
2
|
+
<!-- Marketing Hero -->
|
|
3
|
+
<div class="flex items-center space-x-3 mb-8 text-orange-600">
|
|
4
|
+
<div class="p-4 bg-gradient-to-br from-orange-500 to-orange-700 rounded-2xl shadow-lg shadow-orange-100">
|
|
5
|
+
<svg class="w-8 h-8 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
6
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
|
|
7
|
+
</svg>
|
|
8
|
+
</div>
|
|
9
|
+
<h1 class="text-5xl font-black text-slate-900 m-0 tracking-tight leading-tight">Elasticsearch: The Search Powerhouse</h1>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<p class="text-2xl text-slate-500 font-medium mb-12 leading-relaxed">
|
|
13
|
+
Unlock high-performance, fuzzy full-text search across your entire federated ecosystem. GO-DUCK bridges your relational silos with an elite Elasticsearch sync engine.
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<!-- Marketing Hero Section -->
|
|
17
|
+
<section class="grid grid-cols-1 md:grid-cols-3 gap-8 mb-20">
|
|
18
|
+
<div class="bg-gradient-to-br from-orange-50 to-white p-8 rounded-[2rem] border border-orange-100 shadow-sm">
|
|
19
|
+
<h3 class="text-orange-900 font-black mb-4">Spring-Style Queries</h3>
|
|
20
|
+
<p class="text-slate-600 leading-relaxed text-sm">Query your data using a simple, powerful query string syntax inspired by Spring Data Elasticsearch.</p>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="bg-gradient-to-br from-blue-50 to-white p-8 rounded-[2rem] border border-blue-100 shadow-sm">
|
|
23
|
+
<h3 class="text-blue-900 font-black mb-4">Transactional Sync</h3>
|
|
24
|
+
<p class="text-slate-600 leading-relaxed text-sm">Entities marked with <code class="bg-blue-100 px-2 rounded">@Searchable</code> are automatically indexed the moment they hit the database.</p>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="bg-gradient-to-br from-purple-50 to-white p-8 rounded-[2rem] border border-purple-100 shadow-sm">
|
|
27
|
+
<h3 class="text-purple-900 font-black mb-4">Multi-Tenant Isolation</h3>
|
|
28
|
+
<p class="text-slate-600 leading-relaxed text-sm">Search indices are automatically prefixed and partitioned to ensure zero data leakage between tenants.</p>
|
|
29
|
+
</div>
|
|
30
|
+
</section>
|
|
31
|
+
|
|
32
|
+
<!-- Technical Core -->
|
|
33
|
+
<section class="mb-20">
|
|
34
|
+
<h2 class="text-3xl font-black text-slate-900 mb-8 tracking-tight italic underline decoration-orange-600 underline-offset-8">Search Controller Reference</h2>
|
|
35
|
+
<div class="bg-slate-900 rounded-[2.5rem] p-10 border border-slate-800 shadow-2xl">
|
|
36
|
+
<div class="flex items-center space-x-2 mb-6">
|
|
37
|
+
<span class="px-3 py-1 bg-green-500/20 text-green-400 rounded-full text-xs font-black uppercase tracking-widest">GET</span>
|
|
38
|
+
<code class="text-indigo-400 font-mono">/api/search/:entity?q=...</code>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div class="space-y-6">
|
|
42
|
+
<div>
|
|
43
|
+
<h5 class="text-white font-bold mb-2">Example: Fuzzy Search</h5>
|
|
44
|
+
<div class="p-4 bg-slate-800 rounded-2xl font-mono text-sm text-indigo-300">
|
|
45
|
+
GET /api/search/car?q=Toyta
|
|
46
|
+
</div>
|
|
47
|
+
<p class="text-slate-400 text-xs mt-2 italic">// Matches "Toyota" via automatic ES Fuzziness</p>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div class="overflow-x-auto rounded-2xl border border-white/5">
|
|
51
|
+
<table class="min-w-full divide-y divide-slate-800">
|
|
52
|
+
<thead class="bg-slate-800/50">
|
|
53
|
+
<tr>
|
|
54
|
+
<th class="px-6 py-4 text-left text-xs font-black uppercase text-slate-500">Query Pattern</th>
|
|
55
|
+
<th class="px-6 py-4 text-left text-xs font-black uppercase text-slate-500">Elasticsearch Execution</th>
|
|
56
|
+
</tr>
|
|
57
|
+
</thead>
|
|
58
|
+
<tbody class="divide-y divide-slate-800 text-sm text-slate-300">
|
|
59
|
+
<tr>
|
|
60
|
+
<td class="px-6 py-4 font-mono font-bold text-orange-400">q=...</td>
|
|
61
|
+
<td class="px-6 py-4 italic">multi_match with fuzziness: AUTO on all fields</td>
|
|
62
|
+
</tr>
|
|
63
|
+
<tr>
|
|
64
|
+
<td class="px-6 py-4 font-mono font-bold text-orange-400">(empty)</td>
|
|
65
|
+
<td class="px-6 py-4 italic">match_all (standard listing)</td>
|
|
66
|
+
</tr>
|
|
67
|
+
</tbody>
|
|
68
|
+
</table>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</section>
|
|
73
|
+
|
|
74
|
+
<!-- Configuration -->
|
|
75
|
+
<section class="mb-20">
|
|
76
|
+
<h2 class="text-3xl font-black text-slate-900 mb-8 tracking-tight">Activating the Search Engine</h2>
|
|
77
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-12 items-start">
|
|
78
|
+
<div class="space-y-6">
|
|
79
|
+
<div class="bg-white p-8 rounded-[2rem] border border-slate-200 shadow-sm relative overflow-hidden group">
|
|
80
|
+
<div class="absolute top-0 right-0 p-4 opacity-5 group-hover:opacity-20 transition-opacity">
|
|
81
|
+
<svg class="w-24 h-24 text-orange-600" fill="currentColor" viewBox="0 0 24 24"><path d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/></svg>
|
|
82
|
+
</div>
|
|
83
|
+
<h4 class="text-xl font-black mb-4">1. Annotate your GDL</h4>
|
|
84
|
+
<p class="text-slate-500 text-sm leading-relaxed mb-6">Simply add <code class="bg-orange-100 text-orange-700 px-2 rounded">@Searchable</code> to any entity block.</p>
|
|
85
|
+
<div class="bg-slate-900 rounded-2xl p-4 font-mono text-xs text-indigo-300">
|
|
86
|
+
@Searchable @Audited<br>
|
|
87
|
+
entity Car { ... }
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div class="bg-white p-8 rounded-[2rem] border border-slate-200 shadow-sm relative overflow-hidden group">
|
|
92
|
+
<h4 class="text-xl font-black mb-4">2. Enable in Config</h4>
|
|
93
|
+
<p class="text-slate-500 text-sm leading-relaxed mb-6">Toggle the search engine globally in your <code class="bg-slate-100 px-1 rounded">config.yaml</code>.</p>
|
|
94
|
+
<div class="bg-slate-900 rounded-2xl p-4 font-mono text-xs text-indigo-300">
|
|
95
|
+
elasticsearch:<br>
|
|
96
|
+
enabled: true<br>
|
|
97
|
+
auto_sync: true
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<div class="bg-orange-50 rounded-[2.5rem] p-10 border border-orange-100">
|
|
103
|
+
<h4 class="text-2xl font-black text-orange-900 mb-6 italic italic underline decoration-orange-300 underline-offset-4">Why Elasticsearch?</h4>
|
|
104
|
+
<ul class="space-y-4">
|
|
105
|
+
<li class="flex items-start space-x-3">
|
|
106
|
+
<div class="mt-1 flex-shrink-0 w-2 h-2 bg-orange-600 rounded-full"></div>
|
|
107
|
+
<p class="text-sm text-orange-800 font-medium">Offload heavy search queries from your transactional database.</p>
|
|
108
|
+
</li>
|
|
109
|
+
<li class="flex items-start space-x-3">
|
|
110
|
+
<div class="mt-1 flex-shrink-0 w-2 h-2 bg-orange-600 rounded-full"></div>
|
|
111
|
+
<p class="text-sm text-orange-800 font-medium">Enterprise-grade relevancy scoring and multi-language support.</p>
|
|
112
|
+
</li>
|
|
113
|
+
<li class="flex items-start space-x-3">
|
|
114
|
+
<div class="mt-1 flex-shrink-0 w-2 h-2 bg-orange-600 rounded-full"></div>
|
|
115
|
+
<p class="text-sm text-orange-800 font-medium">Handle millions of records with sub-millisecond response times.</p>
|
|
116
|
+
</li>
|
|
117
|
+
</ul>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</section>
|
|
121
|
+
</div>
|