Fix tools & specs (internal => pkg)
This commit is contained in:
parent
a54cb00efa
commit
d130e7e641
14
Makefile
14
Makefile
@ -25,11 +25,11 @@ COVER_FLAGS ?= -covermode=$(COVER_MODE) -coverprofile=$(COVER_PROFILE)
|
||||
COVER_PKGS_messaging = ./messaging/...
|
||||
COVER_PKGS_system = ./system/...
|
||||
COVER_PKGS_compose = ./compose/...
|
||||
COVER_PKGS_pkg = ./pkg/...,./internal/...
|
||||
COVER_PKGS_pkg = ./pkg/...
|
||||
COVER_PKGS_all = $(COVER_PKGS_pkg),$(COVER_PKGS_messaging),$(COVER_PKGS_system),$(COVER_PKGS_compose)
|
||||
COVER_PKGS_integration = $(COVER_PKGS_all)
|
||||
|
||||
TEST_SUITE_pkg = ./pkg/... ./internal/...
|
||||
TEST_SUITE_pkg = ./pkg/...
|
||||
TEST_SUITE_services = ./compose/... ./messaging/... ./system/...
|
||||
TEST_SUITE_unit = $(TEST_SUITE_pkg) $(TEST_SUITE_services)
|
||||
TEST_SUITE_integration = ./tests/...
|
||||
@ -129,13 +129,10 @@ test.all:
|
||||
test.unit:
|
||||
$(GOTEST) $(TEST_FLAGS) $(TEST_SUITE_unit)
|
||||
|
||||
# Testing pkg & internal as one
|
||||
# (we have plans to merge internal into pkg)
|
||||
# Testing pkg
|
||||
test.pkg:
|
||||
$(GOTEST) $(TEST_FLAGS) $(TEST_SUITE_pkg)
|
||||
|
||||
# Fallback untill we move internal to pkg (see test.pkg task)
|
||||
test.internal: test.pkg
|
||||
|
||||
# Testing messaging, system, compose
|
||||
test.%:
|
||||
@ -149,7 +146,6 @@ test.cross-dep:
|
||||
@ grep -rE "github.com/cortezaproject/corteza-server/(system|messaging)/" compose || exit 0
|
||||
@ grep -rE "github.com/cortezaproject/corteza-server/(system|compose)/" messaging || exit 0
|
||||
@ grep -rE "github.com/cortezaproject/corteza-server/(system|compose|messaging)/" pkg || exit 0
|
||||
@ grep -rE "github.com/cortezaproject/corteza-server/(system|compose|messaging)/" internal || exit 0
|
||||
|
||||
# Drone tasks
|
||||
# Run drone's integration pipeline
|
||||
@ -165,7 +161,7 @@ critic: $(GOCRITIC)
|
||||
$(GOCRITIC) check-project .
|
||||
|
||||
staticcheck: $(STATICCHECK)
|
||||
$(STATICCHECK) ./pkg/... ./internal/... ./system/... ./messaging/... ./compose/...
|
||||
$(STATICCHECK) ./pkg/... ./system/... ./messaging/... ./compose/...
|
||||
|
||||
qa: vet critic test
|
||||
|
||||
@ -181,7 +177,7 @@ mocks: $(GOMOCK)
|
||||
|
||||
$(MOCKGEN) -package service_mocks -source compose/service/automation_runner.go -destination compose/service/mocks/automation_runner.go
|
||||
|
||||
$(MOCKGEN) -package mail -source internal/mail/mail.go -destination internal/mail/mail_mock_test.go
|
||||
$(MOCKGEN) -package mail -source pkg/mail/mail.go -destination pkg/mail/mail_mock_test.go
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1334,7 +1334,7 @@
|
||||
"struct": [
|
||||
{
|
||||
"imports": [
|
||||
"github.com/cortezaproject/corteza-server/internal/permissions"
|
||||
"github.com/cortezaproject/corteza-server/pkg/permissions"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
"Struct": [
|
||||
{
|
||||
"imports": [
|
||||
"github.com/cortezaproject/corteza-server/internal/permissions"
|
||||
"github.com/cortezaproject/corteza-server/pkg/permissions"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@ -1160,7 +1160,7 @@
|
||||
"struct": [
|
||||
{
|
||||
"imports": [
|
||||
"github.com/cortezaproject/corteza-server/internal/permissions"
|
||||
"github.com/cortezaproject/corteza-server/pkg/permissions"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
"Struct": [
|
||||
{
|
||||
"imports": [
|
||||
"github.com/cortezaproject/corteza-server/internal/permissions"
|
||||
"github.com/cortezaproject/corteza-server/pkg/permissions"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@ -1128,7 +1128,7 @@
|
||||
"struct": [
|
||||
{
|
||||
"imports": [
|
||||
"github.com/cortezaproject/corteza-server/internal/permissions"
|
||||
"github.com/cortezaproject/corteza-server/pkg/permissions"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
"Struct": [
|
||||
{
|
||||
"imports": [
|
||||
"github.com/cortezaproject/corteza-server/internal/permissions"
|
||||
"github.com/cortezaproject/corteza-server/pkg/permissions"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
12
codegen.sh
12
codegen.sh
@ -90,14 +90,14 @@ function types {
|
||||
./build/gen-type-set-test --types Credentials --output system/types/credentials.gen_test.go
|
||||
./build/gen-type-set-test --types Reminder --output system/types/reminder.gen_test.go
|
||||
|
||||
./build/gen-type-set --types Value --output internal/settings/types.gen.go --with-primary-key=false --package settings
|
||||
./build/gen-type-set-test --types Value --output internal/settings/types.gen_test.go --with-primary-key=false --package settings
|
||||
./build/gen-type-set --types Value --output pkg/settings/types.gen.go --with-primary-key=false --package settings
|
||||
./build/gen-type-set-test --types Value --output pkg/settings/types.gen_test.go --with-primary-key=false --package settings
|
||||
|
||||
./build/gen-type-set --types Rule --output internal/permissions/rule.gen.go --with-primary-key=false --package permissions
|
||||
./build/gen-type-set --types Resource --output internal/permissions/resource.gen.go --with-primary-key=false --package permissions
|
||||
./build/gen-type-set --types Rule --output pkg/permissions/rule.gen.go --with-primary-key=false --package permissions
|
||||
./build/gen-type-set --types Resource --output pkg/permissions/resource.gen.go --with-primary-key=false --package permissions
|
||||
|
||||
./build/gen-type-set-test --types Rule --output internal/permissions/rule.gen_test.go --with-primary-key=false --package permissions
|
||||
./build/gen-type-set-test --types Resource --output internal/permissions/resource.gen_test.go --with-primary-key=false --package permissions
|
||||
./build/gen-type-set-test --types Rule --output pkg/permissions/rule.gen_test.go --with-primary-key=false --package permissions
|
||||
./build/gen-type-set-test --types Resource --output pkg/permissions/resource.gen_test.go --with-primary-key=false --package permissions
|
||||
|
||||
./build/gen-type-set --types Script --output pkg/automation/script.gen.go --package automation
|
||||
./build/gen-type-set-test --types Script --output pkg/automation/script.gen_test.go --package automation
|
||||
|
||||
@ -16,11 +16,12 @@ package request
|
||||
*/
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"encoding/json"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/go-chi/chi"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
@ -36,31 +36,26 @@ func (m *MockautomationScriptsFinder) EXPECT() *MockautomationScriptsFinderMockR
|
||||
|
||||
// Watch mocks base method
|
||||
func (m *MockautomationScriptsFinder) Watch(ctx context.Context) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "Watch", ctx)
|
||||
}
|
||||
|
||||
// Watch indicates an expected call of Watch
|
||||
func (mr *MockautomationScriptsFinderMockRecorder) Watch(ctx interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Watch", reflect.TypeOf((*MockautomationScriptsFinder)(nil).Watch), ctx)
|
||||
}
|
||||
|
||||
// WatchScheduled mocks base method
|
||||
func (m *MockautomationScriptsFinder) WatchScheduled(ctx context.Context, runner automation.DeferredAutomationRunner) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "WatchScheduled", ctx, runner)
|
||||
}
|
||||
|
||||
// WatchScheduled indicates an expected call of WatchScheduled
|
||||
func (mr *MockautomationScriptsFinderMockRecorder) WatchScheduled(ctx, runner interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WatchScheduled", reflect.TypeOf((*MockautomationScriptsFinder)(nil).WatchScheduled), ctx, runner)
|
||||
}
|
||||
|
||||
// FindRunnableScripts mocks base method
|
||||
func (m *MockautomationScriptsFinder) FindRunnableScripts(resource, event string, cc ...automation.TriggerConditionChecker) automation.ScriptSet {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{resource, event}
|
||||
for _, a := range cc {
|
||||
varargs = append(varargs, a)
|
||||
@ -72,7 +67,6 @@ func (m *MockautomationScriptsFinder) FindRunnableScripts(resource, event string
|
||||
|
||||
// FindRunnableScripts indicates an expected call of FindRunnableScripts
|
||||
func (mr *MockautomationScriptsFinderMockRecorder) FindRunnableScripts(resource, event interface{}, cc ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]interface{}{resource, event}, cc...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindRunnableScripts", reflect.TypeOf((*MockautomationScriptsFinder)(nil).FindRunnableScripts), varargs...)
|
||||
}
|
||||
@ -102,7 +96,6 @@ func (m *MockautomationRunnerAccessControler) EXPECT() *MockautomationRunnerAcce
|
||||
|
||||
// CanRunAutomationTrigger mocks base method
|
||||
func (m *MockautomationRunnerAccessControler) CanRunAutomationTrigger(ctx context.Context, r *automation.Trigger) bool {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "CanRunAutomationTrigger", ctx, r)
|
||||
ret0, _ := ret[0].(bool)
|
||||
return ret0
|
||||
@ -110,6 +103,5 @@ func (m *MockautomationRunnerAccessControler) CanRunAutomationTrigger(ctx contex
|
||||
|
||||
// CanRunAutomationTrigger indicates an expected call of CanRunAutomationTrigger
|
||||
func (mr *MockautomationRunnerAccessControlerMockRecorder) CanRunAutomationTrigger(ctx, r interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CanRunAutomationTrigger", reflect.TypeOf((*MockautomationRunnerAccessControler)(nil).CanRunAutomationTrigger), ctx, r)
|
||||
}
|
||||
|
||||
@ -16,11 +16,12 @@ package request
|
||||
*/
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"encoding/json"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/go-chi/chi"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: internal/mail/mail.go
|
||||
// Source: pkg/mail/mail.go
|
||||
|
||||
// Package mail is a generated GoMock package.
|
||||
package mail
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
package permissions
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"errors"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
package permissions
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"errors"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
package settings
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"errors"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ APP=${1}
|
||||
DST=${2:-"/bin/corteza-server-${APP}"}
|
||||
|
||||
LDFLAGS=""
|
||||
LDFLAGS="${LDFLAGS} -X github.com/cortezaproject/corteza-server/internal/version.BuildTime=${BUILD_TIME}"
|
||||
LDFLAGS="${LDFLAGS} -X github.com/cortezaproject/corteza-server/internal/version.Version=${GIT_TAG}"
|
||||
LDFLAGS="${LDFLAGS} -X github.com/cortezaproject/corteza-server/pkg/version.BuildTime=${BUILD_TIME}"
|
||||
LDFLAGS="${LDFLAGS} -X github.com/cortezaproject/corteza-server/pkg/version.Version=${GIT_TAG}"
|
||||
|
||||
go build -ldflags "${LDFLAGS}" -o $DST ./cmd/$APP/*.go
|
||||
|
||||
@ -38,7 +38,6 @@ func (m *MockCredentialsRepository) EXPECT() *MockCredentialsRepositoryMockRecor
|
||||
|
||||
// With mocks base method
|
||||
func (m *MockCredentialsRepository) With(ctx context.Context, db *factory.DB) repository.CredentialsRepository {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "With", ctx, db)
|
||||
ret0, _ := ret[0].(repository.CredentialsRepository)
|
||||
return ret0
|
||||
@ -46,13 +45,11 @@ func (m *MockCredentialsRepository) With(ctx context.Context, db *factory.DB) re
|
||||
|
||||
// With indicates an expected call of With
|
||||
func (mr *MockCredentialsRepositoryMockRecorder) With(ctx, db interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "With", reflect.TypeOf((*MockCredentialsRepository)(nil).With), ctx, db)
|
||||
}
|
||||
|
||||
// FindByID mocks base method
|
||||
func (m *MockCredentialsRepository) FindByID(ID uint64) (*types.Credentials, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "FindByID", ID)
|
||||
ret0, _ := ret[0].(*types.Credentials)
|
||||
ret1, _ := ret[1].(error)
|
||||
@ -61,13 +58,11 @@ func (m *MockCredentialsRepository) FindByID(ID uint64) (*types.Credentials, err
|
||||
|
||||
// FindByID indicates an expected call of FindByID
|
||||
func (mr *MockCredentialsRepositoryMockRecorder) FindByID(ID interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindByID", reflect.TypeOf((*MockCredentialsRepository)(nil).FindByID), ID)
|
||||
}
|
||||
|
||||
// FindByCredentials mocks base method
|
||||
func (m *MockCredentialsRepository) FindByCredentials(kind, credentials string) (types.CredentialsSet, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "FindByCredentials", kind, credentials)
|
||||
ret0, _ := ret[0].(types.CredentialsSet)
|
||||
ret1, _ := ret[1].(error)
|
||||
@ -76,13 +71,11 @@ func (m *MockCredentialsRepository) FindByCredentials(kind, credentials string)
|
||||
|
||||
// FindByCredentials indicates an expected call of FindByCredentials
|
||||
func (mr *MockCredentialsRepositoryMockRecorder) FindByCredentials(kind, credentials interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindByCredentials", reflect.TypeOf((*MockCredentialsRepository)(nil).FindByCredentials), kind, credentials)
|
||||
}
|
||||
|
||||
// FindByKind mocks base method
|
||||
func (m *MockCredentialsRepository) FindByKind(ownerID uint64, kind string) (types.CredentialsSet, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "FindByKind", ownerID, kind)
|
||||
ret0, _ := ret[0].(types.CredentialsSet)
|
||||
ret1, _ := ret[1].(error)
|
||||
@ -91,13 +84,11 @@ func (m *MockCredentialsRepository) FindByKind(ownerID uint64, kind string) (typ
|
||||
|
||||
// FindByKind indicates an expected call of FindByKind
|
||||
func (mr *MockCredentialsRepositoryMockRecorder) FindByKind(ownerID, kind interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindByKind", reflect.TypeOf((*MockCredentialsRepository)(nil).FindByKind), ownerID, kind)
|
||||
}
|
||||
|
||||
// FindByOwnerID mocks base method
|
||||
func (m *MockCredentialsRepository) FindByOwnerID(ownerID uint64) (types.CredentialsSet, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "FindByOwnerID", ownerID)
|
||||
ret0, _ := ret[0].(types.CredentialsSet)
|
||||
ret1, _ := ret[1].(error)
|
||||
@ -106,13 +97,11 @@ func (m *MockCredentialsRepository) FindByOwnerID(ownerID uint64) (types.Credent
|
||||
|
||||
// FindByOwnerID indicates an expected call of FindByOwnerID
|
||||
func (mr *MockCredentialsRepositoryMockRecorder) FindByOwnerID(ownerID interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindByOwnerID", reflect.TypeOf((*MockCredentialsRepository)(nil).FindByOwnerID), ownerID)
|
||||
}
|
||||
|
||||
// Find mocks base method
|
||||
func (m *MockCredentialsRepository) Find() (types.CredentialsSet, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Find")
|
||||
ret0, _ := ret[0].(types.CredentialsSet)
|
||||
ret1, _ := ret[1].(error)
|
||||
@ -121,13 +110,11 @@ func (m *MockCredentialsRepository) Find() (types.CredentialsSet, error) {
|
||||
|
||||
// Find indicates an expected call of Find
|
||||
func (mr *MockCredentialsRepositoryMockRecorder) Find() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockCredentialsRepository)(nil).Find))
|
||||
}
|
||||
|
||||
// Create mocks base method
|
||||
func (m *MockCredentialsRepository) Create(c *types.Credentials) (*types.Credentials, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Create", c)
|
||||
ret0, _ := ret[0].(*types.Credentials)
|
||||
ret1, _ := ret[1].(error)
|
||||
@ -136,13 +123,11 @@ func (m *MockCredentialsRepository) Create(c *types.Credentials) (*types.Credent
|
||||
|
||||
// Create indicates an expected call of Create
|
||||
func (mr *MockCredentialsRepositoryMockRecorder) Create(c interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockCredentialsRepository)(nil).Create), c)
|
||||
}
|
||||
|
||||
// Update mocks base method
|
||||
func (m *MockCredentialsRepository) Update(c *types.Credentials) (*types.Credentials, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Update", c)
|
||||
ret0, _ := ret[0].(*types.Credentials)
|
||||
ret1, _ := ret[1].(error)
|
||||
@ -151,13 +136,11 @@ func (m *MockCredentialsRepository) Update(c *types.Credentials) (*types.Credent
|
||||
|
||||
// Update indicates an expected call of Update
|
||||
func (mr *MockCredentialsRepositoryMockRecorder) Update(c interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockCredentialsRepository)(nil).Update), c)
|
||||
}
|
||||
|
||||
// DeleteByID mocks base method
|
||||
func (m *MockCredentialsRepository) DeleteByID(id uint64) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "DeleteByID", id)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
@ -165,13 +148,11 @@ func (m *MockCredentialsRepository) DeleteByID(id uint64) error {
|
||||
|
||||
// DeleteByID indicates an expected call of DeleteByID
|
||||
func (mr *MockCredentialsRepositoryMockRecorder) DeleteByID(id interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteByID", reflect.TypeOf((*MockCredentialsRepository)(nil).DeleteByID), id)
|
||||
}
|
||||
|
||||
// DeleteByKind mocks base method
|
||||
func (m *MockCredentialsRepository) DeleteByKind(ownerID uint64, kind string) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "DeleteByKind", ownerID, kind)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
@ -179,6 +160,5 @@ func (m *MockCredentialsRepository) DeleteByKind(ownerID uint64, kind string) er
|
||||
|
||||
// DeleteByKind indicates an expected call of DeleteByKind
|
||||
func (mr *MockCredentialsRepositoryMockRecorder) DeleteByKind(ownerID, kind interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteByKind", reflect.TypeOf((*MockCredentialsRepository)(nil).DeleteByKind), ownerID, kind)
|
||||
}
|
||||
|
||||
@ -39,7 +39,6 @@ func (m *MockUserRepository) EXPECT() *MockUserRepositoryMockRecorder {
|
||||
|
||||
// With mocks base method
|
||||
func (m *MockUserRepository) With(ctx context.Context, db *factory.DB) repository.UserRepository {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "With", ctx, db)
|
||||
ret0, _ := ret[0].(repository.UserRepository)
|
||||
return ret0
|
||||
@ -47,13 +46,11 @@ func (m *MockUserRepository) With(ctx context.Context, db *factory.DB) repositor
|
||||
|
||||
// With indicates an expected call of With
|
||||
func (mr *MockUserRepositoryMockRecorder) With(ctx, db interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "With", reflect.TypeOf((*MockUserRepository)(nil).With), ctx, db)
|
||||
}
|
||||
|
||||
// FindByEmail mocks base method
|
||||
func (m *MockUserRepository) FindByEmail(email string) (*types.User, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "FindByEmail", email)
|
||||
ret0, _ := ret[0].(*types.User)
|
||||
ret1, _ := ret[1].(error)
|
||||
@ -62,13 +59,11 @@ func (m *MockUserRepository) FindByEmail(email string) (*types.User, error) {
|
||||
|
||||
// FindByEmail indicates an expected call of FindByEmail
|
||||
func (mr *MockUserRepositoryMockRecorder) FindByEmail(email interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindByEmail", reflect.TypeOf((*MockUserRepository)(nil).FindByEmail), email)
|
||||
}
|
||||
|
||||
// FindByUsername mocks base method
|
||||
func (m *MockUserRepository) FindByUsername(username string) (*types.User, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "FindByUsername", username)
|
||||
ret0, _ := ret[0].(*types.User)
|
||||
ret1, _ := ret[1].(error)
|
||||
@ -77,13 +72,11 @@ func (m *MockUserRepository) FindByUsername(username string) (*types.User, error
|
||||
|
||||
// FindByUsername indicates an expected call of FindByUsername
|
||||
func (mr *MockUserRepositoryMockRecorder) FindByUsername(username interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindByUsername", reflect.TypeOf((*MockUserRepository)(nil).FindByUsername), username)
|
||||
}
|
||||
|
||||
// FindByHandle mocks base method
|
||||
func (m *MockUserRepository) FindByHandle(handle string) (*types.User, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "FindByHandle", handle)
|
||||
ret0, _ := ret[0].(*types.User)
|
||||
ret1, _ := ret[1].(error)
|
||||
@ -92,13 +85,11 @@ func (m *MockUserRepository) FindByHandle(handle string) (*types.User, error) {
|
||||
|
||||
// FindByHandle indicates an expected call of FindByHandle
|
||||
func (mr *MockUserRepositoryMockRecorder) FindByHandle(handle interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindByHandle", reflect.TypeOf((*MockUserRepository)(nil).FindByHandle), handle)
|
||||
}
|
||||
|
||||
// FindByID mocks base method
|
||||
func (m *MockUserRepository) FindByID(id uint64) (*types.User, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "FindByID", id)
|
||||
ret0, _ := ret[0].(*types.User)
|
||||
ret1, _ := ret[1].(error)
|
||||
@ -107,13 +98,11 @@ func (m *MockUserRepository) FindByID(id uint64) (*types.User, error) {
|
||||
|
||||
// FindByID indicates an expected call of FindByID
|
||||
func (mr *MockUserRepositoryMockRecorder) FindByID(id interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindByID", reflect.TypeOf((*MockUserRepository)(nil).FindByID), id)
|
||||
}
|
||||
|
||||
// FindByIDs mocks base method
|
||||
func (m *MockUserRepository) FindByIDs(id ...uint64) (types.UserSet, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []interface{}{}
|
||||
for _, a := range id {
|
||||
varargs = append(varargs, a)
|
||||
@ -126,13 +115,11 @@ func (m *MockUserRepository) FindByIDs(id ...uint64) (types.UserSet, error) {
|
||||
|
||||
// FindByIDs indicates an expected call of FindByIDs
|
||||
func (mr *MockUserRepositoryMockRecorder) FindByIDs(id ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindByIDs", reflect.TypeOf((*MockUserRepository)(nil).FindByIDs), id...)
|
||||
}
|
||||
|
||||
// Find mocks base method
|
||||
func (m *MockUserRepository) Find(filter types.UserFilter) (types.UserSet, types.UserFilter, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Find", filter)
|
||||
ret0, _ := ret[0].(types.UserSet)
|
||||
ret1, _ := ret[1].(types.UserFilter)
|
||||
@ -142,13 +129,11 @@ func (m *MockUserRepository) Find(filter types.UserFilter) (types.UserSet, types
|
||||
|
||||
// Find indicates an expected call of Find
|
||||
func (mr *MockUserRepositoryMockRecorder) Find(filter interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockUserRepository)(nil).Find), filter)
|
||||
}
|
||||
|
||||
// Total mocks base method
|
||||
func (m *MockUserRepository) Total() uint {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Total")
|
||||
ret0, _ := ret[0].(uint)
|
||||
return ret0
|
||||
@ -156,13 +141,11 @@ func (m *MockUserRepository) Total() uint {
|
||||
|
||||
// Total indicates an expected call of Total
|
||||
func (mr *MockUserRepositoryMockRecorder) Total() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Total", reflect.TypeOf((*MockUserRepository)(nil).Total))
|
||||
}
|
||||
|
||||
// Create mocks base method
|
||||
func (m *MockUserRepository) Create(mod *types.User) (*types.User, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Create", mod)
|
||||
ret0, _ := ret[0].(*types.User)
|
||||
ret1, _ := ret[1].(error)
|
||||
@ -171,13 +154,11 @@ func (m *MockUserRepository) Create(mod *types.User) (*types.User, error) {
|
||||
|
||||
// Create indicates an expected call of Create
|
||||
func (mr *MockUserRepositoryMockRecorder) Create(mod interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockUserRepository)(nil).Create), mod)
|
||||
}
|
||||
|
||||
// Update mocks base method
|
||||
func (m *MockUserRepository) Update(mod *types.User) (*types.User, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Update", mod)
|
||||
ret0, _ := ret[0].(*types.User)
|
||||
ret1, _ := ret[1].(error)
|
||||
@ -186,13 +167,11 @@ func (m *MockUserRepository) Update(mod *types.User) (*types.User, error) {
|
||||
|
||||
// Update indicates an expected call of Update
|
||||
func (mr *MockUserRepositoryMockRecorder) Update(mod interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockUserRepository)(nil).Update), mod)
|
||||
}
|
||||
|
||||
// BindAvatar mocks base method
|
||||
func (m *MockUserRepository) BindAvatar(user *types.User, avatar io.Reader) (*types.User, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "BindAvatar", user, avatar)
|
||||
ret0, _ := ret[0].(*types.User)
|
||||
ret1, _ := ret[1].(error)
|
||||
@ -201,13 +180,11 @@ func (m *MockUserRepository) BindAvatar(user *types.User, avatar io.Reader) (*ty
|
||||
|
||||
// BindAvatar indicates an expected call of BindAvatar
|
||||
func (mr *MockUserRepositoryMockRecorder) BindAvatar(user, avatar interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BindAvatar", reflect.TypeOf((*MockUserRepository)(nil).BindAvatar), user, avatar)
|
||||
}
|
||||
|
||||
// SuspendByID mocks base method
|
||||
func (m *MockUserRepository) SuspendByID(id uint64) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "SuspendByID", id)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
@ -215,13 +192,11 @@ func (m *MockUserRepository) SuspendByID(id uint64) error {
|
||||
|
||||
// SuspendByID indicates an expected call of SuspendByID
|
||||
func (mr *MockUserRepositoryMockRecorder) SuspendByID(id interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SuspendByID", reflect.TypeOf((*MockUserRepository)(nil).SuspendByID), id)
|
||||
}
|
||||
|
||||
// UnsuspendByID mocks base method
|
||||
func (m *MockUserRepository) UnsuspendByID(id uint64) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "UnsuspendByID", id)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
@ -229,13 +204,11 @@ func (m *MockUserRepository) UnsuspendByID(id uint64) error {
|
||||
|
||||
// UnsuspendByID indicates an expected call of UnsuspendByID
|
||||
func (mr *MockUserRepositoryMockRecorder) UnsuspendByID(id interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnsuspendByID", reflect.TypeOf((*MockUserRepository)(nil).UnsuspendByID), id)
|
||||
}
|
||||
|
||||
// DeleteByID mocks base method
|
||||
func (m *MockUserRepository) DeleteByID(id uint64) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "DeleteByID", id)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
@ -243,6 +216,5 @@ func (m *MockUserRepository) DeleteByID(id uint64) error {
|
||||
|
||||
// DeleteByID indicates an expected call of DeleteByID
|
||||
func (mr *MockUserRepositoryMockRecorder) DeleteByID(id interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteByID", reflect.TypeOf((*MockUserRepository)(nil).DeleteByID), id)
|
||||
}
|
||||
|
||||
@ -16,11 +16,12 @@ package request
|
||||
*/
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"encoding/json"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/go-chi/chi"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
@ -116,7 +116,7 @@ func (svc auth) log(ctx context.Context, fields ...zapcore.Field) *zap.Logger {
|
||||
|
||||
// External func performs login/signup procedures
|
||||
//
|
||||
// We fully trust external auth sources (see system/internal/auth/external) to provide a valid & validates
|
||||
// We fully trust external auth sources (see system/auth/external) to provide a valid & validates
|
||||
// profile (goth.User) that we use for user discovery and/or creation
|
||||
//
|
||||
// Flow
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user