Documentation
¶
Index ¶
- type MockCache
- func (m *MockCache) Clear()
- func (m *MockCache) Close() error
- func (m *MockCache) Decr(ctx context.Context, key string) (int64, error)
- func (m *MockCache) Del(ctx context.Context, keys ...string) error
- func (m *MockCache) Exists(ctx context.Context, keys ...string) (int64, error)
- func (m *MockCache) Expire(ctx context.Context, key string, expiration time.Duration) error
- func (m *MockCache) Get(ctx context.Context, key string) (string, error)
- func (m *MockCache) Health(ctx context.Context) error
- func (m *MockCache) Incr(ctx context.Context, key string) (int64, error)
- func (m *MockCache) SAdd(ctx context.Context, key string, members ...interface{}) error
- func (m *MockCache) SIsMember(ctx context.Context, key string, member interface{}) (bool, error)
- func (m *MockCache) SMembers(ctx context.Context, key string) ([]string, error)
- func (m *MockCache) SRem(ctx context.Context, key string, members ...interface{}) error
- func (m *MockCache) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error
- func (m *MockCache) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) (bool, error)
- type MockGitLabClient
- func (m *MockGitLabClient) GetCodeowners(projectID int, ref string) (string, error)
- func (m *MockGitLabClient) GetMRChangedFiles(projectID, mrIID int) ([]string, error)
- func (m *MockGitLabClient) GetUserStatus(userID int) (*gitlab.UserStatus, error)
- func (m *MockGitLabClient) PostComment(projectID, mrIID int, comment string) (int, error)
- func (m *MockGitLabClient) UpdateComment(projectID, mrIID, noteID int, comment string) error
- type MockUserRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockCache ¶
type MockCache struct {
// contains filtered or unexported fields
}
MockCache is an in-memory mock implementation of the Cache interface Used for testing without requiring a real Redis instance
func (*MockCache) Clear ¶
func (m *MockCache) Clear()
Clear resets the mock cache (useful for tests)
type MockGitLabClient ¶
type MockGitLabClient struct {
GetCodeownersFunc func(projectID int, ref string) (string, error)
GetUserStatusFunc func(userID int) (*gitlab.UserStatus, error)
PostCommentFunc func(projectID, mrIID int, comment string) (int, error)
UpdateCommentFunc func(projectID, mrIID, noteID int, comment string) error
GetMRChangedFilesFunc func(projectID, mrIID int) ([]string, error)
}
MockGitLabClient is a simple mock for GitLab client
func (*MockGitLabClient) GetCodeowners ¶
func (m *MockGitLabClient) GetCodeowners(projectID int, ref string) (string, error)
func (*MockGitLabClient) GetMRChangedFiles ¶
func (m *MockGitLabClient) GetMRChangedFiles(projectID, mrIID int) ([]string, error)
func (*MockGitLabClient) GetUserStatus ¶
func (m *MockGitLabClient) GetUserStatus(userID int) (*gitlab.UserStatus, error)
func (*MockGitLabClient) PostComment ¶
func (m *MockGitLabClient) PostComment(projectID, mrIID int, comment string) (int, error)
func (*MockGitLabClient) UpdateComment ¶
func (m *MockGitLabClient) UpdateComment(projectID, mrIID, noteID int, comment string) error
type MockUserRepository ¶
type MockUserRepository struct {
GetByUsernameFunc func(username string) (*models.User, error)
GetByGitLabIDFunc func(gitlabID int) (*models.User, error)
GetByTeamFunc func(team string) ([]models.User, error)
GetAllFunc func() ([]models.User, error)
}
MockUserRepository is a simple mock for user repository
func (*MockUserRepository) GetByGitLabID ¶
func (m *MockUserRepository) GetByGitLabID(gitlabID int) (*models.User, error)
func (*MockUserRepository) GetByTeam ¶
func (m *MockUserRepository) GetByTeam(team string) ([]models.User, error)
func (*MockUserRepository) GetByUsername ¶
func (m *MockUserRepository) GetByUsername(username string) (*models.User, error)
Click to show internal directories.
Click to hide internal directories.