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

Merge branch 'feature/2849-taskfile-perxis-go' into 'master'

Обновление Taskfile

See merge request perxis/perxis-go!392
parents 7ac2d626 7ecb191b
Branches
Tags
No related merge requests found
Showing
with 1141 additions and 61 deletions
.idea
.task
dist/
release/
\ No newline at end of file
# Changelog
All notable changes to this project will be documented in this file.
## [0.30.0] - 2024-10-22
### 🚀 Features
......
......@@ -2,67 +2,212 @@ version: '3'
vars:
PROTODIR: perxis-proto/proto
PBDIR: pb
PBDIR: proto
DATE:
sh: date -Idate
tasks:
tools:brew:
desc: Установка инструментов через brew
cmds:
- brew tap caarlos0/tap
- brew install caarlos0/tap/svu
- brew install git-cliff
- brew install goreleaser
- brew install mockery
- brew install protoc-gen-go
- brew install protoc-gen-go-grpc
# Тесты
test:unit:
aliases: [tu]
desc: Запускает только юнит-тесты
cmds:
- go test ./...
test:unit:short:
aliases: [tus]
desc: Запускает только быстрые юнит-тесты
cmds:
- go test -short ./...
test:integration:
desc: Запускает только интеграционные тесты
cmds:
- go test -tags integration ./...
test:integration:short:
desc: Запускает только быстрые интеграционные тесты
cmds:
- go test -tags integration -short ./...
test:all:
desc: Запускает все тесты (юнит и интеграционные)
cmds:
- go test -tags all ./...
test:all:short:
desc: Запускает все быстрые тесты (юнит и интеграционные)
cmds:
- go test -tags all -short ./...
# Release
release:changelog:
aliases: [cl]
desc: "Подготовка CHANGELOG.md"
vars:
CURRENT_VERSION:
sh: svu current
RELEASE_VERSION:
sh: svu next
cmds:
- mkdir -p release
- git cliff {{ .CURRENT_VERSION }}.. --tag {{ .RELEASE_VERSION }} > release/CHANGELOG.md
tasks:
changelog:
release:prepare:
desc: "Подготовка к релизу"
cmds:
- git-cliff > CHANGELOG.md --tag {{ .RELEASE_VERSION }}
- task: release:changelog
- go mod tidy
# - sed -i '' 's/ServerVersion.*=.*/ServerVersion = "{{ .RELEASE_VERSION }}"/' internal/version/version.go
# - sed -i '' 's/APIVersion.*=.*/APIVersion = "{{ .PERXIS_GO_VERSION }}"/' internal/version/version.go
# release
# - Сделать changelog
# - Закоммитить все изменения
# - Пометить тэгом версию
# пререлиз - `git tag "$(svu pr --pre-release alpha.1 --build 9)"`
# пререлиз - `git tag "$(svu next)"`
# - Запушить код и тэги на сервер (иначе будет непонятная ошибка goreleaser Not found)
release:
release:finalize:
desc: "Формирует все необходимые файлы к релизу"
vars:
CURRENT_VERSION:
sh: svu current
RELEASE_VERSION:
sh: svu next
MAJOR_VERSION:
sh: VERSION="{{ .RELEASE_VERSION }}"; echo "${VERSION%.*}"
cmds:
- cp CHANGELOG.md CHANGELOG.md.bak
- sed -i '' '/^# Changelog/d' CHANGELOG.md
- cat release/CHANGELOG.md CHANGELOG.md > CHANGELOG.md.tmp
- mv CHANGELOG.md.tmp CHANGELOG.md
release:version:
aliases: [v, ver]
desc: Текущие версии релизов
silent: true
vars:
CURRENT_VERSION:
sh: svu current
RELEASE_VERSION:
sh: svu next
cmds:
- echo 'Current version {{.CURRENT_VERSION}}'
- echo 'Release version {{.RELEASE_VERSION}}'
release:build:
desc: Сборка Release
summary: |
1. Сделать подготовку:
- task release:prepare
2. Закоммитить все изменения
3. Пометить тэгом версию
- пререлиз - `git tag "$(svu pr --pre-release alpha.1 --build 9)"`
- релиз - `git tag "$(svu next)"`
4. Запушить код и тэги на сервер (иначе будет непонятная ошибка goreleaser Not found)
vars:
CURRENT_VERSION:
sh: svu current
RELEASE_VERSION:
sh: svu next
cmds:
- mkdir -p release
- git-cliff {{ .CURRENT_VERSION }}.. --tag {{ .RELEASE_VERSION }} > release/CHANGELOG.md
- goreleaser release --clean --release-notes=release/CHANGELOG.md
mocks:
deps:
- mocks.proto
mocks.proto:
gen:proto:
desc: "Компилиция .proto файлов в каталоге {{ .PROTODIR }} в код Go"
sources:
- proto/**/*.proto
generates:
- proto/mocks/*.go
- "{{ .PROTODIR }}/**/*.proto"
- exclude: "{{ .PROTODIR }}/status/status.proto"
cmds:
- mockery --all --dir proto --output proto/mocks
- for: sources
task: gen:proto:file
vars:
FILE: "{{ .ITEM }}"
silent: true
gen:proto:file:
desc: "Преобразует переданный .proto файл в код на языке Go для работы с сообщениями protobuf и сервисами gRPC."
cmds:
- protoc -I={{ .PROTODIR }} --experimental_allow_proto3_optional --go_out={{ .PBDIR }} --go-grpc_out={{ .PBDIR }} --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative {{ .FILE }}
gen:middleware:
desc: "Генерирует middleware для всех пакетов"
summary: |
Команда перегенерирует middleware для всех пакетов.
Для конфигурации доступны следующие переменные:
* DIR - путь до пакета, содержащего уже сгенерированные middleware
* MIDDLEWARE_NAME - имя middleware, которое нужно перегенерировать, без указания расширения
Примеры использования:
Перегенерация всех middleware только для пакета items:
task regen:middleware DIR=pkg/items
proto:
Перегенерация всех recovery middleware для всех пакетов:
task regen:middleware MIDDLEWARE_NAME=recovering_middleware
Перегенерация middleware телеметрии для пакета collections:
task gen:middleware DIR=pkg/collections MIDDLEWARE_NAME=recovering_middleware
vars:
DIR: '{{ default "**" .DIR }}'
MIDDLEWARE_NAME: '{{ default "*" .MIDDLEWARE_NAME }}'
sources:
- '{{ .PROTODIR }}/**/*.proto'
# generates:
# - '{{ .PBDIR }}/*.go'
ignore_error: true # Игнорировать ошибки, из-за status/status.proto
# silent: true
- "{{ .DIR }}/middleware/{{ .MIDDLEWARE_NAME }}.go"
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: go generate {{ .ITEM }}
gen:mocks:
desc: "Генерирует моки"
cmds:
- task: gen:mocks:proto
- task: gen:mocks:services
# 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
gen:mocks:proto:
desc: "Команда генерирует моки для всех proto-файлов"
sources:
- "{{.PBDIR}}/**/*.pb.go"
cmds:
- mockery --all --dir {{.PBDIR}} --output {{.PBDIR}}/mocks
proto_file:
gen:mocks:services:
desc: "Генерирует моки для всех интерфейсов в директориях, где находится файл service.go."
sources:
- '{{ .FILE }}'
- "**/service.go"
- exclude: "**/mocks/**"
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
- for: sources
task: gen:mock:dir
vars:
DIR: "{{ dir .ITEM }}"
gen:mock:dir:
internal: true
desc: "Вспомогательная команда для генерации моков"
cmds:
- mockery --log-level="error" --all --exported --dir "{{ .DIR }}" --output="{{ .DIR }}/mocks"
gen:microgen:all:
desc: "Генерирует go-kit для всех файлов service.go. Поддерживается для версии microgen < 1.0.0"
sources:
- "**/service.go"
deps:
- for: sources
task: gen:microgen:file
vars:
FILE: "{{ .ITEM }}"
gen:microgen:file:
desc: "Вспомогательная команда для генерации go-kit для переданного файла. Выходные файлы сохраняются в директории с входным файлом."
cmds:
- microgen -file {{ .FILE }} -out {{ dir .FILE }}
......@@ -12,7 +12,6 @@ breaking_always_bump_major = true
# changelog header
header = """
# Changelog\n
All notable changes to this project will be documented in this file.\n
"""
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
......@@ -25,16 +24,16 @@ body = """
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits %}
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
- {% if commit.scope %}**{{ commit.scope }}**: {% endif %}\
{% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message | upper_first }} \
{% if commit.links %}\
({% for link in commit.links %}\
{% for link in commit.links %}\
[{{ link.text }}]({{ link.href }}) \
{% if not loop.last %}, {% endif %}\
{% endfor %})\
{% endfor %}\
{% endif %}\
-([{{ commit.id | truncate(length=7, end="") }}]($REPO/-/commit/{{ commit.id }}))\
([{{ commit.id | truncate(length=7, end="") }}]($REPO/-/commit/{{ commit.id }}))\
{% endfor %}
{% endfor %}\n
"""
......@@ -69,20 +68,20 @@ commit_preprocessors = [
]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor", skip = true },
{ message = "^feat", group = "<!-- 0 -->🚀 Новые возможности" },
{ message = "^fix", group = "<!-- 1 -->🐛 Исправлены ошибки" },
{ message = "^doc", group = "<!-- 3 -->📚 Документация" },
{ message = "^perf", group = "<!-- 4 -->⚡ Производительность" },
{ message = "^refactor", group = "<!-- 2 -->🚜 Рефакторинг", skip = true },
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
{ message = "^test", group = "<!-- 6 -->🧪 Тесты" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore\\(deps.*\\)", skip = true },
{ message = "^chore\\(pr\\)", skip = true },
{ message = "^chore\\(pull\\)", skip = true },
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Прочие задачи" },
{ body = ".*security", group = "<!-- 8 -->🛡️ Безопастность" },
{ message = "^revert", group = "<!-- 9 -->◀️ Отменены изменения" },
{ message = "^irefac", skip = true },
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
......@@ -102,6 +101,12 @@ sort_commits = "oldest"
# limit the number of commits included in the changelog.
# limit_commits = 42
link_parsers = [
{ pattern = "#(\\d+)", href = "https://git.perx.ru/perxis/perxis/-/issues/$1"},
{ pattern = "#(PRXS-(\\d+))", href = "https://tracker.yandex.ru/$1"},
{ pattern = "RFC(\\d+)", text = "ietf-rfc$1", href = "https://datatracker.ietf.org/doc/html/rfc$1"},
]
[remote.gitlab]
owner = "perxis"
repo = "perxis-go"
api_url = "https://git.perx.ru/api/v4/"
\ No newline at end of file
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import (
id "git.perx.ru/perxis/perxis-go/id"
mock "github.com/stretchr/testify/mock"
)
// Descriptor is an autogenerated mock type for the Descriptor type
type Descriptor struct {
mock.Mock
}
// FromMap provides a mock function with given fields: _a0
func (_m *Descriptor) FromMap(_a0 map[string]interface{}) error {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for FromMap")
}
var r0 error
if rf, ok := ret.Get(0).(func(map[string]interface{}) error); ok {
r0 = rf(_a0)
} else {
r0 = ret.Error(0)
}
return r0
}
// FromParts provides a mock function with given fields: _a0
func (_m *Descriptor) FromParts(_a0 []string) error {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for FromParts")
}
var r0 error
if rf, ok := ret.Get(0).(func([]string) error); ok {
r0 = rf(_a0)
} else {
r0 = ret.Error(0)
}
return r0
}
// Map provides a mock function with no fields
func (_m *Descriptor) Map() map[string]interface{} {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Map")
}
var r0 map[string]interface{}
if rf, ok := ret.Get(0).(func() map[string]interface{}); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string]interface{})
}
}
return r0
}
// New provides a mock function with no fields
func (_m *Descriptor) New() id.Descriptor {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for New")
}
var r0 id.Descriptor
if rf, ok := ret.Get(0).(func() id.Descriptor); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(id.Descriptor)
}
}
return r0
}
// String provides a mock function with no fields
func (_m *Descriptor) String() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for String")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// Type provides a mock function with no fields
func (_m *Descriptor) Type() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Type")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// Validate provides a mock function with no fields
func (_m *Descriptor) Validate() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Validate")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// NewDescriptor creates a new instance of Descriptor. 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 NewDescriptor(t interface {
mock.TestingT
Cleanup(func())
}) *Descriptor {
mock := &Descriptor{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import (
id "git.perx.ru/perxis/perxis-go/id"
mock "github.com/stretchr/testify/mock"
)
// ObjectHandler is an autogenerated mock type for the ObjectHandler type
type ObjectHandler struct {
mock.Mock
}
// Execute provides a mock function with given fields: _a0
func (_m *ObjectHandler) Execute(_a0 interface{}) *id.ObjectId {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for Execute")
}
var r0 *id.ObjectId
if rf, ok := ret.Get(0).(func(interface{}) *id.ObjectId); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*id.ObjectId)
}
}
return r0
}
// NewObjectHandler creates a new instance of ObjectHandler. 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 NewObjectHandler(t interface {
mock.TestingT
Cleanup(func())
}) *ObjectHandler {
mock := &ObjectHandler{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import (
id "git.perx.ru/perxis/perxis-go/id"
mock "github.com/stretchr/testify/mock"
)
// ObjectIdentifier is an autogenerated mock type for the ObjectIdentifier type
type ObjectIdentifier struct {
mock.Mock
}
// ObjectId provides a mock function with no fields
func (_m *ObjectIdentifier) ObjectId() *id.ObjectId {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for ObjectId")
}
var r0 *id.ObjectId
if rf, ok := ret.Get(0).(func() *id.ObjectId); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*id.ObjectId)
}
}
return r0
}
// NewObjectIdentifier creates a new instance of ObjectIdentifier. 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 NewObjectIdentifier(t interface {
mock.TestingT
Cleanup(func())
}) *ObjectIdentifier {
mock := &ObjectIdentifier{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import (
image "image"
io "io"
mock "github.com/stretchr/testify/mock"
)
// EncodeFunc is an autogenerated mock type for the EncodeFunc type
type EncodeFunc struct {
mock.Mock
}
// Execute provides a mock function with given fields: w, img
func (_m *EncodeFunc) Execute(w io.Writer, img image.Image) error {
ret := _m.Called(w, img)
if len(ret) == 0 {
panic("no return value specified for Execute")
}
var r0 error
if rf, ok := ret.Get(0).(func(io.Writer, image.Image) error); ok {
r0 = rf(w, img)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewEncodeFunc creates a new instance of EncodeFunc. 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 NewEncodeFunc(t interface {
mock.TestingT
Cleanup(func())
}) *EncodeFunc {
mock := &EncodeFunc{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import mock "github.com/stretchr/testify/mock"
// SpaceGetter is an autogenerated mock type for the spaceGetter type
type SpaceGetter struct {
mock.Mock
}
// GetSpaceID provides a mock function with no fields
func (_m *SpaceGetter) GetSpaceID() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetSpaceID")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// NewSpaceGetter creates a new instance of SpaceGetter. 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 NewSpaceGetter(t interface {
mock.TestingT
Cleanup(func())
}) *SpaceGetter {
mock := &SpaceGetter{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import (
logs "git.perx.ru/perxis/perxis-go/logs"
mock "github.com/stretchr/testify/mock"
)
// Middleware is an autogenerated mock type for the Middleware type
type Middleware struct {
mock.Mock
}
// Execute provides a mock function with given fields: _a0
func (_m *Middleware) Execute(_a0 logs.Service) logs.Service {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for Execute")
}
var r0 logs.Service
if rf, ok := ret.Get(0).(func(logs.Service) logs.Service); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(logs.Service)
}
}
return r0
}
// 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
Cleanup(func())
}) *Middleware {
mock := &Middleware{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import (
logs "git.perx.ru/perxis/perxis-go/logs"
mock "github.com/stretchr/testify/mock"
)
// WriteSyncer is an autogenerated mock type for the WriteSyncer type
type WriteSyncer struct {
mock.Mock
}
// Sync provides a mock function with no fields
func (_m *WriteSyncer) Sync() error {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Sync")
}
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// Write provides a mock function with given fields: entry
func (_m *WriteSyncer) Write(entry *logs.Entry) error {
ret := _m.Called(entry)
if len(ret) == 0 {
panic("no return value specified for Write")
}
var r0 error
if rf, ok := ret.Get(0).(func(*logs.Entry) error); ok {
r0 = rf(entry)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewWriteSyncer creates a new instance of WriteSyncer. 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 NewWriteSyncer(t interface {
mock.TestingT
Cleanup(func())
}) *WriteSyncer {
mock := &WriteSyncer{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import mock "github.com/stretchr/testify/mock"
// SpaceGetter is an autogenerated mock type for the spaceGetter type
type SpaceGetter struct {
mock.Mock
}
// GetSpaceID provides a mock function with no fields
func (_m *SpaceGetter) GetSpaceID() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetSpaceID")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// NewSpaceGetter creates a new instance of SpaceGetter. 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 NewSpaceGetter(t interface {
mock.TestingT
Cleanup(func())
}) *SpaceGetter {
mock := &SpaceGetter{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import mock "github.com/stretchr/testify/mock"
// SpaceGetter is an autogenerated mock type for the spaceGetter type
type SpaceGetter struct {
mock.Mock
}
// GetSpaceID provides a mock function with no fields
func (_m *SpaceGetter) GetSpaceID() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetSpaceID")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// NewSpaceGetter creates a new instance of SpaceGetter. 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 NewSpaceGetter(t interface {
mock.TestingT
Cleanup(func())
}) *SpaceGetter {
mock := &SpaceGetter{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import mock "github.com/stretchr/testify/mock"
// SpaceGetter is an autogenerated mock type for the spaceGetter type
type SpaceGetter struct {
mock.Mock
}
// GetSpaceID provides a mock function with no fields
func (_m *SpaceGetter) GetSpaceID() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetSpaceID")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// NewSpaceGetter creates a new instance of SpaceGetter. 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 NewSpaceGetter(t interface {
mock.TestingT
Cleanup(func())
}) *SpaceGetter {
mock := &SpaceGetter{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import mock "github.com/stretchr/testify/mock"
// SpaceGetter is an autogenerated mock type for the spaceGetter type
type SpaceGetter struct {
mock.Mock
}
// GetSpaceID provides a mock function with no fields
func (_m *SpaceGetter) GetSpaceID() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetSpaceID")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// NewSpaceGetter creates a new instance of SpaceGetter. 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 NewSpaceGetter(t interface {
mock.TestingT
Cleanup(func())
}) *SpaceGetter {
mock := &SpaceGetter{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import mock "github.com/stretchr/testify/mock"
// SpaceGetter is an autogenerated mock type for the spaceGetter type
type SpaceGetter struct {
mock.Mock
}
// GetSpaceID provides a mock function with no fields
func (_m *SpaceGetter) GetSpaceID() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetSpaceID")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// NewSpaceGetter creates a new instance of SpaceGetter. 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 NewSpaceGetter(t interface {
mock.TestingT
Cleanup(func())
}) *SpaceGetter {
mock := &SpaceGetter{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import mock "github.com/stretchr/testify/mock"
// SpaceGetter is an autogenerated mock type for the spaceGetter type
type SpaceGetter struct {
mock.Mock
}
// GetSpaceID provides a mock function with no fields
func (_m *SpaceGetter) GetSpaceID() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetSpaceID")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// NewSpaceGetter creates a new instance of SpaceGetter. 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 NewSpaceGetter(t interface {
mock.TestingT
Cleanup(func())
}) *SpaceGetter {
mock := &SpaceGetter{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import mock "github.com/stretchr/testify/mock"
// SpaceGetter is an autogenerated mock type for the spaceGetter type
type SpaceGetter struct {
mock.Mock
}
// GetSpaceID provides a mock function with no fields
func (_m *SpaceGetter) GetSpaceID() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetSpaceID")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// NewSpaceGetter creates a new instance of SpaceGetter. 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 NewSpaceGetter(t interface {
mock.TestingT
Cleanup(func())
}) *SpaceGetter {
mock := &SpaceGetter{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import (
context "context"
operation "git.perx.ru/perxis/perxis-go/pkg/operation"
mock "github.com/stretchr/testify/mock"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
)
// Service is an autogenerated mock type for the Service type
type Service struct {
mock.Mock
}
// Cancel provides a mock function with given fields: ctx, id
func (_m *Service) Cancel(ctx context.Context, id string) (*operation.Operation, error) {
ret := _m.Called(ctx, id)
if len(ret) == 0 {
panic("no return value specified for Cancel")
}
var r0 *operation.Operation
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (*operation.Operation, error)); ok {
return rf(ctx, id)
}
if rf, ok := ret.Get(0).(func(context.Context, string) *operation.Operation); ok {
r0 = rf(ctx, id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*operation.Operation)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Cleanup provides a mock function with no fields
func (_m *Service) Cleanup() {
_m.Called()
}
// Create provides a mock function with given fields: ctx, desc, fn
func (_m *Service) Create(ctx context.Context, desc string, fn func(context.Context) (protoreflect.ProtoMessage, error)) (*operation.Operation, error) {
ret := _m.Called(ctx, desc, fn)
if len(ret) == 0 {
panic("no return value specified for Create")
}
var r0 *operation.Operation
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, func(context.Context) (protoreflect.ProtoMessage, error)) (*operation.Operation, error)); ok {
return rf(ctx, desc, fn)
}
if rf, ok := ret.Get(0).(func(context.Context, string, func(context.Context) (protoreflect.ProtoMessage, error)) *operation.Operation); ok {
r0 = rf(ctx, desc, fn)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*operation.Operation)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, func(context.Context) (protoreflect.ProtoMessage, error)) error); ok {
r1 = rf(ctx, desc, fn)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Get provides a mock function with given fields: ctx, id
func (_m *Service) Get(ctx context.Context, id string) (*operation.Operation, error) {
ret := _m.Called(ctx, id)
if len(ret) == 0 {
panic("no return value specified for Get")
}
var r0 *operation.Operation
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (*operation.Operation, error)); ok {
return rf(ctx, id)
}
if rf, ok := ret.Get(0).(func(context.Context, string) *operation.Operation); ok {
r0 = rf(ctx, id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*operation.Operation)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Set provides a mock function with given fields: ctx, op
func (_m *Service) Set(ctx context.Context, op *operation.Operation) error {
ret := _m.Called(ctx, op)
if len(ret) == 0 {
panic("no return value specified for Set")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *operation.Operation) error); ok {
r0 = rf(ctx, op)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewService creates a new instance of Service. 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 NewService(t interface {
mock.TestingT
Cleanup(func())
}) *Service {
mock := &Service{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Code generated by mockery v2.50.0. DO NOT EDIT.
package mocks
import mock "github.com/stretchr/testify/mock"
// SpaceGetter is an autogenerated mock type for the spaceGetter type
type SpaceGetter struct {
mock.Mock
}
// GetSpaceID provides a mock function with no fields
func (_m *SpaceGetter) GetSpaceID() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetSpaceID")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// NewSpaceGetter creates a new instance of SpaceGetter. 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 NewSpaceGetter(t interface {
mock.TestingT
Cleanup(func())
}) *SpaceGetter {
mock := &SpaceGetter{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment