Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ For services that outgrow the Builder (custom transports, non-standard shutdown
| Event streaming (fan-out) | `data/stream/redisstream` | [redis](docs/ai/redis.md) |
| Task queue (single consumer) | `data/queue/redisqueue` | [redis](docs/ai/redis.md) |
| Cross-service messaging | `infra/messaging` interfaces + backend | [messaging](docs/ai/messaging.md) |
| Kafka/NATS/SQL messaging | `messaging/wmconvert` (Watermill adapter) | [messaging](docs/ai/messaging.md) |
| Connect to MariaDB/PostgreSQL | `infra/sqldb`, `infra/sqldb/gormdb` | [database](docs/ai/sqldb.md) |
| Retry transient failures | `resilience/retry` | [resilience](docs/ai/resilience.md) |
| Protect against cascading failure | `resilience/circuitbreaker` | [resilience](docs/ai/resilience.md) |
Expand Down
1 change: 0 additions & 1 deletion app/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,4 +733,3 @@ func (b *Builder) Run() error {
// 15. Run — signal handling, component lifecycle, graceful shutdown.
return runner.Run(context.Background())
}

2 changes: 1 addition & 1 deletion app/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (

goredis "github.com/redis/go-redis/v9"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc"
"github.com/stretchr/testify/require"
"google.golang.org/grpc"

"github.com/bds421/rho-kit/infra/sqldb"
"github.com/bds421/rho-kit/infra/storage/membackend"
Expand Down
2 changes: 1 addition & 1 deletion core/config/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/kr/pretty v0.3.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/sys v0.42.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
3 changes: 1 addition & 2 deletions core/config/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0t
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
Expand Down
2 changes: 1 addition & 1 deletion data/cache/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/prometheus/client_golang v1.23.2
github.com/prometheus/client_model v0.6.2
github.com/stretchr/testify v1.11.1
golang.org/x/sync v0.17.0
golang.org/x/sync v0.20.0
)

require (
Expand Down
3 changes: 1 addition & 2 deletions data/cache/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
Expand Down
3 changes: 1 addition & 2 deletions data/cache/rediscache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
goredis "github.com/redis/go-redis/v9"

sharedcache "github.com/bds421/rho-kit/data/cache"
"github.com/bds421/rho-kit/observability/promutil"
"github.com/bds421/rho-kit/infra/redis"
"github.com/bds421/rho-kit/observability/promutil"
)

// Compile-time interface compliance check.
Expand Down Expand Up @@ -168,4 +168,3 @@ func (rc *RedisCache) Exists(ctx context.Context, key string) (bool, error) {
}
return n > 0, nil
}

