Documentation ¶
Index ¶
- Variables
- type MockRepository
- func (_m *MockRepository) AllExist(ids []string, authorID string) (bool, error)
- func (_m *MockRepository) Create(tag *Tag) error
- func (_m *MockRepository) Delete(id string, authorID string) error
- func (_m *MockRepository) DeleteByAuthorID(authorID string) (int, error)
- func (_m *MockRepository) Get(id string, authorID string) (*Tag, error)
- func (_m *MockRepository) Update(tag *Tag) error
- type Repository
- type Tag
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("can not find tag in store")
var ErrTagAlreadyExists = errors.New("tag already exists")
Functions ¶
This section is empty.
Types ¶
type MockRepository ¶
mockery --name=Repository --filename=repository_mock.go --output=./ --structname=MockRepository --inpackage MockRepository is an autogenerated mock type for the Repository type
func NewMockRepository ¶
func NewMockRepository(t mockConstructorTestingTNewMockRepository) *MockRepository
NewMockRepository creates a new instance of MockRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockRepository) AllExist ¶
func (_m *MockRepository) AllExist(ids []string, authorID string) (bool, error)
AllExist provides a mock function with given fields: ids, authorID
func (*MockRepository) Create ¶
func (_m *MockRepository) Create(tag *Tag) error
Create provides a mock function with given fields: tag
func (*MockRepository) Delete ¶
func (_m *MockRepository) Delete(id string, authorID string) error
Delete provides a mock function with given fields: id, authorID
func (*MockRepository) DeleteByAuthorID ¶
func (_m *MockRepository) DeleteByAuthorID(authorID string) (int, error)
DeleteByAuthorID provides a mock function with given fields: authorID
func (*MockRepository) Get ¶
func (_m *MockRepository) Get(id string, authorID string) (*Tag, error)
Get provides a mock function with given fields: id, authorID
func (*MockRepository) Update ¶
func (_m *MockRepository) Update(tag *Tag) error
Update provides a mock function with given fields: tag
type Repository ¶
type Repository interface { Create(tag *Tag) error // Create returns ErrTagAlreadyExists if record for pair name-authorID already exists Update(tag *Tag) error // Update returns ErrTagAlreadyExists if record for pair name-authorID already exists Get(id, authorID string) (*Tag, error) // Get provide tag by id and authorID, return ErrNotFound when tag not exist Delete(id, authorID string) error AllExist(ids []string, authorID string) (bool, error) DeleteByAuthorID(authorID string) (int, error) }