Bump reva

This commit is contained in:
André Duffeck
2025-07-17 15:23:57 +02:00
parent 4704cedd3b
commit 8adf425b2d
41 changed files with 351 additions and 195 deletions
@@ -130,6 +130,7 @@ type commonLoggingResponseWriter interface {
http.Flusher
Status() int
Size() int
Unwrap() http.ResponseWriter
}
// responseLogger is wrapper of http.ResponseWriter that keeps track of its HTTP
@@ -170,6 +171,10 @@ func (l *responseLogger) Flush() {
}
}
func (l *responseLogger) Unwrap() http.ResponseWriter {
return l.w
}
type hijackLogger struct {
responseLogger
}
+49
View File
@@ -21,7 +21,9 @@
package mocks
import (
jetstream "github.com/nats-io/nats.go/jetstream"
events "github.com/opencloud-eu/reva/v2/pkg/events"
mock "github.com/stretchr/testify/mock"
raw "github.com/opencloud-eu/reva/v2/pkg/events/raw"
@@ -112,6 +114,53 @@ func (_c *Stream_Consume_Call) RunAndReturn(run func(string, ...events.Unmarshal
return _c
}
// JetStream provides a mock function with no fields
func (_m *Stream) JetStream() jetstream.Stream {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for JetStream")
}
var r0 jetstream.Stream
if rf, ok := ret.Get(0).(func() jetstream.Stream); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(jetstream.Stream)
}
}
return r0
}
// Stream_JetStream_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'JetStream'
type Stream_JetStream_Call struct {
*mock.Call
}
// JetStream is a helper method to define mock.On call
func (_e *Stream_Expecter) JetStream() *Stream_JetStream_Call {
return &Stream_JetStream_Call{Call: _e.mock.On("JetStream")}
}
func (_c *Stream_JetStream_Call) Run(run func()) *Stream_JetStream_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *Stream_JetStream_Call) Return(_a0 jetstream.Stream) *Stream_JetStream_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Stream_JetStream_Call) RunAndReturn(run func() jetstream.Stream) *Stream_JetStream_Call {
_c.Call.Return(run)
return _c
}
// NewStream creates a new instance of Stream. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewStream(t interface {
+8 -3
View File
@@ -62,10 +62,11 @@ func (re *Event) InProgress() error {
type Stream interface {
Consume(group string, evs ...events.Unmarshaller) (<-chan Event, error)
JetStream() jetstream.Stream
}
type RawStream struct {
Js jetstream.Stream
js jetstream.Stream
c Config
}
@@ -130,7 +131,7 @@ func FromConfig(ctx context.Context, name string, cfg Config) (Stream, error) {
}
s = &RawStream{
Js: js,
js: js,
c: cfg,
}
return nil
@@ -186,7 +187,7 @@ func (s *RawStream) Consume(group string, evs ...events.Unmarshaller) (<-chan Ev
}
func (s *RawStream) consumeRaw(group string) (<-chan RawEvent, error) {
consumer, err := s.Js.CreateOrUpdateConsumer(context.Background(), jetstream.ConsumerConfig{
consumer, err := s.js.CreateOrUpdateConsumer(context.Background(), jetstream.ConsumerConfig{
Durable: group,
DeliverPolicy: jetstream.DeliverNewPolicy,
AckPolicy: jetstream.AckExplicitPolicy, // Require manual acknowledgment
@@ -214,3 +215,7 @@ func (s *RawStream) consumeRaw(group string) (<-chan RawEvent, error) {
return channel, nil
}
func (s *RawStream) JetStream() jetstream.Stream {
return s.js
}