1 change: 1 addition & 0 deletions data/cache/rediscache/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ require (
go.yaml.in/yaml/v2 v2.4.2 // indirect
golang.org/x/crypto v0.49.0 // indirect
golang.org/x/sys v0.42.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 // indirect
google.golang.org/grpc v1.79.2 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
3 changes: 1 addition & 2 deletions data/cache/rediscache/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 h1:JLQynH/LBHfCTSbDWl+py8C+Rg/k1OVH3xfcaiANuF0=
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57/go.mod h1:kSJwQxqmFXeo79zOmbrALdflXQeAYcUbgS7PbpMknCY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260217215200-42d3e9bedb6d h1:t/LOSXPJ9R0B6fnZNyALBRfZBH0Uy0gT+uR+SJ6syqQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260217215200-42d3e9bedb6d/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 h1:ggcbiqK8WWh6l1dnltU4BgWGIGo+EVYxCaAPih/zQXQ=
google.golang.org/grpc v1.79.2 h1:fRMD94s2tITpyJGtBBn7MkMseNpOZU8ZxgC3MMBaXRU=
google.golang.org/grpc v1.79.2/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
Expand Down
1 change: 1 addition & 0 deletions data/queue/redisqueue/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ require (
go.yaml.in/yaml/v2 v2.4.2 // indirect
golang.org/x/crypto v0.49.0 // indirect
golang.org/x/sys v0.42.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 // indirect
google.golang.org/grpc v1.79.2 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
3 changes: 1 addition & 2 deletions data/queue/redisqueue/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 h1:JLQynH/LBHfCTSbDWl+py8C+Rg/k1OVH3xfcaiANuF0=
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57/go.mod h1:kSJwQxqmFXeo79zOmbrALdflXQeAYcUbgS7PbpMknCY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260217215200-42d3e9bedb6d h1:t/LOSXPJ9R0B6fnZNyALBRfZBH0Uy0gT+uR+SJ6syqQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260217215200-42d3e9bedb6d/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 h1:ggcbiqK8WWh6l1dnltU4BgWGIGo+EVYxCaAPih/zQXQ=
google.golang.org/grpc v1.79.2 h1:fRMD94s2tITpyJGtBBn7MkMseNpOZU8ZxgC3MMBaXRU=
google.golang.org/grpc v1.79.2/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
Expand Down
17 changes: 8 additions & 9 deletions data/queue/redisqueue/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/prometheus/client_golang/prometheus"
goredis "github.com/redis/go-redis/v9"

"github.com/bds421/rho-kit/observability/promutil"
"github.com/bds421/rho-kit/infra/redis"
"github.com/bds421/rho-kit/observability/promutil"
)

const (
Expand Down Expand Up @@ -61,14 +61,14 @@ type Handler func(ctx context.Context, msg Message) error

// Metrics holds Prometheus collectors for queue monitoring.
type Metrics struct {
messagesEnqueued *prometheus.CounterVec
messagesProcessed *prometheus.CounterVec
messagesFailed *prometheus.CounterVec
messagesEnqueued *prometheus.CounterVec
messagesProcessed *prometheus.CounterVec
messagesFailed *prometheus.CounterVec
messagesDeadLettered *prometheus.CounterVec
processingDuration *prometheus.HistogramVec
messagesRetried *prometheus.CounterVec
processingDepth *prometheus.GaugeVec
queueDepth *prometheus.GaugeVec
processingDuration *prometheus.HistogramVec
messagesRetried *prometheus.CounterVec
processingDepth *prometheus.GaugeVec
queueDepth *prometheus.GaugeVec
}

// NewMetrics creates and registers queue metrics with the given registerer.
Expand Down Expand Up @@ -452,4 +452,3 @@ func (q *Queue) Len(ctx context.Context, queue string) (int64, error) {
}
return n, nil
}

1 change: 0 additions & 1 deletion data/queue/redisqueue/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,3 @@ func StartProcessors(
}
return nil
}

10 changes: 5 additions & 5 deletions data/stream/redisstream/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
goredis "github.com/redis/go-redis/v9"

"github.com/bds421/rho-kit/core/apperror"
"github.com/bds421/rho-kit/observability/promutil"
"github.com/bds421/rho-kit/infra/redis"
"github.com/bds421/rho-kit/observability/promutil"
)

const (
Expand Down Expand Up @@ -53,11 +53,11 @@ type Handler func(ctx context.Context, msg Message) error

// ConsumerMetrics holds Prometheus collectors for stream consumer monitoring.
type ConsumerMetrics struct {
messagesConsumed *prometheus.CounterVec
messagesFailed *prometheus.CounterVec
messagesConsumed *prometheus.CounterVec
messagesFailed *prometheus.CounterVec
messagesDeadLettered *prometheus.CounterVec
processingDuration *prometheus.HistogramVec
pendingMessages *prometheus.GaugeVec
processingDuration *prometheus.HistogramVec
pendingMessages *prometheus.GaugeVec
}

// NewConsumerMetrics creates and registers consumer metrics with the given registerer.
Expand Down
1 change: 1 addition & 0 deletions data/stream/redisstream/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ require (
go.yaml.in/yaml/v2 v2.4.2 // indirect
golang.org/x/crypto v0.49.0 // indirect
golang.org/x/sys v0.42.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 // indirect
google.golang.org/grpc v1.79.2 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
3 changes: 1 addition & 2 deletions data/stream/redisstream/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 h1:JLQynH/LBHfCTSbDWl+py8C+Rg/k1OVH3xfcaiANuF0=
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57/go.mod h1:kSJwQxqmFXeo79zOmbrALdflXQeAYcUbgS7PbpMknCY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260217215200-42d3e9bedb6d h1:t/LOSXPJ9R0B6fnZNyALBRfZBH0Uy0gT+uR+SJ6syqQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260217215200-42d3e9bedb6d/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 h1:ggcbiqK8WWh6l1dnltU4BgWGIGo+EVYxCaAPih/zQXQ=
google.golang.org/grpc v1.79.2 h1:fRMD94s2tITpyJGtBBn7MkMseNpOZU8ZxgC3MMBaXRU=
google.golang.org/grpc v1.79.2/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
Expand Down
3 changes: 1 addition & 2 deletions data/stream/redisstream/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/prometheus/client_golang/prometheus"
goredis "github.com/redis/go-redis/v9"

"github.com/bds421/rho-kit/observability/promutil"
"github.com/bds421/rho-kit/infra/redis"
"github.com/bds421/rho-kit/observability/promutil"
)

// defaultStreamMaxPayloadSize is the default max payload size for stream messages (1 MiB).
Expand Down Expand Up @@ -286,4 +286,3 @@ func (p *Producer) buildXAddArgs(stream string, msg Message) (*goredis.XAddArgs,

return args, nil
}

1 change: 0 additions & 1 deletion data/stream/redisstream/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,3 @@ func StartConsumers(
}
return nil
}

