Skip to content
Snippets Groups Projects
Commit c2276e84 authored by Pavel Antonov's avatar Pavel Antonov :asterisk:
Browse files

Merge branch 'feature/PRXS-1619-AsyncSyncMethods' into 'master'

Добавлены longtime operation. Добавлено описание сервиса OperationService и ExtensionService

See merge request perxis/perxis-go!88
parents 0c840961 7f871bb4
No related branches found
No related tags found
No related merge requests found
Showing
with 510 additions and 116 deletions
...@@ -4,7 +4,7 @@ SHELL = bash ...@@ -4,7 +4,7 @@ SHELL = bash
PROTODIR=perxis-proto/proto PROTODIR=perxis-proto/proto
DSTDIR=./proto DSTDIR=./proto
ALLPROTO?=$(shell find $(PROTODIR) -name '*.proto' ) ALLPROTO?=$(shell find -L $(PROTODIR) -name '*.proto' )
# Убираем status.proto нужен только для front # Убираем status.proto нужен только для front
PROTOFILES= $(filter-out $(PROTODIR)/status/status.proto, $(ALLPROTO)) PROTOFILES= $(filter-out $(PROTODIR)/status/status.proto, $(ALLPROTO))
PROTOGOFILES=$(PROTOFILES:.proto=.pb.go) PROTOGOFILES=$(PROTOFILES:.proto=.pb.go)
...@@ -19,7 +19,8 @@ SERVICERECOVERING=$(shell find $(PKGDIR) -name "recovering_middleware.go" -type ...@@ -19,7 +19,8 @@ SERVICERECOVERING=$(shell find $(PKGDIR) -name "recovering_middleware.go" -type
# Генерация grpc-клиентов для go # Генерация grpc-клиентов для go
proto: protoc-check protoc-gen-go-check $(PROTOGOFILES) proto: protoc-check protoc-gen-go-check $(PROTOGOFILES)
@echo "Generated all protobuf Go files" @echo "Generate Go from proto files"
@find $(PROTODIR) -name '*.proto'
%.pb.go: %.proto %.pb.go: %.proto
@protoc -I=$(PROTODIR) --experimental_allow_proto3_optional --go_out=$(DSTDIR) --go-grpc_out=$(DSTDIR) --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative "$<" @protoc -I=$(PROTODIR) --experimental_allow_proto3_optional --go_out=$(DSTDIR) --go-grpc_out=$(DSTDIR) --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative "$<"
...@@ -40,8 +41,8 @@ endif ...@@ -40,8 +41,8 @@ endif
protoc-gen-go-check: protoc-gen-go-check:
ifeq (,$(wildcard $(GOPATH)/bin/protoc-gen-go)) ifeq (,$(wildcard $(GOPATH)/bin/protoc-gen-go))
$(error "Protocol Buffers Go plugin not found. \ $(error "Protocol Buffers Go plugin not found. \
Run \"go get -u google.golang.org/protobuf/cmd/protoc-gen-go google.golang.org/grpc/cmd/protoc-gen-go-grpc\" \ Run \"go install google.golang.org/protobuf/cmd/protoc-gen-go@latest google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest\" \
or visit \"https://github.com/golang/protobuf/tree/v1.3.2#installation\" for more.\n") or visit \"https://grpc.io/docs/languages/go/quickstart/\" for more.\n")
endif endif
# Генерация логгирования (access & error) для всех сервисов. Предполагается наличие файлов `logging_middleware.go/error_middleware.go` # Генерация логгирования (access & error) для всех сервисов. Предполагается наличие файлов `logging_middleware.go/error_middleware.go`
...@@ -78,8 +79,9 @@ recovering: $(SERVICERECOVERING) ...@@ -78,8 +79,9 @@ recovering: $(SERVICERECOVERING)
# Генерация моков для всех интерфейсов, найденных в директории. Выходные файлы с моками сохраняются в `./mocks` # Генерация моков для всех интерфейсов, найденных в директории. Выходные файлы с моками сохраняются в `./mocks`
MOCKSDIRS?=$(shell find . -name "service.go" -exec dirname {} \;) MOCKSDIRS?=$(shell find . -name "service.go" -exec dirname {} \;)
MOCKS=$(MOCKSDIRS:=/mocks) MOCKS=$(MOCKSDIRS:=/mocks)
PROTOMOCKS=$(PROTODIR:=/mocks)
mocks: $(MOCKS) mocks: $(PROTOMOCKS)
@echo "Generate mocks $<" @echo "Generate mocks $<"
%/mocks: % %/mocks: %
......
version: '3'
vars:
PROTODIR: perxis-proto/proto
PBDIR: pb
tasks:
mocks:
deps:
- mocks.proto
mocks.proto:
sources:
- proto/**/*.proto
generates:
- proto/mocks/*.go
cmds:
- mockery --all --dir proto --output proto/mocks
proto:
sources:
- '{{ .PROTODIR }}/**/*.proto'
# generates:
# - '{{ .PBDIR }}/*.go'
ignore_error: true # Игнорировать ошибки, из-за status/status.proto
# silent: true
cmds:
- for: sources
cmd: echo {{ .ITEM }}
# cmd: '[ "{{.FILE}}" != "perxis-proto/proto/status/status.proto" ]'
# - protoc --proto_path={{ .PROTODIR }} --experimental_allow_proto3_optional --go_out={{ .PBDIR }} --go-grpc_out={{ .PBDIR }} --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative {{ .FILE }}
# cmd: protoc --proto_path={{ .PROTODIR }} --experimental_allow_proto3_optional --go_out={{ .PBDIR }} --go-grpc_out={{ .PBDIR }} --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative {{ .ITEM }}
# task: proto_file
# vars:
# FILE: '{{ .ITEM }}'
# ignore_error: true
proto_file:
sources:
- '{{ .FILE }}'
cmds:
- '[ "{{.FILE}}" != "perxis-proto/proto/status/status.proto" ]' # Игнорировать ошибки, из-за status/status.proto
- protoc --proto_path={{ .PROTODIR }} --experimental_allow_proto3_optional --go_out={{ .PBDIR }} --go-grpc_out={{ .PBDIR }} --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative {{ .FILE }}
silent: true
\ No newline at end of file
// Code generated by mockery v2.15.0. DO NOT EDIT. // Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks package mocks
...@@ -20,6 +20,10 @@ func (_m *Clients) Create(ctx context.Context, client *clients.Client) (*clients ...@@ -20,6 +20,10 @@ func (_m *Clients) Create(ctx context.Context, client *clients.Client) (*clients
ret := _m.Called(ctx, client) ret := _m.Called(ctx, client)
var r0 *clients.Client var r0 *clients.Client
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *clients.Client) (*clients.Client, error)); ok {
return rf(ctx, client)
}
if rf, ok := ret.Get(0).(func(context.Context, *clients.Client) *clients.Client); ok { if rf, ok := ret.Get(0).(func(context.Context, *clients.Client) *clients.Client); ok {
r0 = rf(ctx, client) r0 = rf(ctx, client)
} else { } else {
...@@ -28,7 +32,6 @@ func (_m *Clients) Create(ctx context.Context, client *clients.Client) (*clients ...@@ -28,7 +32,6 @@ func (_m *Clients) Create(ctx context.Context, client *clients.Client) (*clients
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *clients.Client) error); ok { if rf, ok := ret.Get(1).(func(context.Context, *clients.Client) error); ok {
r1 = rf(ctx, client) r1 = rf(ctx, client)
} else { } else {
...@@ -71,6 +74,10 @@ func (_m *Clients) Get(ctx context.Context, spaceId string, id string) (*clients ...@@ -71,6 +74,10 @@ func (_m *Clients) Get(ctx context.Context, spaceId string, id string) (*clients
ret := _m.Called(ctx, spaceId, id) ret := _m.Called(ctx, spaceId, id)
var r0 *clients.Client var r0 *clients.Client
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) (*clients.Client, error)); ok {
return rf(ctx, spaceId, id)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string) *clients.Client); ok { if rf, ok := ret.Get(0).(func(context.Context, string, string) *clients.Client); ok {
r0 = rf(ctx, spaceId, id) r0 = rf(ctx, spaceId, id)
} else { } else {
...@@ -79,7 +86,6 @@ func (_m *Clients) Get(ctx context.Context, spaceId string, id string) (*clients ...@@ -79,7 +86,6 @@ func (_m *Clients) Get(ctx context.Context, spaceId string, id string) (*clients
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
r1 = rf(ctx, spaceId, id) r1 = rf(ctx, spaceId, id)
} else { } else {
...@@ -94,6 +100,10 @@ func (_m *Clients) GetBy(ctx context.Context, spaceId string, params *clients.Ge ...@@ -94,6 +100,10 @@ func (_m *Clients) GetBy(ctx context.Context, spaceId string, params *clients.Ge
ret := _m.Called(ctx, spaceId, params) ret := _m.Called(ctx, spaceId, params)
var r0 *clients.Client var r0 *clients.Client
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, *clients.GetByParams) (*clients.Client, error)); ok {
return rf(ctx, spaceId, params)
}
if rf, ok := ret.Get(0).(func(context.Context, string, *clients.GetByParams) *clients.Client); ok { if rf, ok := ret.Get(0).(func(context.Context, string, *clients.GetByParams) *clients.Client); ok {
r0 = rf(ctx, spaceId, params) r0 = rf(ctx, spaceId, params)
} else { } else {
...@@ -102,7 +112,6 @@ func (_m *Clients) GetBy(ctx context.Context, spaceId string, params *clients.Ge ...@@ -102,7 +112,6 @@ func (_m *Clients) GetBy(ctx context.Context, spaceId string, params *clients.Ge
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, *clients.GetByParams) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string, *clients.GetByParams) error); ok {
r1 = rf(ctx, spaceId, params) r1 = rf(ctx, spaceId, params)
} else { } else {
...@@ -117,6 +126,10 @@ func (_m *Clients) List(ctx context.Context, spaceId string) ([]*clients.Client, ...@@ -117,6 +126,10 @@ func (_m *Clients) List(ctx context.Context, spaceId string) ([]*clients.Client,
ret := _m.Called(ctx, spaceId) ret := _m.Called(ctx, spaceId)
var r0 []*clients.Client var r0 []*clients.Client
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) ([]*clients.Client, error)); ok {
return rf(ctx, spaceId)
}
if rf, ok := ret.Get(0).(func(context.Context, string) []*clients.Client); ok { if rf, ok := ret.Get(0).(func(context.Context, string) []*clients.Client); ok {
r0 = rf(ctx, spaceId) r0 = rf(ctx, spaceId)
} else { } else {
...@@ -125,7 +138,6 @@ func (_m *Clients) List(ctx context.Context, spaceId string) ([]*clients.Client, ...@@ -125,7 +138,6 @@ func (_m *Clients) List(ctx context.Context, spaceId string) ([]*clients.Client,
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, spaceId) r1 = rf(ctx, spaceId)
} else { } else {
...@@ -149,13 +161,12 @@ func (_m *Clients) Update(ctx context.Context, client *clients.Client) error { ...@@ -149,13 +161,12 @@ func (_m *Clients) Update(ctx context.Context, client *clients.Client) error {
return r0 return r0
} }
type mockConstructorTestingTNewClients interface { // NewClients creates a new instance of Clients. 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 NewClients(t interface {
mock.TestingT mock.TestingT
Cleanup(func()) Cleanup(func())
} }) *Clients {
// NewClients creates a new instance of Clients. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewClients(t mockConstructorTestingTNewClients) *Clients {
mock := &Clients{} mock := &Clients{}
mock.Mock.Test(t) mock.Mock.Test(t)
......
// Code generated by mockery v2.15.0. DO NOT EDIT. // Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks package mocks
...@@ -29,13 +29,12 @@ func (_m *Middleware) Execute(_a0 clients.Clients) clients.Clients { ...@@ -29,13 +29,12 @@ func (_m *Middleware) Execute(_a0 clients.Clients) clients.Clients {
return r0 return r0
} }
type mockConstructorTestingTNewMiddleware interface { // NewMiddleware creates a new instance of Middleware. 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 NewMiddleware(t interface {
mock.TestingT mock.TestingT
Cleanup(func()) Cleanup(func())
} }) *Middleware {
// NewMiddleware creates a new instance of Middleware. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewMiddleware(t mockConstructorTestingTNewMiddleware) *Middleware {
mock := &Middleware{} mock := &Middleware{}
mock.Mock.Test(t) mock.Mock.Test(t)
......
// Code generated by mockery v2.15.0. DO NOT EDIT. // Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks package mocks
...@@ -22,6 +22,10 @@ func (_m *Storage) Create(ctx context.Context, client *clients.Client) (*clients ...@@ -22,6 +22,10 @@ func (_m *Storage) Create(ctx context.Context, client *clients.Client) (*clients
ret := _m.Called(ctx, client) ret := _m.Called(ctx, client)
var r0 *clients.Client var r0 *clients.Client
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *clients.Client) (*clients.Client, error)); ok {
return rf(ctx, client)
}
if rf, ok := ret.Get(0).(func(context.Context, *clients.Client) *clients.Client); ok { if rf, ok := ret.Get(0).(func(context.Context, *clients.Client) *clients.Client); ok {
r0 = rf(ctx, client) r0 = rf(ctx, client)
} else { } else {
...@@ -30,7 +34,6 @@ func (_m *Storage) Create(ctx context.Context, client *clients.Client) (*clients ...@@ -30,7 +34,6 @@ func (_m *Storage) Create(ctx context.Context, client *clients.Client) (*clients
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *clients.Client) error); ok { if rf, ok := ret.Get(1).(func(context.Context, *clients.Client) error); ok {
r1 = rf(ctx, client) r1 = rf(ctx, client)
} else { } else {
...@@ -59,6 +62,11 @@ func (_m *Storage) Find(ctx context.Context, spaceId string, filter *clients.Fil ...@@ -59,6 +62,11 @@ func (_m *Storage) Find(ctx context.Context, spaceId string, filter *clients.Fil
ret := _m.Called(ctx, spaceId, filter, opts) ret := _m.Called(ctx, spaceId, filter, opts)
var r0 []*clients.Client var r0 []*clients.Client
var r1 int
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, string, *clients.Filter, *options.FindOptions) ([]*clients.Client, int, error)); ok {
return rf(ctx, spaceId, filter, opts)
}
if rf, ok := ret.Get(0).(func(context.Context, string, *clients.Filter, *options.FindOptions) []*clients.Client); ok { if rf, ok := ret.Get(0).(func(context.Context, string, *clients.Filter, *options.FindOptions) []*clients.Client); ok {
r0 = rf(ctx, spaceId, filter, opts) r0 = rf(ctx, spaceId, filter, opts)
} else { } else {
...@@ -67,14 +75,12 @@ func (_m *Storage) Find(ctx context.Context, spaceId string, filter *clients.Fil ...@@ -67,14 +75,12 @@ func (_m *Storage) Find(ctx context.Context, spaceId string, filter *clients.Fil
} }
} }
var r1 int
if rf, ok := ret.Get(1).(func(context.Context, string, *clients.Filter, *options.FindOptions) int); ok { if rf, ok := ret.Get(1).(func(context.Context, string, *clients.Filter, *options.FindOptions) int); ok {
r1 = rf(ctx, spaceId, filter, opts) r1 = rf(ctx, spaceId, filter, opts)
} else { } else {
r1 = ret.Get(1).(int) r1 = ret.Get(1).(int)
} }
var r2 error
if rf, ok := ret.Get(2).(func(context.Context, string, *clients.Filter, *options.FindOptions) error); ok { if rf, ok := ret.Get(2).(func(context.Context, string, *clients.Filter, *options.FindOptions) error); ok {
r2 = rf(ctx, spaceId, filter, opts) r2 = rf(ctx, spaceId, filter, opts)
} else { } else {
...@@ -117,20 +123,23 @@ func (_m *Storage) Update(ctx context.Context, upd *clients.Client) (int, int, e ...@@ -117,20 +123,23 @@ func (_m *Storage) Update(ctx context.Context, upd *clients.Client) (int, int, e
ret := _m.Called(ctx, upd) ret := _m.Called(ctx, upd)
var r0 int var r0 int
var r1 int
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, *clients.Client) (int, int, error)); ok {
return rf(ctx, upd)
}
if rf, ok := ret.Get(0).(func(context.Context, *clients.Client) int); ok { if rf, ok := ret.Get(0).(func(context.Context, *clients.Client) int); ok {
r0 = rf(ctx, upd) r0 = rf(ctx, upd)
} else { } else {
r0 = ret.Get(0).(int) r0 = ret.Get(0).(int)
} }
var r1 int
if rf, ok := ret.Get(1).(func(context.Context, *clients.Client) int); ok { if rf, ok := ret.Get(1).(func(context.Context, *clients.Client) int); ok {
r1 = rf(ctx, upd) r1 = rf(ctx, upd)
} else { } else {
r1 = ret.Get(1).(int) r1 = ret.Get(1).(int)
} }
var r2 error
if rf, ok := ret.Get(2).(func(context.Context, *clients.Client) error); ok { if rf, ok := ret.Get(2).(func(context.Context, *clients.Client) error); ok {
r2 = rf(ctx, upd) r2 = rf(ctx, upd)
} else { } else {
...@@ -140,13 +149,12 @@ func (_m *Storage) Update(ctx context.Context, upd *clients.Client) (int, int, e ...@@ -140,13 +149,12 @@ func (_m *Storage) Update(ctx context.Context, upd *clients.Client) (int, int, e
return r0, r1, r2 return r0, r1, r2
} }
type mockConstructorTestingTNewStorage interface { // NewStorage creates a new instance of Storage. 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 NewStorage(t interface {
mock.TestingT mock.TestingT
Cleanup(func()) Cleanup(func())
} }) *Storage {
// NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewStorage(t mockConstructorTestingTNewStorage) *Storage {
mock := &Storage{} mock := &Storage{}
mock.Mock.Test(t) mock.Mock.Test(t)
......
// Code generated by mockery v2.15.0. DO NOT EDIT. // Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks package mocks
...@@ -9,13 +9,12 @@ type CollaboratorObserver struct { ...@@ -9,13 +9,12 @@ type CollaboratorObserver struct {
mock.Mock mock.Mock
} }
type mockConstructorTestingTNewCollaboratorObserver interface { // NewCollaboratorObserver creates a new instance of CollaboratorObserver. 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 NewCollaboratorObserver(t interface {
mock.TestingT mock.TestingT
Cleanup(func()) Cleanup(func())
} }) *CollaboratorObserver {
// NewCollaboratorObserver creates a new instance of CollaboratorObserver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewCollaboratorObserver(t mockConstructorTestingTNewCollaboratorObserver) *CollaboratorObserver {
mock := &CollaboratorObserver{} mock := &CollaboratorObserver{}
mock.Mock.Test(t) mock.Mock.Test(t)
......
// Code generated by mockery v2.15.0. DO NOT EDIT. // Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks package mocks
...@@ -20,13 +20,16 @@ func (_m *CollaboratorRemoveObserver) OnCollaboratorRemove(ctx context.Context, ...@@ -20,13 +20,16 @@ func (_m *CollaboratorRemoveObserver) OnCollaboratorRemove(ctx context.Context,
ret := _m.Called(ctx, collaborator) ret := _m.Called(ctx, collaborator)
var r0 string var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *collaborators.Collaborator) (string, error)); ok {
return rf(ctx, collaborator)
}
if rf, ok := ret.Get(0).(func(context.Context, *collaborators.Collaborator) string); ok { if rf, ok := ret.Get(0).(func(context.Context, *collaborators.Collaborator) string); ok {
r0 = rf(ctx, collaborator) r0 = rf(ctx, collaborator)
} else { } else {
r0 = ret.Get(0).(string) r0 = ret.Get(0).(string)
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *collaborators.Collaborator) error); ok { if rf, ok := ret.Get(1).(func(context.Context, *collaborators.Collaborator) error); ok {
r1 = rf(ctx, collaborator) r1 = rf(ctx, collaborator)
} else { } else {
...@@ -36,13 +39,12 @@ func (_m *CollaboratorRemoveObserver) OnCollaboratorRemove(ctx context.Context, ...@@ -36,13 +39,12 @@ func (_m *CollaboratorRemoveObserver) OnCollaboratorRemove(ctx context.Context,
return r0, r1 return r0, r1
} }
type mockConstructorTestingTNewCollaboratorRemoveObserver interface { // NewCollaboratorRemoveObserver creates a new instance of CollaboratorRemoveObserver. 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 NewCollaboratorRemoveObserver(t interface {
mock.TestingT mock.TestingT
Cleanup(func()) Cleanup(func())
} }) *CollaboratorRemoveObserver {
// NewCollaboratorRemoveObserver creates a new instance of CollaboratorRemoveObserver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewCollaboratorRemoveObserver(t mockConstructorTestingTNewCollaboratorRemoveObserver) *CollaboratorRemoveObserver {
mock := &CollaboratorRemoveObserver{} mock := &CollaboratorRemoveObserver{}
mock.Mock.Test(t) mock.Mock.Test(t)
......
// Code generated by mockery v2.15.0. DO NOT EDIT. // Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks package mocks
...@@ -20,13 +20,16 @@ func (_m *CollaboratorSetObserver) OnCollaboratorSet(ctx context.Context, collab ...@@ -20,13 +20,16 @@ func (_m *CollaboratorSetObserver) OnCollaboratorSet(ctx context.Context, collab
ret := _m.Called(ctx, collaborator) ret := _m.Called(ctx, collaborator)
var r0 string var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *collaborators.Collaborator) (string, error)); ok {
return rf(ctx, collaborator)
}
if rf, ok := ret.Get(0).(func(context.Context, *collaborators.Collaborator) string); ok { if rf, ok := ret.Get(0).(func(context.Context, *collaborators.Collaborator) string); ok {
r0 = rf(ctx, collaborator) r0 = rf(ctx, collaborator)
} else { } else {
r0 = ret.Get(0).(string) r0 = ret.Get(0).(string)
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *collaborators.Collaborator) error); ok { if rf, ok := ret.Get(1).(func(context.Context, *collaborators.Collaborator) error); ok {
r1 = rf(ctx, collaborator) r1 = rf(ctx, collaborator)
} else { } else {
...@@ -36,13 +39,12 @@ func (_m *CollaboratorSetObserver) OnCollaboratorSet(ctx context.Context, collab ...@@ -36,13 +39,12 @@ func (_m *CollaboratorSetObserver) OnCollaboratorSet(ctx context.Context, collab
return r0, r1 return r0, r1
} }
type mockConstructorTestingTNewCollaboratorSetObserver interface { // NewCollaboratorSetObserver creates a new instance of CollaboratorSetObserver. 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 NewCollaboratorSetObserver(t interface {
mock.TestingT mock.TestingT
Cleanup(func()) Cleanup(func())
} }) *CollaboratorSetObserver {
// NewCollaboratorSetObserver creates a new instance of CollaboratorSetObserver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewCollaboratorSetObserver(t mockConstructorTestingTNewCollaboratorSetObserver) *CollaboratorSetObserver {
mock := &CollaboratorSetObserver{} mock := &CollaboratorSetObserver{}
mock.Mock.Test(t) mock.Mock.Test(t)
......
// Code generated by mockery v2.15.0. DO NOT EDIT. // Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks package mocks
...@@ -20,13 +20,16 @@ func (_m *Collaborators) Get(ctx context.Context, spaceId string, subject string ...@@ -20,13 +20,16 @@ func (_m *Collaborators) Get(ctx context.Context, spaceId string, subject string
ret := _m.Called(ctx, spaceId, subject) ret := _m.Called(ctx, spaceId, subject)
var r0 string var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) (string, error)); ok {
return rf(ctx, spaceId, subject)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string) string); ok { if rf, ok := ret.Get(0).(func(context.Context, string, string) string); ok {
r0 = rf(ctx, spaceId, subject) r0 = rf(ctx, spaceId, subject)
} else { } else {
r0 = ret.Get(0).(string) r0 = ret.Get(0).(string)
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
r1 = rf(ctx, spaceId, subject) r1 = rf(ctx, spaceId, subject)
} else { } else {
...@@ -41,6 +44,10 @@ func (_m *Collaborators) ListCollaborators(ctx context.Context, spaceId string) ...@@ -41,6 +44,10 @@ func (_m *Collaborators) ListCollaborators(ctx context.Context, spaceId string)
ret := _m.Called(ctx, spaceId) ret := _m.Called(ctx, spaceId)
var r0 []*collaborators.Collaborator var r0 []*collaborators.Collaborator
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) ([]*collaborators.Collaborator, error)); ok {
return rf(ctx, spaceId)
}
if rf, ok := ret.Get(0).(func(context.Context, string) []*collaborators.Collaborator); ok { if rf, ok := ret.Get(0).(func(context.Context, string) []*collaborators.Collaborator); ok {
r0 = rf(ctx, spaceId) r0 = rf(ctx, spaceId)
} else { } else {
...@@ -49,7 +56,6 @@ func (_m *Collaborators) ListCollaborators(ctx context.Context, spaceId string) ...@@ -49,7 +56,6 @@ func (_m *Collaborators) ListCollaborators(ctx context.Context, spaceId string)
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, spaceId) r1 = rf(ctx, spaceId)
} else { } else {
...@@ -64,6 +70,10 @@ func (_m *Collaborators) ListSpaces(ctx context.Context, subject string) ([]*col ...@@ -64,6 +70,10 @@ func (_m *Collaborators) ListSpaces(ctx context.Context, subject string) ([]*col
ret := _m.Called(ctx, subject) ret := _m.Called(ctx, subject)
var r0 []*collaborators.Collaborator var r0 []*collaborators.Collaborator
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) ([]*collaborators.Collaborator, error)); ok {
return rf(ctx, subject)
}
if rf, ok := ret.Get(0).(func(context.Context, string) []*collaborators.Collaborator); ok { if rf, ok := ret.Get(0).(func(context.Context, string) []*collaborators.Collaborator); ok {
r0 = rf(ctx, subject) r0 = rf(ctx, subject)
} else { } else {
...@@ -72,7 +82,6 @@ func (_m *Collaborators) ListSpaces(ctx context.Context, subject string) ([]*col ...@@ -72,7 +82,6 @@ func (_m *Collaborators) ListSpaces(ctx context.Context, subject string) ([]*col
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, subject) r1 = rf(ctx, subject)
} else { } else {
...@@ -110,13 +119,12 @@ func (_m *Collaborators) Set(ctx context.Context, spaceId string, subject string ...@@ -110,13 +119,12 @@ func (_m *Collaborators) Set(ctx context.Context, spaceId string, subject string
return r0 return r0
} }
type mockConstructorTestingTNewCollaborators interface { // NewCollaborators creates a new instance of Collaborators. 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 NewCollaborators(t interface {
mock.TestingT mock.TestingT
Cleanup(func()) Cleanup(func())
} }) *Collaborators {
// NewCollaborators creates a new instance of Collaborators. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewCollaborators(t mockConstructorTestingTNewCollaborators) *Collaborators {
mock := &Collaborators{} mock := &Collaborators{}
mock.Mock.Test(t) mock.Mock.Test(t)
......
// Code generated by mockery v2.15.0. DO NOT EDIT. // Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks package mocks
...@@ -29,13 +29,12 @@ func (_m *Middleware) Execute(_a0 collaborators.Collaborators) collaborators.Col ...@@ -29,13 +29,12 @@ func (_m *Middleware) Execute(_a0 collaborators.Collaborators) collaborators.Col
return r0 return r0
} }
type mockConstructorTestingTNewMiddleware interface { // NewMiddleware creates a new instance of Middleware. 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 NewMiddleware(t interface {
mock.TestingT mock.TestingT
Cleanup(func()) Cleanup(func())
} }) *Middleware {
// NewMiddleware creates a new instance of Middleware. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewMiddleware(t mockConstructorTestingTNewMiddleware) *Middleware {
mock := &Middleware{} mock := &Middleware{}
mock.Mock.Test(t) mock.Mock.Test(t)
......
// Code generated by mockery v2.15.0. DO NOT EDIT. // Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks package mocks
...@@ -22,13 +22,16 @@ func (_m *Storage) Delete(ctx context.Context, filter *collaborators.Filter) (in ...@@ -22,13 +22,16 @@ func (_m *Storage) Delete(ctx context.Context, filter *collaborators.Filter) (in
ret := _m.Called(ctx, filter) ret := _m.Called(ctx, filter)
var r0 int var r0 int
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *collaborators.Filter) (int, error)); ok {
return rf(ctx, filter)
}
if rf, ok := ret.Get(0).(func(context.Context, *collaborators.Filter) int); ok { if rf, ok := ret.Get(0).(func(context.Context, *collaborators.Filter) int); ok {
r0 = rf(ctx, filter) r0 = rf(ctx, filter)
} else { } else {
r0 = ret.Get(0).(int) r0 = ret.Get(0).(int)
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *collaborators.Filter) error); ok { if rf, ok := ret.Get(1).(func(context.Context, *collaborators.Filter) error); ok {
r1 = rf(ctx, filter) r1 = rf(ctx, filter)
} else { } else {
...@@ -43,6 +46,10 @@ func (_m *Storage) Find(ctx context.Context, filter *collaborators.Filter, opts ...@@ -43,6 +46,10 @@ func (_m *Storage) Find(ctx context.Context, filter *collaborators.Filter, opts
ret := _m.Called(ctx, filter, opts) ret := _m.Called(ctx, filter, opts)
var r0 []*collaborators.Collaborator var r0 []*collaborators.Collaborator
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *collaborators.Filter, *options.FindOptions) ([]*collaborators.Collaborator, error)); ok {
return rf(ctx, filter, opts)
}
if rf, ok := ret.Get(0).(func(context.Context, *collaborators.Filter, *options.FindOptions) []*collaborators.Collaborator); ok { if rf, ok := ret.Get(0).(func(context.Context, *collaborators.Filter, *options.FindOptions) []*collaborators.Collaborator); ok {
r0 = rf(ctx, filter, opts) r0 = rf(ctx, filter, opts)
} else { } else {
...@@ -51,7 +58,6 @@ func (_m *Storage) Find(ctx context.Context, filter *collaborators.Filter, opts ...@@ -51,7 +58,6 @@ func (_m *Storage) Find(ctx context.Context, filter *collaborators.Filter, opts
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *collaborators.Filter, *options.FindOptions) error); ok { if rf, ok := ret.Get(1).(func(context.Context, *collaborators.Filter, *options.FindOptions) error); ok {
r1 = rf(ctx, filter, opts) r1 = rf(ctx, filter, opts)
} else { } else {
...@@ -103,13 +109,12 @@ func (_m *Storage) Set(ctx context.Context, collaborator *collaborators.Collabor ...@@ -103,13 +109,12 @@ func (_m *Storage) Set(ctx context.Context, collaborator *collaborators.Collabor
return r0 return r0
} }
type mockConstructorTestingTNewStorage interface { // NewStorage creates a new instance of Storage. 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 NewStorage(t interface {
mock.TestingT mock.TestingT
Cleanup(func()) Cleanup(func())
} }) *Storage {
// NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewStorage(t mockConstructorTestingTNewStorage) *Storage {
mock := &Storage{} mock := &Storage{}
mock.Mock.Test(t) mock.Mock.Test(t)
......
// Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks
import (
context "context"
collections "git.perx.ru/perxis/perxis-go/pkg/collections"
mock "github.com/stretchr/testify/mock"
)
// CollectionCreatedObserver is an autogenerated mock type for the CollectionCreatedObserver type
type CollectionCreatedObserver struct {
mock.Mock
}
// OnCollectionCreated provides a mock function with given fields: ctx, coll
func (_m *CollectionCreatedObserver) OnCollectionCreated(ctx context.Context, coll *collections.Collection) (string, error) {
ret := _m.Called(ctx, coll)
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) (string, error)); ok {
return rf(ctx, coll)
}
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) string); ok {
r0 = rf(ctx, coll)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection) error); ok {
r1 = rf(ctx, coll)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewCollectionCreatedObserver creates a new instance of CollectionCreatedObserver. 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 NewCollectionCreatedObserver(t interface {
mock.TestingT
Cleanup(func())
}) *CollectionCreatedObserver {
mock := &CollectionCreatedObserver{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks
import (
context "context"
collections "git.perx.ru/perxis/perxis-go/pkg/collections"
mock "github.com/stretchr/testify/mock"
)
// CollectionDeletedObserver is an autogenerated mock type for the CollectionDeletedObserver type
type CollectionDeletedObserver struct {
mock.Mock
}
// OnCollectionDeleted provides a mock function with given fields: ctx, coll
func (_m *CollectionDeletedObserver) OnCollectionDeleted(ctx context.Context, coll *collections.Collection) (string, error) {
ret := _m.Called(ctx, coll)
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) (string, error)); ok {
return rf(ctx, coll)
}
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) string); ok {
r0 = rf(ctx, coll)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection) error); ok {
r1 = rf(ctx, coll)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewCollectionDeletedObserver creates a new instance of CollectionDeletedObserver. 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 NewCollectionDeletedObserver(t interface {
mock.TestingT
Cleanup(func())
}) *CollectionDeletedObserver {
mock := &CollectionDeletedObserver{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks
import (
context "context"
collections "git.perx.ru/perxis/perxis-go/pkg/collections"
mock "github.com/stretchr/testify/mock"
)
// CollectionPreUpdateObserver is an autogenerated mock type for the CollectionPreUpdateObserver type
type CollectionPreUpdateObserver struct {
mock.Mock
}
// OnCollectionPreUpdate provides a mock function with given fields: ctx, before, coll
func (_m *CollectionPreUpdateObserver) OnCollectionPreUpdate(ctx context.Context, before *collections.Collection, coll *collections.Collection) (string, error) {
ret := _m.Called(ctx, before, coll)
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *collections.Collection) (string, error)); ok {
return rf(ctx, before, coll)
}
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *collections.Collection) string); ok {
r0 = rf(ctx, before, coll)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection, *collections.Collection) error); ok {
r1 = rf(ctx, before, coll)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewCollectionPreUpdateObserver creates a new instance of CollectionPreUpdateObserver. 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 NewCollectionPreUpdateObserver(t interface {
mock.TestingT
Cleanup(func())
}) *CollectionPreUpdateObserver {
mock := &CollectionPreUpdateObserver{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks
import (
context "context"
collections "git.perx.ru/perxis/perxis-go/pkg/collections"
mock "github.com/stretchr/testify/mock"
)
// CollectionSetSchemaObserver is an autogenerated mock type for the CollectionSetSchemaObserver type
type CollectionSetSchemaObserver struct {
mock.Mock
}
// OnCollectionSetSchema provides a mock function with given fields: ctx, before, coll
func (_m *CollectionSetSchemaObserver) OnCollectionSetSchema(ctx context.Context, before *collections.Collection, coll *collections.Collection) (string, error) {
ret := _m.Called(ctx, before, coll)
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *collections.Collection) (string, error)); ok {
return rf(ctx, before, coll)
}
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *collections.Collection) string); ok {
r0 = rf(ctx, before, coll)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection, *collections.Collection) error); ok {
r1 = rf(ctx, before, coll)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewCollectionSetSchemaObserver creates a new instance of CollectionSetSchemaObserver. 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 NewCollectionSetSchemaObserver(t interface {
mock.TestingT
Cleanup(func())
}) *CollectionSetSchemaObserver {
mock := &CollectionSetSchemaObserver{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks
import (
context "context"
collections "git.perx.ru/perxis/perxis-go/pkg/collections"
mock "github.com/stretchr/testify/mock"
)
// CollectionUpdatedObserver is an autogenerated mock type for the CollectionUpdatedObserver type
type CollectionUpdatedObserver struct {
mock.Mock
}
// OnCollectionUpdated provides a mock function with given fields: ctx, before, after
func (_m *CollectionUpdatedObserver) OnCollectionUpdated(ctx context.Context, before *collections.Collection, after *collections.Collection) (string, error) {
ret := _m.Called(ctx, before, after)
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *collections.Collection) (string, error)); ok {
return rf(ctx, before, after)
}
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *collections.Collection) string); ok {
r0 = rf(ctx, before, after)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection, *collections.Collection) error); ok {
r1 = rf(ctx, before, after)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewCollectionUpdatedObserver creates a new instance of CollectionUpdatedObserver. 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 NewCollectionUpdatedObserver(t interface {
mock.TestingT
Cleanup(func())
}) *CollectionUpdatedObserver {
mock := &CollectionUpdatedObserver{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.15.0. DO NOT EDIT. // Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks package mocks
...@@ -22,6 +22,10 @@ func (_m *Collections) Create(ctx context.Context, collection *collections.Colle ...@@ -22,6 +22,10 @@ func (_m *Collections) Create(ctx context.Context, collection *collections.Colle
ret := _m.Called(ctx, collection) ret := _m.Called(ctx, collection)
var r0 *collections.Collection var r0 *collections.Collection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) (*collections.Collection, error)); ok {
return rf(ctx, collection)
}
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) *collections.Collection); ok { if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) *collections.Collection); ok {
r0 = rf(ctx, collection) r0 = rf(ctx, collection)
} else { } else {
...@@ -30,7 +34,6 @@ func (_m *Collections) Create(ctx context.Context, collection *collections.Colle ...@@ -30,7 +34,6 @@ func (_m *Collections) Create(ctx context.Context, collection *collections.Colle
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection) error); ok { if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection) error); ok {
r1 = rf(ctx, collection) r1 = rf(ctx, collection)
} else { } else {
...@@ -66,6 +69,10 @@ func (_m *Collections) Get(ctx context.Context, spaceId string, envId string, co ...@@ -66,6 +69,10 @@ func (_m *Collections) Get(ctx context.Context, spaceId string, envId string, co
ret := _m.Called(_ca...) ret := _m.Called(_ca...)
var r0 *collections.Collection var r0 *collections.Collection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...*collections.GetOptions) (*collections.Collection, error)); ok {
return rf(ctx, spaceId, envId, collectionId, options...)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...*collections.GetOptions) *collections.Collection); ok { if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...*collections.GetOptions) *collections.Collection); ok {
r0 = rf(ctx, spaceId, envId, collectionId, options...) r0 = rf(ctx, spaceId, envId, collectionId, options...)
} else { } else {
...@@ -74,7 +81,6 @@ func (_m *Collections) Get(ctx context.Context, spaceId string, envId string, co ...@@ -74,7 +81,6 @@ func (_m *Collections) Get(ctx context.Context, spaceId string, envId string, co
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, string, string, ...*collections.GetOptions) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string, string, string, ...*collections.GetOptions) error); ok {
r1 = rf(ctx, spaceId, envId, collectionId, options...) r1 = rf(ctx, spaceId, envId, collectionId, options...)
} else { } else {
...@@ -89,6 +95,10 @@ func (_m *Collections) List(ctx context.Context, spaceId string, envId string, f ...@@ -89,6 +95,10 @@ func (_m *Collections) List(ctx context.Context, spaceId string, envId string, f
ret := _m.Called(ctx, spaceId, envId, filter) ret := _m.Called(ctx, spaceId, envId, filter)
var r0 []*collections.Collection var r0 []*collections.Collection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, *collections.Filter) ([]*collections.Collection, error)); ok {
return rf(ctx, spaceId, envId, filter)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, *collections.Filter) []*collections.Collection); ok { if rf, ok := ret.Get(0).(func(context.Context, string, string, *collections.Filter) []*collections.Collection); ok {
r0 = rf(ctx, spaceId, envId, filter) r0 = rf(ctx, spaceId, envId, filter)
} else { } else {
...@@ -97,7 +107,6 @@ func (_m *Collections) List(ctx context.Context, spaceId string, envId string, f ...@@ -97,7 +107,6 @@ func (_m *Collections) List(ctx context.Context, spaceId string, envId string, f
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, string, *collections.Filter) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string, string, *collections.Filter) error); ok {
r1 = rf(ctx, spaceId, envId, filter) r1 = rf(ctx, spaceId, envId, filter)
} else { } else {
...@@ -149,13 +158,12 @@ func (_m *Collections) Update(ctx context.Context, coll *collections.Collection) ...@@ -149,13 +158,12 @@ func (_m *Collections) Update(ctx context.Context, coll *collections.Collection)
return r0 return r0
} }
type mockConstructorTestingTNewCollections interface { // NewCollections creates a new instance of Collections. 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 NewCollections(t interface {
mock.TestingT mock.TestingT
Cleanup(func()) Cleanup(func())
} }) *Collections {
// NewCollections creates a new instance of Collections. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewCollections(t mockConstructorTestingTNewCollections) *Collections {
mock := &Collections{} mock := &Collections{}
mock.Mock.Test(t) mock.Mock.Test(t)
......
// Code generated by mockery v2.15.0. DO NOT EDIT. // Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks package mocks
...@@ -29,13 +29,12 @@ func (_m *Middleware) Execute(_a0 collections.Collections) collections.Collectio ...@@ -29,13 +29,12 @@ func (_m *Middleware) Execute(_a0 collections.Collections) collections.Collectio
return r0 return r0
} }
type mockConstructorTestingTNewMiddleware interface { // NewMiddleware creates a new instance of Middleware. 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 NewMiddleware(t interface {
mock.TestingT mock.TestingT
Cleanup(func()) Cleanup(func())
} }) *Middleware {
// NewMiddleware creates a new instance of Middleware. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewMiddleware(t mockConstructorTestingTNewMiddleware) *Middleware {
mock := &Middleware{} mock := &Middleware{}
mock.Mock.Test(t) mock.Mock.Test(t)
......
// Code generated by mockery v2.15.0. DO NOT EDIT. // Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks package mocks
...@@ -20,6 +20,10 @@ func (_m *Storage) Create(ctx context.Context, coll *collections.Collection) (*c ...@@ -20,6 +20,10 @@ func (_m *Storage) Create(ctx context.Context, coll *collections.Collection) (*c
ret := _m.Called(ctx, coll) ret := _m.Called(ctx, coll)
var r0 *collections.Collection var r0 *collections.Collection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) (*collections.Collection, error)); ok {
return rf(ctx, coll)
}
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) *collections.Collection); ok { if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) *collections.Collection); ok {
r0 = rf(ctx, coll) r0 = rf(ctx, coll)
} else { } else {
...@@ -28,7 +32,6 @@ func (_m *Storage) Create(ctx context.Context, coll *collections.Collection) (*c ...@@ -28,7 +32,6 @@ func (_m *Storage) Create(ctx context.Context, coll *collections.Collection) (*c
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection) error); ok { if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection) error); ok {
r1 = rf(ctx, coll) r1 = rf(ctx, coll)
} else { } else {
...@@ -57,6 +60,10 @@ func (_m *Storage) Get(ctx context.Context, spaceId string, envId string, collec ...@@ -57,6 +60,10 @@ func (_m *Storage) Get(ctx context.Context, spaceId string, envId string, collec
ret := _m.Called(ctx, spaceId, envId, collectionId) ret := _m.Called(ctx, spaceId, envId, collectionId)
var r0 *collections.Collection var r0 *collections.Collection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (*collections.Collection, error)); ok {
return rf(ctx, spaceId, envId, collectionId)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, string) *collections.Collection); ok { if rf, ok := ret.Get(0).(func(context.Context, string, string, string) *collections.Collection); ok {
r0 = rf(ctx, spaceId, envId, collectionId) r0 = rf(ctx, spaceId, envId, collectionId)
} else { } else {
...@@ -65,7 +72,6 @@ func (_m *Storage) Get(ctx context.Context, spaceId string, envId string, collec ...@@ -65,7 +72,6 @@ func (_m *Storage) Get(ctx context.Context, spaceId string, envId string, collec
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok {
r1 = rf(ctx, spaceId, envId, collectionId) r1 = rf(ctx, spaceId, envId, collectionId)
} else { } else {
...@@ -94,6 +100,10 @@ func (_m *Storage) List(ctx context.Context, spaceId string, envId string, filte ...@@ -94,6 +100,10 @@ func (_m *Storage) List(ctx context.Context, spaceId string, envId string, filte
ret := _m.Called(ctx, spaceId, envId, filter) ret := _m.Called(ctx, spaceId, envId, filter)
var r0 []*collections.Collection var r0 []*collections.Collection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, *collections.Filter) ([]*collections.Collection, error)); ok {
return rf(ctx, spaceId, envId, filter)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, *collections.Filter) []*collections.Collection); ok { if rf, ok := ret.Get(0).(func(context.Context, string, string, *collections.Filter) []*collections.Collection); ok {
r0 = rf(ctx, spaceId, envId, filter) r0 = rf(ctx, spaceId, envId, filter)
} else { } else {
...@@ -102,7 +112,6 @@ func (_m *Storage) List(ctx context.Context, spaceId string, envId string, filte ...@@ -102,7 +112,6 @@ func (_m *Storage) List(ctx context.Context, spaceId string, envId string, filte
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, string, *collections.Filter) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string, string, *collections.Filter) error); ok {
r1 = rf(ctx, spaceId, envId, filter) r1 = rf(ctx, spaceId, envId, filter)
} else { } else {
...@@ -131,20 +140,23 @@ func (_m *Storage) Update(ctx context.Context, coll *collections.Collection) (in ...@@ -131,20 +140,23 @@ func (_m *Storage) Update(ctx context.Context, coll *collections.Collection) (in
ret := _m.Called(ctx, coll) ret := _m.Called(ctx, coll)
var r0 int var r0 int
var r1 int
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) (int, int, error)); ok {
return rf(ctx, coll)
}
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) int); ok { if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) int); ok {
r0 = rf(ctx, coll) r0 = rf(ctx, coll)
} else { } else {
r0 = ret.Get(0).(int) r0 = ret.Get(0).(int)
} }
var r1 int
if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection) int); ok { if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection) int); ok {
r1 = rf(ctx, coll) r1 = rf(ctx, coll)
} else { } else {
r1 = ret.Get(1).(int) r1 = ret.Get(1).(int)
} }
var r2 error
if rf, ok := ret.Get(2).(func(context.Context, *collections.Collection) error); ok { if rf, ok := ret.Get(2).(func(context.Context, *collections.Collection) error); ok {
r2 = rf(ctx, coll) r2 = rf(ctx, coll)
} else { } else {
...@@ -154,13 +166,12 @@ func (_m *Storage) Update(ctx context.Context, coll *collections.Collection) (in ...@@ -154,13 +166,12 @@ func (_m *Storage) Update(ctx context.Context, coll *collections.Collection) (in
return r0, r1, r2 return r0, r1, r2
} }
type mockConstructorTestingTNewStorage interface { // NewStorage creates a new instance of Storage. 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 NewStorage(t interface {
mock.TestingT mock.TestingT
Cleanup(func()) Cleanup(func())
} }) *Storage {
// NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewStorage(t mockConstructorTestingTNewStorage) *Storage {
mock := &Storage{} mock := &Storage{}
mock.Mock.Test(t) mock.Mock.Test(t)
......
// Code generated by mockery v2.15.0. DO NOT EDIT. // Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks package mocks
...@@ -33,6 +33,10 @@ func (_m *Delivery) Aggregate(ctx context.Context, spaceId string, envId string, ...@@ -33,6 +33,10 @@ func (_m *Delivery) Aggregate(ctx context.Context, spaceId string, envId string,
ret := _m.Called(_ca...) ret := _m.Called(_ca...)
var r0 map[string]interface{} var r0 map[string]interface{}
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.AggregatePublishedOptions) (map[string]interface{}, error)); ok {
return rf(ctx, spaceId, envId, collectionId, filter, options...)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.AggregatePublishedOptions) map[string]interface{}); ok { if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.AggregatePublishedOptions) map[string]interface{}); ok {
r0 = rf(ctx, spaceId, envId, collectionId, filter, options...) r0 = rf(ctx, spaceId, envId, collectionId, filter, options...)
} else { } else {
...@@ -41,7 +45,6 @@ func (_m *Delivery) Aggregate(ctx context.Context, spaceId string, envId string, ...@@ -41,7 +45,6 @@ func (_m *Delivery) Aggregate(ctx context.Context, spaceId string, envId string,
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, string, string, *items.Filter, ...*items.AggregatePublishedOptions) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string, string, string, *items.Filter, ...*items.AggregatePublishedOptions) error); ok {
r1 = rf(ctx, spaceId, envId, collectionId, filter, options...) r1 = rf(ctx, spaceId, envId, collectionId, filter, options...)
} else { } else {
...@@ -63,6 +66,11 @@ func (_m *Delivery) FindItems(ctx context.Context, spaceId string, envId string, ...@@ -63,6 +66,11 @@ func (_m *Delivery) FindItems(ctx context.Context, spaceId string, envId string,
ret := _m.Called(_ca...) ret := _m.Called(_ca...)
var r0 []*items.Item var r0 []*items.Item
var r1 int
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.FindPublishedOptions) ([]*items.Item, int, error)); ok {
return rf(ctx, spaceId, envId, collectionId, filter, options...)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.FindPublishedOptions) []*items.Item); ok { if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.FindPublishedOptions) []*items.Item); ok {
r0 = rf(ctx, spaceId, envId, collectionId, filter, options...) r0 = rf(ctx, spaceId, envId, collectionId, filter, options...)
} else { } else {
...@@ -71,14 +79,12 @@ func (_m *Delivery) FindItems(ctx context.Context, spaceId string, envId string, ...@@ -71,14 +79,12 @@ func (_m *Delivery) FindItems(ctx context.Context, spaceId string, envId string,
} }
} }
var r1 int
if rf, ok := ret.Get(1).(func(context.Context, string, string, string, *items.Filter, ...*items.FindPublishedOptions) int); ok { if rf, ok := ret.Get(1).(func(context.Context, string, string, string, *items.Filter, ...*items.FindPublishedOptions) int); ok {
r1 = rf(ctx, spaceId, envId, collectionId, filter, options...) r1 = rf(ctx, spaceId, envId, collectionId, filter, options...)
} else { } else {
r1 = ret.Get(1).(int) r1 = ret.Get(1).(int)
} }
var r2 error
if rf, ok := ret.Get(2).(func(context.Context, string, string, string, *items.Filter, ...*items.FindPublishedOptions) error); ok { if rf, ok := ret.Get(2).(func(context.Context, string, string, string, *items.Filter, ...*items.FindPublishedOptions) error); ok {
r2 = rf(ctx, spaceId, envId, collectionId, filter, options...) r2 = rf(ctx, spaceId, envId, collectionId, filter, options...)
} else { } else {
...@@ -93,6 +99,10 @@ func (_m *Delivery) GetCollection(ctx context.Context, spaceId string, envId str ...@@ -93,6 +99,10 @@ func (_m *Delivery) GetCollection(ctx context.Context, spaceId string, envId str
ret := _m.Called(ctx, spaceId, envId, collectionId) ret := _m.Called(ctx, spaceId, envId, collectionId)
var r0 *collections.Collection var r0 *collections.Collection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (*collections.Collection, error)); ok {
return rf(ctx, spaceId, envId, collectionId)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, string) *collections.Collection); ok { if rf, ok := ret.Get(0).(func(context.Context, string, string, string) *collections.Collection); ok {
r0 = rf(ctx, spaceId, envId, collectionId) r0 = rf(ctx, spaceId, envId, collectionId)
} else { } else {
...@@ -101,7 +111,6 @@ func (_m *Delivery) GetCollection(ctx context.Context, spaceId string, envId str ...@@ -101,7 +111,6 @@ func (_m *Delivery) GetCollection(ctx context.Context, spaceId string, envId str
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok {
r1 = rf(ctx, spaceId, envId, collectionId) r1 = rf(ctx, spaceId, envId, collectionId)
} else { } else {
...@@ -116,6 +125,10 @@ func (_m *Delivery) GetEnvironment(ctx context.Context, spaceId string, envId st ...@@ -116,6 +125,10 @@ func (_m *Delivery) GetEnvironment(ctx context.Context, spaceId string, envId st
ret := _m.Called(ctx, spaceId, envId) ret := _m.Called(ctx, spaceId, envId)
var r0 *environments.Environment var r0 *environments.Environment
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) (*environments.Environment, error)); ok {
return rf(ctx, spaceId, envId)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string) *environments.Environment); ok { if rf, ok := ret.Get(0).(func(context.Context, string, string) *environments.Environment); ok {
r0 = rf(ctx, spaceId, envId) r0 = rf(ctx, spaceId, envId)
} else { } else {
...@@ -124,7 +137,6 @@ func (_m *Delivery) GetEnvironment(ctx context.Context, spaceId string, envId st ...@@ -124,7 +137,6 @@ func (_m *Delivery) GetEnvironment(ctx context.Context, spaceId string, envId st
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
r1 = rf(ctx, spaceId, envId) r1 = rf(ctx, spaceId, envId)
} else { } else {
...@@ -146,6 +158,10 @@ func (_m *Delivery) GetItem(ctx context.Context, spaceId string, envId string, c ...@@ -146,6 +158,10 @@ func (_m *Delivery) GetItem(ctx context.Context, spaceId string, envId string, c
ret := _m.Called(_ca...) ret := _m.Called(_ca...)
var r0 *items.Item var r0 *items.Item
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...*items.GetPublishedOptions) (*items.Item, error)); ok {
return rf(ctx, spaceId, envId, collectionId, itemId, options...)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...*items.GetPublishedOptions) *items.Item); ok { if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...*items.GetPublishedOptions) *items.Item); ok {
r0 = rf(ctx, spaceId, envId, collectionId, itemId, options...) r0 = rf(ctx, spaceId, envId, collectionId, itemId, options...)
} else { } else {
...@@ -154,7 +170,6 @@ func (_m *Delivery) GetItem(ctx context.Context, spaceId string, envId string, c ...@@ -154,7 +170,6 @@ func (_m *Delivery) GetItem(ctx context.Context, spaceId string, envId string, c
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, ...*items.GetPublishedOptions) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, ...*items.GetPublishedOptions) error); ok {
r1 = rf(ctx, spaceId, envId, collectionId, itemId, options...) r1 = rf(ctx, spaceId, envId, collectionId, itemId, options...)
} else { } else {
...@@ -169,6 +184,10 @@ func (_m *Delivery) ListCollections(ctx context.Context, spaceId string, envId s ...@@ -169,6 +184,10 @@ func (_m *Delivery) ListCollections(ctx context.Context, spaceId string, envId s
ret := _m.Called(ctx, spaceId, envId) ret := _m.Called(ctx, spaceId, envId)
var r0 []*collections.Collection var r0 []*collections.Collection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) ([]*collections.Collection, error)); ok {
return rf(ctx, spaceId, envId)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string) []*collections.Collection); ok { if rf, ok := ret.Get(0).(func(context.Context, string, string) []*collections.Collection); ok {
r0 = rf(ctx, spaceId, envId) r0 = rf(ctx, spaceId, envId)
} else { } else {
...@@ -177,7 +196,6 @@ func (_m *Delivery) ListCollections(ctx context.Context, spaceId string, envId s ...@@ -177,7 +196,6 @@ func (_m *Delivery) ListCollections(ctx context.Context, spaceId string, envId s
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
r1 = rf(ctx, spaceId, envId) r1 = rf(ctx, spaceId, envId)
} else { } else {
...@@ -192,6 +210,10 @@ func (_m *Delivery) ListEnvironments(ctx context.Context, spaceId string) ([]*en ...@@ -192,6 +210,10 @@ func (_m *Delivery) ListEnvironments(ctx context.Context, spaceId string) ([]*en
ret := _m.Called(ctx, spaceId) ret := _m.Called(ctx, spaceId)
var r0 []*environments.Environment var r0 []*environments.Environment
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) ([]*environments.Environment, error)); ok {
return rf(ctx, spaceId)
}
if rf, ok := ret.Get(0).(func(context.Context, string) []*environments.Environment); ok { if rf, ok := ret.Get(0).(func(context.Context, string) []*environments.Environment); ok {
r0 = rf(ctx, spaceId) r0 = rf(ctx, spaceId)
} else { } else {
...@@ -200,7 +222,6 @@ func (_m *Delivery) ListEnvironments(ctx context.Context, spaceId string) ([]*en ...@@ -200,7 +222,6 @@ func (_m *Delivery) ListEnvironments(ctx context.Context, spaceId string) ([]*en
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, spaceId) r1 = rf(ctx, spaceId)
} else { } else {
...@@ -215,6 +236,10 @@ func (_m *Delivery) ListLocales(ctx context.Context, spaceId string) ([]*locales ...@@ -215,6 +236,10 @@ func (_m *Delivery) ListLocales(ctx context.Context, spaceId string) ([]*locales
ret := _m.Called(ctx, spaceId) ret := _m.Called(ctx, spaceId)
var r0 []*locales.Locale var r0 []*locales.Locale
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) ([]*locales.Locale, error)); ok {
return rf(ctx, spaceId)
}
if rf, ok := ret.Get(0).(func(context.Context, string) []*locales.Locale); ok { if rf, ok := ret.Get(0).(func(context.Context, string) []*locales.Locale); ok {
r0 = rf(ctx, spaceId) r0 = rf(ctx, spaceId)
} else { } else {
...@@ -223,7 +248,6 @@ func (_m *Delivery) ListLocales(ctx context.Context, spaceId string) ([]*locales ...@@ -223,7 +248,6 @@ func (_m *Delivery) ListLocales(ctx context.Context, spaceId string) ([]*locales
} }
} }
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, spaceId) r1 = rf(ctx, spaceId)
} else { } else {
...@@ -233,13 +257,12 @@ func (_m *Delivery) ListLocales(ctx context.Context, spaceId string) ([]*locales ...@@ -233,13 +257,12 @@ func (_m *Delivery) ListLocales(ctx context.Context, spaceId string) ([]*locales
return r0, r1 return r0, r1
} }
type mockConstructorTestingTNewDelivery interface { // NewDelivery creates a new instance of Delivery. 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 NewDelivery(t interface {
mock.TestingT mock.TestingT
Cleanup(func()) Cleanup(func())
} }) *Delivery {
// NewDelivery creates a new instance of Delivery. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewDelivery(t mockConstructorTestingTNewDelivery) *Delivery {
mock := &Delivery{} mock := &Delivery{}
mock.Mock.Test(t) mock.Mock.Test(t)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment