From 618c0a6a67efebac06151e9af1b52c17eb105e3c Mon Sep 17 00:00:00 2001 From: linxside <39219399+linxside@users.noreply.github.com> Date: Fri, 23 Feb 2024 11:53:39 +0100 Subject: [PATCH] chore: update dependencies (#347) --- go.mod | 6 +- go.sum | 12 +- internal/pkg/mocks/jetstream.go | 134 +++++++++++++++++- .../mocks/jetstream_consumer_info_listener.go | 2 +- internal/pkg/mocks/jetstream_stream.go | 2 +- pkg/microservice/messaging/nats_test.go | 6 +- 6 files changed, 147 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 5e22b43b..83cc60a1 100644 --- a/go.mod +++ b/go.mod @@ -7,9 +7,9 @@ require ( github.com/gorilla/mux v1.8.1 github.com/miekg/dns v1.1.58 github.com/mvmaasakkers/certificates v0.7.2 - github.com/nats-io/nats.go v1.31.0 + github.com/nats-io/nats.go v1.33.1 github.com/prometheus/client_golang v1.18.0 - github.com/rs/zerolog v1.31.0 + github.com/rs/zerolog v1.32.0 github.com/spf13/viper v1.18.2 github.com/stretchr/testify v1.8.4 go.uber.org/mock v0.4.0 @@ -28,7 +28,7 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/nats-io/nkeys v0.4.6 // indirect + github.com/nats-io/nkeys v0.4.7 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect diff --git a/go.sum b/go.sum index 0829ab0b..91211440 100644 --- a/go.sum +++ b/go.sum @@ -43,10 +43,10 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mvmaasakkers/certificates v0.7.2 h1:bV3x1XewlN+OJ9ufzeqSbQlQrR+orMdQylN2Czu1MrA= github.com/mvmaasakkers/certificates v0.7.2/go.mod h1:MpmgTzKcPJnGbDdZtaz/oZ0ak40/jy1EmxKeex5tPZg= -github.com/nats-io/nats.go v1.31.0 h1:/WFBHEc/dOKBF6qf1TZhrdEfTmOZ5JzdJ+Y3m6Y/p7E= -github.com/nats-io/nats.go v1.31.0/go.mod h1:di3Bm5MLsoB4Bx61CBTsxuarI36WbhAwOm8QrW39+i8= -github.com/nats-io/nkeys v0.4.6 h1:IzVe95ru2CT6ta874rt9saQRkWfe2nFj1NtvYSLqMzY= -github.com/nats-io/nkeys v0.4.6/go.mod h1:4DxZNzenSVd1cYQoAa8948QY3QDjrHfcfVADymtkpts= +github.com/nats-io/nats.go v1.33.1 h1:8TxLZZ/seeEfR97qV0/Bl939tpDnt2Z2fK3HkPypj70= +github.com/nats-io/nats.go v1.33.1/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8= +github.com/nats-io/nkeys v0.4.7 h1:RwNJbbIdYCoClSDNY7QVKZlyb/wfT6ugvFCiKy6vDvI= +github.com/nats-io/nkeys v0.4.7/go.mod h1:kqXRgRDPlGy7nGaEDMuYzmiJCIAAWDK0IMBtDmGD0nc= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= @@ -66,8 +66,8 @@ github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3c github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= -github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= diff --git a/internal/pkg/mocks/jetstream.go b/internal/pkg/mocks/jetstream.go index 2e4d9add..b113aceb 100644 --- a/internal/pkg/mocks/jetstream.go +++ b/internal/pkg/mocks/jetstream.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen --destination internal/pkg/mocks/jetstream.go --package mocks github.com/nats-io/nats.go/jetstream JetStream +// mockgen --destination ../../../internal/pkg/mocks/jetstream.go --package mocks github.com/nats-io/nats.go/jetstream JetStream // // Package mocks is a generated GoMock package. @@ -101,6 +101,21 @@ func (mr *MockJetStreamMockRecorder) CreateKeyValue(arg0, arg1 any) *gomock.Call return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateKeyValue", reflect.TypeOf((*MockJetStream)(nil).CreateKeyValue), arg0, arg1) } +// CreateObjectStore mocks base method. +func (m *MockJetStream) CreateObjectStore(arg0 context.Context, arg1 jetstream.ObjectStoreConfig) (jetstream.ObjectStore, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateObjectStore", arg0, arg1) + ret0, _ := ret[0].(jetstream.ObjectStore) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateObjectStore indicates an expected call of CreateObjectStore. +func (mr *MockJetStreamMockRecorder) CreateObjectStore(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateObjectStore", reflect.TypeOf((*MockJetStream)(nil).CreateObjectStore), arg0, arg1) +} + // CreateOrUpdateConsumer mocks base method. func (m *MockJetStream) CreateOrUpdateConsumer(arg0 context.Context, arg1 string, arg2 jetstream.ConsumerConfig) (jetstream.Consumer, error) { m.ctrl.T.Helper() @@ -116,6 +131,36 @@ func (mr *MockJetStreamMockRecorder) CreateOrUpdateConsumer(arg0, arg1, arg2 any return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdateConsumer", reflect.TypeOf((*MockJetStream)(nil).CreateOrUpdateConsumer), arg0, arg1, arg2) } +// CreateOrUpdateKeyValue mocks base method. +func (m *MockJetStream) CreateOrUpdateKeyValue(arg0 context.Context, arg1 jetstream.KeyValueConfig) (jetstream.KeyValue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateOrUpdateKeyValue", arg0, arg1) + ret0, _ := ret[0].(jetstream.KeyValue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateOrUpdateKeyValue indicates an expected call of CreateOrUpdateKeyValue. +func (mr *MockJetStreamMockRecorder) CreateOrUpdateKeyValue(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdateKeyValue", reflect.TypeOf((*MockJetStream)(nil).CreateOrUpdateKeyValue), arg0, arg1) +} + +// CreateOrUpdateObjectStore mocks base method. +func (m *MockJetStream) CreateOrUpdateObjectStore(arg0 context.Context, arg1 jetstream.ObjectStoreConfig) (jetstream.ObjectStore, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateOrUpdateObjectStore", arg0, arg1) + ret0, _ := ret[0].(jetstream.ObjectStore) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateOrUpdateObjectStore indicates an expected call of CreateOrUpdateObjectStore. +func (mr *MockJetStreamMockRecorder) CreateOrUpdateObjectStore(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdateObjectStore", reflect.TypeOf((*MockJetStream)(nil).CreateOrUpdateObjectStore), arg0, arg1) +} + // CreateOrUpdateStream mocks base method. func (m *MockJetStream) CreateOrUpdateStream(arg0 context.Context, arg1 jetstream.StreamConfig) (jetstream.Stream, error) { m.ctrl.T.Helper() @@ -174,6 +219,20 @@ func (mr *MockJetStreamMockRecorder) DeleteKeyValue(arg0, arg1 any) *gomock.Call return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteKeyValue", reflect.TypeOf((*MockJetStream)(nil).DeleteKeyValue), arg0, arg1) } +// DeleteObjectStore mocks base method. +func (m *MockJetStream) DeleteObjectStore(arg0 context.Context, arg1 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteObjectStore", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteObjectStore indicates an expected call of DeleteObjectStore. +func (mr *MockJetStreamMockRecorder) DeleteObjectStore(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteObjectStore", reflect.TypeOf((*MockJetStream)(nil).DeleteObjectStore), arg0, arg1) +} + // DeleteStream mocks base method. func (m *MockJetStream) DeleteStream(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() @@ -250,6 +309,49 @@ func (mr *MockJetStreamMockRecorder) ListStreams(arg0 any, arg1 ...any) *gomock. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListStreams", reflect.TypeOf((*MockJetStream)(nil).ListStreams), varargs...) } +// ObjectStore mocks base method. +func (m *MockJetStream) ObjectStore(arg0 context.Context, arg1 string) (jetstream.ObjectStore, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ObjectStore", arg0, arg1) + ret0, _ := ret[0].(jetstream.ObjectStore) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ObjectStore indicates an expected call of ObjectStore. +func (mr *MockJetStreamMockRecorder) ObjectStore(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ObjectStore", reflect.TypeOf((*MockJetStream)(nil).ObjectStore), arg0, arg1) +} + +// ObjectStoreNames mocks base method. +func (m *MockJetStream) ObjectStoreNames(arg0 context.Context) jetstream.ObjectStoreNamesLister { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ObjectStoreNames", arg0) + ret0, _ := ret[0].(jetstream.ObjectStoreNamesLister) + return ret0 +} + +// ObjectStoreNames indicates an expected call of ObjectStoreNames. +func (mr *MockJetStreamMockRecorder) ObjectStoreNames(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ObjectStoreNames", reflect.TypeOf((*MockJetStream)(nil).ObjectStoreNames), arg0) +} + +// ObjectStores mocks base method. +func (m *MockJetStream) ObjectStores(arg0 context.Context) jetstream.ObjectStoresLister { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ObjectStores", arg0) + ret0, _ := ret[0].(jetstream.ObjectStoresLister) + return ret0 +} + +// ObjectStores indicates an expected call of ObjectStores. +func (mr *MockJetStreamMockRecorder) ObjectStores(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ObjectStores", reflect.TypeOf((*MockJetStream)(nil).ObjectStores), arg0) +} + // OrderedConsumer mocks base method. func (m *MockJetStream) OrderedConsumer(arg0 context.Context, arg1 string, arg2 jetstream.OrderedConsumerConfig) (jetstream.Consumer, error) { m.ctrl.T.Helper() @@ -437,6 +539,36 @@ func (mr *MockJetStreamMockRecorder) UpdateConsumer(arg0, arg1, arg2 any) *gomoc return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateConsumer", reflect.TypeOf((*MockJetStream)(nil).UpdateConsumer), arg0, arg1, arg2) } +// UpdateKeyValue mocks base method. +func (m *MockJetStream) UpdateKeyValue(arg0 context.Context, arg1 jetstream.KeyValueConfig) (jetstream.KeyValue, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateKeyValue", arg0, arg1) + ret0, _ := ret[0].(jetstream.KeyValue) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateKeyValue indicates an expected call of UpdateKeyValue. +func (mr *MockJetStreamMockRecorder) UpdateKeyValue(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateKeyValue", reflect.TypeOf((*MockJetStream)(nil).UpdateKeyValue), arg0, arg1) +} + +// UpdateObjectStore mocks base method. +func (m *MockJetStream) UpdateObjectStore(arg0 context.Context, arg1 jetstream.ObjectStoreConfig) (jetstream.ObjectStore, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateObjectStore", arg0, arg1) + ret0, _ := ret[0].(jetstream.ObjectStore) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateObjectStore indicates an expected call of UpdateObjectStore. +func (mr *MockJetStreamMockRecorder) UpdateObjectStore(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateObjectStore", reflect.TypeOf((*MockJetStream)(nil).UpdateObjectStore), arg0, arg1) +} + // UpdateStream mocks base method. func (m *MockJetStream) UpdateStream(arg0 context.Context, arg1 jetstream.StreamConfig) (jetstream.Stream, error) { m.ctrl.T.Helper() diff --git a/internal/pkg/mocks/jetstream_consumer_info_listener.go b/internal/pkg/mocks/jetstream_consumer_info_listener.go index 4eba0de6..4149f5c5 100644 --- a/internal/pkg/mocks/jetstream_consumer_info_listener.go +++ b/internal/pkg/mocks/jetstream_consumer_info_listener.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen --destination internal/pkg/mocks/jetstream_consumer_info_listener.go --package mocks github.com/nats-io/nats.go/jetstream ConsumerInfoLister +// mockgen --destination ../../../internal/pkg/mocks/jetstream_consumer_info_listener.go --package mocks github.com/nats-io/nats.go/jetstream ConsumerInfoLister // // Package mocks is a generated GoMock package. diff --git a/internal/pkg/mocks/jetstream_stream.go b/internal/pkg/mocks/jetstream_stream.go index ff729224..1f283a6e 100644 --- a/internal/pkg/mocks/jetstream_stream.go +++ b/internal/pkg/mocks/jetstream_stream.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen --destination internal/pkg/mocks/jetstream_stream.go --package mocks github.com/nats-io/nats.go/jetstream Stream +// mockgen --destination ../../../internal/pkg/mocks/jetstream_stream.go --package mocks github.com/nats-io/nats.go/jetstream Stream // // Package mocks is a generated GoMock package. diff --git a/pkg/microservice/messaging/nats_test.go b/pkg/microservice/messaging/nats_test.go index 183cca43..6f6043c0 100644 --- a/pkg/microservice/messaging/nats_test.go +++ b/pkg/microservice/messaging/nats_test.go @@ -12,9 +12,9 @@ import ( "go.uber.org/mock/gomock" ) -//go:generate mockgen --destination internal/pkg/mocks/jetstream.go --package mocks github.com/nats-io/nats.go/jetstream JetStream -//go:generate mockgen --destination internal/pkg/mocks/jetstream_stream.go --package mocks github.com/nats-io/nats.go/jetstream Stream -//go:generate mockgen --destination internal/pkg/mocks/jetstream_consumer_info_listener.go --package mocks github.com/nats-io/nats.go/jetstream ConsumerInfoLister +//go:generate mockgen --destination ../../../internal/pkg/mocks/jetstream.go --package mocks github.com/nats-io/nats.go/jetstream JetStream +//go:generate mockgen --destination ../../../internal/pkg/mocks/jetstream_stream.go --package mocks github.com/nats-io/nats.go/jetstream Stream +//go:generate mockgen --destination ../../../internal/pkg/mocks/jetstream_consumer_info_listener.go --package mocks github.com/nats-io/nats.go/jetstream ConsumerInfoLister func Test_natsBroker_CreatePersistentMessageStore(t *testing.T) { t.Run("successful", func(t *testing.T) { ctrl := gomock.NewController(t)