@@ -23,35 +23,27 @@ datafx depends on connfx for connection management. You configure connections th
2323### Connection Configuration (via connfx)
2424
2525``` go
26- // Redis configuration example
26+ // Redis/Valkey configuration example
2727redisConfig := &connfx.ConfigTarget {
2828 Protocol : " redis" ,
29- Host : " localhost" ,
30- Port : 6379 ,
3129 DSN : " redis://localhost:6379" ,
3230}
3331
3432// PostgreSQL configuration example
3533postgresConfig := &connfx.ConfigTarget {
3634 Protocol : " postgres" ,
37- Host : " localhost" ,
38- Port : 5432 ,
3935 DSN : " postgres://user:pass@localhost:5432/dbname" ,
4036}
4137
4238// MongoDB configuration example
4339mongoConfig := &connfx.ConfigTarget {
4440 Protocol : " mongodb" ,
45- Host : " localhost" ,
46- Port : 27017 ,
4741 DSN : " mongodb://localhost:27017/mydb" ,
4842}
4943
5044// AMQP/RabbitMQ configuration example
5145amqpConfig := &connfx.ConfigTarget {
5246 Protocol : " amqp" ,
53- Host : " localhost" ,
54- Port : 5672 ,
5547 DSN : " amqp://guest:guest@localhost:5672/" ,
5648}
5749```
@@ -78,10 +70,10 @@ type Product struct {
7870
7971// Example message types for queues
8072type OrderEvent struct {
81- OrderID string ` json:"order_id"`
82- CustomerID string ` json:"customer_id"`
83- Amount float64 ` json:"amount"`
84- Timestamp time.Time ` json:"timestamp"`
73+ OrderID string ` json:"order_id"`
74+ CustomerID string ` json:"customer_id"`
75+ Amount float64 ` json:"amount"`
76+ Timestamp time.Time ` json:"timestamp"`
8577}
8678
8779type NotificationMessage struct {
@@ -121,14 +113,12 @@ func main() {
121113 ctx := context.Background ()
122114
123115 // Setup connection registry
124- logger := logfx.NewLogger (os. Stdout , &logfx. Config {Level: logfx. LevelInfo } )
116+ logger := logfx.NewLoggerWithDefaults ( )
125117 registry := connfx.NewRegistryWithDefaults (logger)
126118
127119 // Configure connection
128120 config := &connfx.ConfigTarget {
129121 Protocol: " redis" ,
130- Host: " localhost" ,
131- Port: 6379 ,
132122 DSN: " redis://localhost:6379" ,
133123 }
134124
@@ -323,7 +313,7 @@ func main() {
323313 ctx := context.Background ()
324314
325315 // Setup connection registry
326- logger := logfx.NewLogger (os. Stdout , &logfx. Config {Level: logfx. LevelInfo } )
316+ logger := logfx.NewLoggerWithDefaults ( )
327317 registry := connfx.NewRegistryWithDefaults (logger)
328318
329319 // Configure AMQP connection
0 commit comments