34 changes: 33 additions & 1 deletion docs/ai/messaging.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Messaging — Cross-Service Durable Messaging

Packages: `infra/messaging` (interfaces), `messaging/amqpbackend` (RabbitMQ), `messaging/redisbackend` (Redis Streams), `messaging/membroker` (unit tests)
Packages: `infra/messaging` (interfaces), `messaging/amqpbackend` (RabbitMQ), `messaging/redisbackend` (Redis Streams), `messaging/wmconvert` (Watermill adapter), `messaging/membroker` (unit tests)

## When to Use

Expand All @@ -10,10 +10,42 @@ Use `infra/messaging` for **cross-service durable messaging**. The root package
|---|---|
| `amqpbackend` | Complex routing (topic/fanout/headers), DLX retry, publisher confirms, buffered publishing |
| `redisbackend` | Redis Streams pub/sub (lighter weight, no extra broker) |
| `wmconvert` | Any [Watermill](https://github.com/ThreeDotsLabs/watermill)-supported broker (Kafka, NATS, Google Pub/Sub, SQL) via `wmconvert.NewBackend` |
| `membroker` | Unit tests (in-memory, synchronous drain) |

If you only need in-process event dispatch, use `runtime/eventbus` instead.

## Watermill Integration

The `wmconvert` package provides a generic adapter that wraps any [Watermill](https://github.com/ThreeDotsLabs/watermill) publisher/subscriber behind rho-kit's messaging interfaces. Use this for provider portability when you don't need backend-specific features.

```go
import (
"github.com/ThreeDotsLabs/watermill-kafka/v3/pkg/kafka"
"github.com/bds421/rho-kit/infra/messaging/wmconvert"
)

// Create Watermill Kafka publisher/subscriber
kafkaPub, _ := kafka.NewPublisher(kafkaConfig, watermillLogger)
kafkaSub, _ := kafka.NewSubscriber(kafkaConfig, watermillLogger)

// Wrap as rho-kit messaging interfaces
backend := wmconvert.NewBackend(kafkaPub, kafkaSub, logger,
wmconvert.WithTopicFunc(wmconvert.RoutingKeyTopic),
wmconvert.WithHealthFunc(func() bool { return kafkaPub.Connected() }),
)

// Use exactly like amqpbackend or redisbackend
err := backend.Publisher().Publish(ctx, "exchange", "user.created", msg)
```

Available topic functions: `ExchangeTopic` (default, maps to exchange/stream name), `RoutingKeyTopic` (maps to routing key), `CombinedTopic` (exchange.routingKey).

**When NOT to use wmconvert:**
- AMQP with DLX retry counting (x-death headers are AMQP-specific)
- Redis Streams with dead-letter routing, XCLAIM, or MINID trimming
- When you need `BufferedPublisher` or `PublishRaw`

## Quick Start (AMQP)

```go
Expand Down
3 changes: 2 additions & 1 deletion go.work
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ use (
./infra/messaging
./infra/messaging/amqpbackend
./infra/messaging/amqpbackend/debughttp
./infra/messaging/redisbackend
./infra/messaging/wmconvert
./infra/outbox
./infra/outbox/gormstore
./infra/messaging/redisbackend
./infra/redis
./infra/sqldb
./infra/sqldb/gormdb/gormmysql
Expand Down
1 change: 1 addition & 0 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ github.com/bds421/rho-kit/observability/auditlog/gormstore v1.0.0/go.mod h1:G+D/
github.com/bds421/rho-kit/runtime/eventbus v1.0.0/go.mod h1:Z/e2MRbdAjUWYISIx8XfcH/nKTqPR3eT1bNwfgoFDSM=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/sony/gobreaker v1.0.0 h1:feX5fGGXSl3dYd4aHZItw+FpHLvvoaqkawKjVNiFMNQ=
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
Expand Down
4 changes: 2 additions & 2 deletions grpcx/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ require (
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.66.1 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
github.com/prometheus/procfs v0.19.2 // indirect
github.com/segmentio/asm v1.2.1 // indirect
github.com/valyala/fastjson v1.6.7 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
Expand All @@ -45,7 +45,7 @@ require (
go.opentelemetry.io/otel/trace v1.42.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
golang.org/x/crypto v0.49.0 // indirect
golang.org/x/net v0.51.0 // indirect
golang.org/x/net v0.52.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/text v0.35.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 // indirect
Expand Down
6 changes: 2 additions & 4 deletions grpcx/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNw
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs=
github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=
github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg=
github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is=
github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0=
Expand Down Expand Up @@ -95,8 +94,7 @@ go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4=
golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA=
golang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo=
golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y=
golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8=
Expand Down
4 changes: 2 additions & 2 deletions grpcx/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ func TestNewServer_DefaultsDoNotPanic(t *testing.T) {

func TestNewServer_WithOptions(t *testing.T) {
srv := grpcx.NewServer(
grpcx.WithMaxRecvMsgSize(8 << 20),
grpcx.WithMaxSendMsgSize(8 << 20),
grpcx.WithMaxRecvMsgSize(8<<20),
grpcx.WithMaxSendMsgSize(8<<20),
grpcx.WithKeepaliveParams(keepalive.ServerParameters{
MaxConnectionIdle: 10 * time.Minute,
}),
Expand Down
1 change: 0 additions & 1 deletion httpx/authz/authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,3 @@ func StaticResource(resource string) ResourceFunc {
return resource
}
}

4 changes: 2 additions & 2 deletions httpx/healthhttp/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
package healthhttp

import (
"encoding/json"
"log/slog"
"context"
"encoding/json"
"io"
"log/slog"
"net/http"
"time"

Expand Down
4 changes: 2 additions & 2 deletions httpx/httpx.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
func NewHTTPClient(timeout time.Duration, tlsConfig *tls.Config) *http.Client {
transport := http.DefaultTransport.(*http.Transport).Clone()
if tlsConfig != nil {
transport.TLSClientConfig = tlsConfig
transport.TLSClientConfig = tlsConfig.Clone()
}
return &http.Client{
Timeout: timeout,
Expand All @@ -37,7 +37,7 @@ func NewHTTPClient(timeout time.Duration, tlsConfig *tls.Config) *http.Client {
func NewTracingHTTPClient(timeout time.Duration, tlsConfig *tls.Config, opts ...otelhttp.Option) *http.Client {
transport := http.DefaultTransport.(*http.Transport).Clone()
if tlsConfig != nil {
transport.TLSClientConfig = tlsConfig
transport.TLSClientConfig = tlsConfig.Clone()
}
return &http.Client{
Timeout: timeout,
Expand Down
8 changes: 4 additions & 4 deletions httpx/middleware/auditlog/auditlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ func Middleware(l *auditlog.Logger, opts ...Option) func(http.Handler) http.Hand

l.Log(auditCtx, auditlog.Event{
IPAddress: r.RemoteAddr,
Actor: cfg.actorExtractor(r),
Action: r.Method,
Resource: r.URL.Path,
Status: status,
Actor: cfg.actorExtractor(r),
Action: r.Method,
Resource: r.URL.Path,
Status: status,
})
})
}
Expand Down
Loading
Loading