Documentation ¶
Index ¶
- type AllLangs
- type AllLangsHandler
- type AllRolesHandler
- type AllTags
- type AllTagsHandler
- type AllUsersHandler
- type LangView
- type LangViewRepository
- type LastTranslationViews
- type MockLangViewRepository
- type MockTagViewRepository
- type MockTranslationViewRepository
- func (_m *MockTranslationViewRepository) GetLastViewsBySourcePart(authorID string, langID string, sourcePart string, pageSize int, page int) (LastTranslationViews, error)
- func (_m *MockTranslationViewRepository) GetLastViewsByTags(authorID string, langID string, pageSize int, page int, tagIds []string) (LastTranslationViews, error)
- func (_m *MockTranslationViewRepository) GetLastViewsByTargetPart(authorID string, langID string, targetPart string, pageSize int, page int) (LastTranslationViews, error)
- func (_m *MockTranslationViewRepository) GetRandomViews(authorID string, langID string, tagIds []string, limit int) (RandomViews, error)
- func (_m *MockTranslationViewRepository) GetView(id string, authorID string) (TranslationView, error)
- type MockUserViewRepository
- type RandomTranslations
- type RandomTranslationsHandler
- type RandomViews
- type RoleConverter
- type RoleView
- type SearchTranslations
- type SearchTranslationsHandler
- type SingleLang
- type SingleLangHandler
- type SingleTag
- type SingleTagHandler
- type SingleTranslation
- type SingleTranslationHandler
- type SingleUser
- type SingleUserHandler
- type TagView
- type TagViewRepository
- type TranslationView
- type TranslationViewRepository
- type UserView
- type UserViewRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllLangsHandler ¶
type AllLangsHandler struct {
// contains filtered or unexported fields
}
func NewAllLangsHandler ¶
func NewAllLangsHandler(langRepo LangViewRepository, validate *validator.Validate) AllLangsHandler
type AllRolesHandler ¶
type AllRolesHandler struct {
// contains filtered or unexported fields
}
func NewAllRolesHandler ¶
func NewAllRolesHandler() AllRolesHandler
func (AllRolesHandler) Handle ¶
func (h AllRolesHandler) Handle() ([]RoleView, error)
type AllTags ¶
type AllTags struct {
AuthorID string `validate:"required"`
}
AllTags get all tags for author query
type AllTagsHandler ¶
type AllTagsHandler struct {
// contains filtered or unexported fields
}
AllTagsHandler get all tags for author query
func NewAllTagsHandler ¶
func NewAllTagsHandler(tagRepository TagViewRepository, validate *validator.Validate) AllTagsHandler
type AllUsersHandler ¶
type AllUsersHandler struct {
// contains filtered or unexported fields
}
AllUsersHandler get all users
func NewAllUsersHandler ¶
func NewAllUsersHandler(userRepo UserViewRepository) AllUsersHandler
func (AllUsersHandler) Handle ¶
func (h AllUsersHandler) Handle() ([]UserView, error)
Handle performs query to receive all tags for author
type LangViewRepository ¶
type LastTranslationViews ¶
type LastTranslationViews struct { Views []TranslationView TotalRecords int }
type MockLangViewRepository ¶
mockery --name=LangViewRepository --filename=lang_view_repository_mock.go --output=./ --structname=MockLangViewRepository --inpackage MockLangViewRepository is an autogenerated mock type for the LangViewRepository type
func NewMockLangViewRepository ¶
func NewMockLangViewRepository(t mockConstructorTestingTNewMockLangViewRepository) *MockLangViewRepository
NewMockLangViewRepository creates a new instance of MockLangViewRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockLangViewRepository) GetAllViews ¶
func (_m *MockLangViewRepository) GetAllViews(authorID string) ([]LangView, error)
GetAllViews provides a mock function with given fields: authorID
type MockTagViewRepository ¶
mockery --name=TagViewRepository --filename=tag_view_repository_mock.go --output=./ --structname=MockTagViewRepository --inpackage MockTagViewRepository is an autogenerated mock type for the TagViewRepository type
func NewMockTagViewRepository ¶
func NewMockTagViewRepository(t mockConstructorTestingTNewMockTagViewRepository) *MockTagViewRepository
NewMockTagViewRepository creates a new instance of MockTagViewRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockTagViewRepository) GetAllViews ¶
func (_m *MockTagViewRepository) GetAllViews(authorID string) ([]TagView, error)
GetAllViews provides a mock function with given fields: authorID
type MockTranslationViewRepository ¶
mockery --name=TranslationViewRepository --filename=translation_view_repository_mock.go --output=./ --structname=MockTranslationViewRepository --inpackage MockTranslationViewRepository is an autogenerated mock type for the TranslationViewRepository type
func NewMockTranslationViewRepository ¶
func NewMockTranslationViewRepository(t mockConstructorTestingTNewMockTranslationViewRepository) *MockTranslationViewRepository
NewMockTranslationViewRepository creates a new instance of MockTranslationViewRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockTranslationViewRepository) GetLastViewsBySourcePart ¶
func (_m *MockTranslationViewRepository) GetLastViewsBySourcePart(authorID string, langID string, sourcePart string, pageSize int, page int) (LastTranslationViews, error)
GetLastViewsBySourcePart provides a mock function with given fields: authorID, langID, sourcePart, pageSize, page
func (*MockTranslationViewRepository) GetLastViewsByTags ¶
func (_m *MockTranslationViewRepository) GetLastViewsByTags(authorID string, langID string, pageSize int, page int, tagIds []string) (LastTranslationViews, error)
GetLastViewsByTags provides a mock function with given fields: authorID, langID, pageSize, page, tagIds
func (*MockTranslationViewRepository) GetLastViewsByTargetPart ¶
func (_m *MockTranslationViewRepository) GetLastViewsByTargetPart(authorID string, langID string, targetPart string, pageSize int, page int) (LastTranslationViews, error)
GetLastViewsByTargetPart provides a mock function with given fields: authorID, langID, targetPart, pageSize, page
func (*MockTranslationViewRepository) GetRandomViews ¶
func (_m *MockTranslationViewRepository) GetRandomViews(authorID string, langID string, tagIds []string, limit int) (RandomViews, error)
GetRandomViews provides a mock function with given fields: authorID, langID, tagIds, limit
func (*MockTranslationViewRepository) GetView ¶
func (_m *MockTranslationViewRepository) GetView(id string, authorID string) (TranslationView, error)
GetView provides a mock function with given fields: id, authorID
type MockUserViewRepository ¶
mockery --name=UserViewRepository --filename=user_view_repository_mock.go --output=./ --structname=MockUserViewRepository --inpackage MockUserViewRepository is an autogenerated mock type for the UserViewRepository type
func NewMockUserViewRepository ¶
func NewMockUserViewRepository(t mockConstructorTestingTNewMockUserViewRepository) *MockUserViewRepository
NewMockUserViewRepository creates a new instance of MockUserViewRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockUserViewRepository) GetAllViews ¶
func (_m *MockUserViewRepository) GetAllViews() ([]UserView, error)
GetAllViews provides a mock function with given fields:
type RandomTranslations ¶
type RandomTranslationsHandler ¶
type RandomTranslationsHandler struct {
// contains filtered or unexported fields
}
func NewRandomTranslationsHandler ¶
func NewRandomTranslationsHandler(translationRepo TranslationViewRepository, validate *validator.Validate) RandomTranslationsHandler
func (RandomTranslationsHandler) Handle ¶
func (h RandomTranslationsHandler) Handle(query RandomTranslations) (RandomViews, error)
type RandomViews ¶
type RandomViews struct {
Views []TranslationView
}
type RoleConverter ¶
type RoleConverter struct {
// contains filtered or unexported fields
}
func NewRoleMapper ¶
func NewRoleMapper() *RoleConverter
func (RoleConverter) RoleToView ¶
func (m RoleConverter) RoleToView(role user.Role) (RoleView, error)
type SearchTranslations ¶
type SearchTranslations struct { AuthorID string `validate:"required"` LangID string `validate:"required"` TagIds []string SourcePart string `validate:"excluded_with=TargetPart TagIds"` TargetPart string `validate:"excluded_with=SourcePart TagIds"` PageSize int `validate:"gte=1,lte=200"` Page int `validate:"gte=1"` }
type SearchTranslationsHandler ¶
type SearchTranslationsHandler struct {
// contains filtered or unexported fields
}
func NewSearchTranslationsHandler ¶
func NewSearchTranslationsHandler(translationRepo TranslationViewRepository, validate *validator.Validate) SearchTranslationsHandler
func (SearchTranslationsHandler) Handle ¶
func (h SearchTranslationsHandler) Handle(query SearchTranslations) (LastTranslationViews, error)
type SingleLang ¶
type SingleLangHandler ¶
type SingleLangHandler struct {
// contains filtered or unexported fields
}
func NewSingleLangHandler ¶
func NewSingleLangHandler(langRepo LangViewRepository, validate *validator.Validate) SingleLangHandler
func (SingleLangHandler) Handle ¶
func (h SingleLangHandler) Handle(cmd SingleLang) (LangView, error)
type SingleTagHandler ¶
type SingleTagHandler struct {
// contains filtered or unexported fields
}
SingleTagHandler get tag query handler
func NewSingleTagHandler ¶
func NewSingleTagHandler(tagRepo TagViewRepository, validate *validator.Validate) SingleTagHandler
type SingleTranslation ¶
type SingleTranslation struct { ID string `validate:"required"` AuthorID string `validate:"required"` }
SingleTranslation get translation by ID and authorID query
type SingleTranslationHandler ¶
type SingleTranslationHandler struct {
// contains filtered or unexported fields
}
SingleTranslationHandler get translation query handler
func NewSingleTranslationHandler ¶
func NewSingleTranslationHandler(translationRepo TranslationViewRepository, validate *validator.Validate) SingleTranslationHandler
func (SingleTranslationHandler) Handle ¶
func (h SingleTranslationHandler) Handle(cmd SingleTranslation) (TranslationView, error)
Handle performs query to get translation by ID and authorID
type SingleUser ¶
type SingleUser struct {
ID string `validate:"required"`
}
SingleUser get user by ID
type SingleUserHandler ¶
type SingleUserHandler struct {
// contains filtered or unexported fields
}
SingleUserHandler get tag query handler
func NewSingleUserHandler ¶
func NewSingleUserHandler(userRepo UserViewRepository, validate *validator.Validate) SingleUserHandler
func (SingleUserHandler) Handle ¶
func (h SingleUserHandler) Handle(cmd SingleUser) (UserView, error)
Handle performs query to get user by ID
type TagViewRepository ¶
type TranslationView ¶
type TranslationViewRepository ¶
type TranslationViewRepository interface { GetView(id, authorID string) (TranslationView, error) GetLastViewsByTags(authorID, langID string, pageSize, page int, tagIds []string) (LastTranslationViews, error) GetRandomViews(authorID, langID string, tagIds []string, limit int) (RandomViews, error) GetLastViewsBySourcePart(authorID, langID, sourcePart string, pageSize, page int) (LastTranslationViews, error) GetLastViewsByTargetPart(authorID, langID, targetPart string, pageSize, page int) (LastTranslationViews, error) }
Source Files ¶
- all_langs.go
- all_roles.go
- all_tags.go
- all_users.go
- lang_view_repository_mock.go
- random_translations.go
- search_translations.go
- service.go
- single_lang.go
- single_tag.go
- single_translation.go
- single_user.go
- tag_view_repository_mock.go
- translation_view_repository_mock.go
- types.go
- user_view_repository_mock.go