Skip to content

Building 70 Projects ranging from beginner to advanced so anyone can β€” learn from, build upon, use as a reference, or even copy directly. Owned by my cybersecurity company πŸ‘‡

feat(monitor/config): coinbase config block (enabled, url, product_ids, throttle)

CarterPerez-dev0a6f4f1e09e6
diff --git a/PROJECTS/advanced/monitor-the-situation-dashboard/backend/internal/config/config.go b/PROJECTS/advanced/monitor-the-situation-dashboard/backend/internal/config/config.go
index 19f7a43b..7b5f2bd8 100644
--- a/PROJECTS/advanced/monitor-the-situation-dashboard/backend/internal/config/config.go
+++ b/PROJECTS/advanced/monitor-the-situation-dashboard/backend/internal/config/config.go
@@ -34,6 +34,7 @@ type CollectorsConfig struct {
KEV SourceConfig `koanf:"kev"`
Ransomware SourceConfig `koanf:"ransomware"`
GreyNoise GreyNoiseConfig `koanf:"greynoise"`
+ Coinbase CoinbaseConfig `koanf:"coinbase"`
}
type SourceConfig struct {
@@ -60,6 +61,13 @@ type GreyNoiseConfig struct {
APIKey string `koanf:"api_key"`
}
+type CoinbaseConfig struct {
+ Enabled bool `koanf:"enabled"`
+ URL string `koanf:"url"`
+ ProductIDs []string `koanf:"product_ids"`
+ Throttle time.Duration `koanf:"throttle"`
+}
+
type AppConfig struct {
Name string `koanf:"name"`
Version string `koanf:"version"`
@@ -250,6 +258,10 @@ func loadDefaults(k *koanf.Koanf) error {
"collectors.ransomware.enabled": true,
"collectors.ransomware.interval": "15m",
"collectors.greynoise.enabled": true,
+ "collectors.coinbase.enabled": true,
+ "collectors.coinbase.url": "wss://advanced-trade-ws.coinbase.com",
+ "collectors.coinbase.product_ids": []string{"BTC-USD", "ETH-USD"},
+ "collectors.coinbase.throttle": "250ms",
}
for key, value := range defaults {