Documentation
¶
Overview ¶
Package repository is a generated GoMock package.
Package repository is a generated GoMock package.
Index ¶
- func AppendQueryForComment(query *ent.CommentQuery) *ent.CommentQuery
- func NewEnt() *ent.Client
- func WrapEntError(entErr error) error
- type CommentRepository
- type LikeCommentRepository
- type MockCommentRepository
- func (m *MockCommentRepository) Create(createInput *data.CommentInput, isWrittenByArticleAuthor bool) (*ent.Comment, error)
- func (m *MockCommentRepository) Delete(id int) error
- func (m *MockCommentRepository) EXPECT() *MockCommentRepositoryMockRecorder
- func (m *MockCommentRepository) FindAllParentCommentsByArticleID(articleID int) ([]*ent.Comment, error)
- func (m *MockCommentRepository) FindAllParentCommentsByAuthorID(authorID string) ([]*ent.Comment, error)
- func (m *MockCommentRepository) Get(id int) (*ent.Comment, error)
- func (m *MockCommentRepository) Update(id int, updateInput map[string]interface{}) (*ent.Comment, error)
- type MockCommentRepositoryMockRecorder
- func (mr *MockCommentRepositoryMockRecorder) Create(createInput, isWrittenByArticleAuthor interface{}) *gomock.Call
- func (mr *MockCommentRepositoryMockRecorder) Delete(id interface{}) *gomock.Call
- func (mr *MockCommentRepositoryMockRecorder) FindAllParentCommentsByArticleID(articleID interface{}) *gomock.Call
- func (mr *MockCommentRepositoryMockRecorder) FindAllParentCommentsByAuthorID(authorID interface{}) *gomock.Call
- func (mr *MockCommentRepositoryMockRecorder) Get(id interface{}) *gomock.Call
- func (mr *MockCommentRepositoryMockRecorder) Update(id, updateInput interface{}) *gomock.Call
- type MockLikeCommentRepository
- func (m *MockLikeCommentRepository) Create(createInput *data.LikeCommentInput) (*ent.LikeComment, error)
- func (m *MockLikeCommentRepository) Delete(id int) error
- func (m *MockLikeCommentRepository) DeleteAllByCommentID(commentID int) error
- func (m *MockLikeCommentRepository) EXPECT() *MockLikeCommentRepositoryMockRecorder
- func (m *MockLikeCommentRepository) FindAllByCommentID(commentID int) ([]*ent.LikeComment, error)
- func (m *MockLikeCommentRepository) FindAllByUserIDAndCommentID(authorID string, commentID int) ([]*ent.LikeComment, error)
- type MockLikeCommentRepositoryMockRecorder
- func (mr *MockLikeCommentRepositoryMockRecorder) Create(createInput interface{}) *gomock.Call
- func (mr *MockLikeCommentRepositoryMockRecorder) Delete(id interface{}) *gomock.Call
- func (mr *MockLikeCommentRepositoryMockRecorder) DeleteAllByCommentID(commentID interface{}) *gomock.Call
- func (mr *MockLikeCommentRepositoryMockRecorder) FindAllByCommentID(commentID interface{}) *gomock.Call
- func (mr *MockLikeCommentRepositoryMockRecorder) FindAllByUserIDAndCommentID(authorID, commentID interface{}) *gomock.Call
- type SynchronousCacheWrite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendQueryForComment ¶
func AppendQueryForComment(query *ent.CommentQuery) *ent.CommentQuery
댓글 조회 시 기본적으로 필요한 query문을 추가한다. 댓글 작성자 게시물과 게시물의 작성자 스터디 게시물과 스터디 게시물의 작성자 대댓글도 마찬가지 과정
func WrapEntError ¶
NotFound에 대한 EntError를 우리 도메인의 에러 타입으로 변경 만약 여기서 감지되지 않은 에러 타입 케이스는 그냥 그대로 반환됨
Types ¶
type CommentRepository ¶
type CommentRepository interface { Create(createInput *data.CommentInput, isWrittenByArticleAuthor bool) (com *ent.Comment, err error) FindAllParentCommentsByAuthorID(authorID string) (coms []*ent.Comment, err error) FindAllParentCommentsByArticleID(articleID int) (coms []*ent.Comment, err error) //FindAllParentCommentsByStudyArticleID(articleID int) (coms []*ent.Comment, err error) Get(id int) (com *ent.Comment, err error) Update(id int, updateInput map[string]interface{}) (com *ent.Comment, err error) Delete(id int) (err error) }
func NewCommentRepository ¶
func NewCommentRepository(client *ent.Client, cache cache.CommentCacheRepository, synchronousCacheWrite SynchronousCacheWrite) CommentRepository
type LikeCommentRepository ¶
type LikeCommentRepository interface { Create(createInput *data.LikeCommentInput) (like *ent.LikeComment, err error) FindAllByCommentID(commentID int) (likes []*ent.LikeComment, err error) FindAllByUserIDAndCommentID(authorID string, commentID int) (likes []*ent.LikeComment, err error) Delete(id int) error DeleteAllByCommentID(commentID int) error }
func NewLikeCommentRepository ¶
func NewLikeCommentRepository( client *ent.Client, cache cache.LikeCommentCacheRepository, synchronousCacheWrite SynchronousCacheWrite) LikeCommentRepository
type MockCommentRepository ¶
type MockCommentRepository struct {
// contains filtered or unexported fields
}
MockCommentRepository is a mock of CommentRepository interface.
func NewMockCommentRepository ¶
func NewMockCommentRepository(ctrl *gomock.Controller) *MockCommentRepository
NewMockCommentRepository creates a new mock instance.
func (*MockCommentRepository) Create ¶
func (m *MockCommentRepository) Create(createInput *data.CommentInput, isWrittenByArticleAuthor bool) (*ent.Comment, error)
Create mocks base method.
func (*MockCommentRepository) Delete ¶
func (m *MockCommentRepository) Delete(id int) error
Delete mocks base method.
func (*MockCommentRepository) EXPECT ¶
func (m *MockCommentRepository) EXPECT() *MockCommentRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCommentRepository) FindAllParentCommentsByArticleID ¶
func (m *MockCommentRepository) FindAllParentCommentsByArticleID(articleID int) ([]*ent.Comment, error)
FindAllParentCommentsByArticleID mocks base method.
func (*MockCommentRepository) FindAllParentCommentsByAuthorID ¶
func (m *MockCommentRepository) FindAllParentCommentsByAuthorID(authorID string) ([]*ent.Comment, error)
FindAllParentCommentsByAuthorID mocks base method.
type MockCommentRepositoryMockRecorder ¶
type MockCommentRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockCommentRepositoryMockRecorder is the mock recorder for MockCommentRepository.
func (*MockCommentRepositoryMockRecorder) Create ¶
func (mr *MockCommentRepositoryMockRecorder) Create(createInput, isWrittenByArticleAuthor interface{}) *gomock.Call
Create indicates an expected call of Create.
func (*MockCommentRepositoryMockRecorder) Delete ¶
func (mr *MockCommentRepositoryMockRecorder) Delete(id interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockCommentRepositoryMockRecorder) FindAllParentCommentsByArticleID ¶
func (mr *MockCommentRepositoryMockRecorder) FindAllParentCommentsByArticleID(articleID interface{}) *gomock.Call
FindAllParentCommentsByArticleID indicates an expected call of FindAllParentCommentsByArticleID.
func (*MockCommentRepositoryMockRecorder) FindAllParentCommentsByAuthorID ¶
func (mr *MockCommentRepositoryMockRecorder) FindAllParentCommentsByAuthorID(authorID interface{}) *gomock.Call
FindAllParentCommentsByAuthorID indicates an expected call of FindAllParentCommentsByAuthorID.
func (*MockCommentRepositoryMockRecorder) Get ¶
func (mr *MockCommentRepositoryMockRecorder) Get(id interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockCommentRepositoryMockRecorder) Update ¶
func (mr *MockCommentRepositoryMockRecorder) Update(id, updateInput interface{}) *gomock.Call
Update indicates an expected call of Update.
type MockLikeCommentRepository ¶
type MockLikeCommentRepository struct {
// contains filtered or unexported fields
}
MockLikeCommentRepository is a mock of LikeCommentRepository interface.
func NewMockLikeCommentRepository ¶
func NewMockLikeCommentRepository(ctrl *gomock.Controller) *MockLikeCommentRepository
NewMockLikeCommentRepository creates a new mock instance.
func (*MockLikeCommentRepository) Create ¶
func (m *MockLikeCommentRepository) Create(createInput *data.LikeCommentInput) (*ent.LikeComment, error)
Create mocks base method.
func (*MockLikeCommentRepository) Delete ¶
func (m *MockLikeCommentRepository) Delete(id int) error
Delete mocks base method.
func (*MockLikeCommentRepository) DeleteAllByCommentID ¶
func (m *MockLikeCommentRepository) DeleteAllByCommentID(commentID int) error
DeleteAllByCommentID mocks base method.
func (*MockLikeCommentRepository) EXPECT ¶
func (m *MockLikeCommentRepository) EXPECT() *MockLikeCommentRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockLikeCommentRepository) FindAllByCommentID ¶
func (m *MockLikeCommentRepository) FindAllByCommentID(commentID int) ([]*ent.LikeComment, error)
FindAllByCommentID mocks base method.
func (*MockLikeCommentRepository) FindAllByUserIDAndCommentID ¶
func (m *MockLikeCommentRepository) FindAllByUserIDAndCommentID(authorID string, commentID int) ([]*ent.LikeComment, error)
FindAllByUserIDAndCommentID mocks base method.
type MockLikeCommentRepositoryMockRecorder ¶
type MockLikeCommentRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockLikeCommentRepositoryMockRecorder is the mock recorder for MockLikeCommentRepository.
func (*MockLikeCommentRepositoryMockRecorder) Create ¶
func (mr *MockLikeCommentRepositoryMockRecorder) Create(createInput interface{}) *gomock.Call
Create indicates an expected call of Create.
func (*MockLikeCommentRepositoryMockRecorder) Delete ¶
func (mr *MockLikeCommentRepositoryMockRecorder) Delete(id interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockLikeCommentRepositoryMockRecorder) DeleteAllByCommentID ¶
func (mr *MockLikeCommentRepositoryMockRecorder) DeleteAllByCommentID(commentID interface{}) *gomock.Call
DeleteAllByCommentID indicates an expected call of DeleteAllByCommentID.
func (*MockLikeCommentRepositoryMockRecorder) FindAllByCommentID ¶
func (mr *MockLikeCommentRepositoryMockRecorder) FindAllByCommentID(commentID interface{}) *gomock.Call
FindAllByCommentID indicates an expected call of FindAllByCommentID.
func (*MockLikeCommentRepositoryMockRecorder) FindAllByUserIDAndCommentID ¶
func (mr *MockLikeCommentRepositoryMockRecorder) FindAllByUserIDAndCommentID(authorID, commentID interface{}) *gomock.Call
FindAllByUserIDAndCommentID indicates an expected call of FindAllByUserIDAndCommentID.
type SynchronousCacheWrite ¶
type SynchronousCacheWrite bool