mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-30 11:02:16 +00:00
# Which Problems Are Solved This PR implements the endpoints listed in https://github.com/zitadel/zitadel/issues/10443 . # How the Problems Are Solved The implementation follows the same pattern as the Organization one. There are no peculiarities to this PR. The `Update`, `Delete` are implementing the `Commander` interface, while `Get` and `List` instance(s) endpoints are implementing the `Querier` interace. # Additional Context - Closes #10443 - Depends on #10445
53 lines
1.7 KiB
Go
53 lines
1.7 KiB
Go
package domainmock
|
|
|
|
import (
|
|
context "context"
|
|
|
|
gomock "go.uber.org/mock/gomock"
|
|
|
|
domain "github.com/zitadel/zitadel/backend/v3/domain"
|
|
database "github.com/zitadel/zitadel/backend/v3/storage/database"
|
|
"github.com/zitadel/zitadel/backend/v3/storage/database/repository"
|
|
)
|
|
|
|
type InstancesDomainRepo struct {
|
|
domain.InstanceDomainRepository
|
|
mock *MockInstanceDomainRepository
|
|
}
|
|
|
|
func NewInstancesDomainRepo(ctrl *gomock.Controller) *InstancesDomainRepo {
|
|
return &InstancesDomainRepo{
|
|
mock: NewMockInstanceDomainRepository(ctrl),
|
|
InstanceDomainRepository: repository.InstanceDomainRepository(),
|
|
}
|
|
}
|
|
|
|
func (r *InstancesDomainRepo) EXPECT() *MockInstanceDomainRepositoryMockRecorder {
|
|
return r.mock.EXPECT()
|
|
}
|
|
|
|
func (r *InstancesDomainRepo) Get(ctx context.Context, client database.QueryExecutor, opts ...database.QueryOption) (*domain.InstanceDomain, error) {
|
|
return r.mock.Get(ctx, client, opts...)
|
|
|
|
}
|
|
|
|
func (r *InstancesDomainRepo) List(ctx context.Context, client database.QueryExecutor, opts ...database.QueryOption) ([]*domain.InstanceDomain, error) {
|
|
return r.mock.List(ctx, client, opts...)
|
|
|
|
}
|
|
|
|
func (r *InstancesDomainRepo) Add(ctx context.Context, client database.QueryExecutor, domain *domain.AddInstanceDomain) error {
|
|
return r.mock.Add(ctx, client, domain)
|
|
|
|
}
|
|
|
|
func (r *InstancesDomainRepo) Update(ctx context.Context, client database.QueryExecutor, condition database.Condition, changes ...database.Change) (int64, error) {
|
|
return r.mock.Update(ctx, client, condition, changes...)
|
|
|
|
}
|
|
|
|
func (r *InstancesDomainRepo) Remove(ctx context.Context, client database.QueryExecutor, condition database.Condition) (int64, error) {
|
|
return r.mock.Remove(ctx, client, condition)
|
|
|
|
}
|