Documentation
¶
Index ¶
- type Container
- type SimpleGitHubAuthService
- func (s *SimpleGitHubAuthService) AuthenticateWithToken(ctx context.Context, token string) (*entities.User, error)
- func (s *SimpleGitHubAuthService) ExchangeCodeForToken(ctx context.Context, code, state string) (*services_ports.OAuthToken, error)
- func (s *SimpleGitHubAuthService) GenerateOAuthURL(ctx context.Context, redirectURI string) (string, string, error)
- func (s *SimpleGitHubAuthService) GetUserInfo(ctx context.Context, token string) (*entities.GitHubUserInfo, error)
- func (s *SimpleGitHubAuthService) GetUserTeams(ctx context.Context, token string, user *entities.GitHubUserInfo) ([]entities.GitHubTeamMembership, error)
- func (s *SimpleGitHubAuthService) RevokeOAuthToken(ctx context.Context, token string) error
- func (s *SimpleGitHubAuthService) ValidateGitHubToken(ctx context.Context, token string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// Repositories
UserRepo repositories_ports.UserRepository
NotificationRepo repositories_ports.NotificationRepository
// Services
AuthService services_ports.AuthService
NotificationService services_ports.NotificationService
GitHubAuthService services_ports.GitHubAuthService
// Use Cases
AuthenticateUserUC *auth.AuthenticateUserUseCase
ValidateAPIKeyUC *auth.ValidateAPIKeyUseCase
GitHubAuthenticateUC *auth.GitHubAuthenticateUseCase
ValidatePermissionUC *auth.ValidatePermissionUseCase
SendNotificationUC *notification.SendNotificationUseCase
ManageSubscriptionUC *notification.ManageSubscriptionUseCase
// Presenters
AuthPresenter presenters.AuthPresenter
NotificationPresenter presenters.NotificationPresenter
// Controllers
AuthController *controllers.AuthController
NotificationController *controllers.NotificationController
AuthMiddleware *controllers.AuthMiddleware
}
Container holds all dependencies for the application
func NewContainer ¶
func NewContainer() *Container
NewContainer creates and configures a new dependency injection container
type SimpleGitHubAuthService ¶
type SimpleGitHubAuthService struct{}
SimpleGitHubAuthService is a simple implementation of GitHubAuthService
func (*SimpleGitHubAuthService) AuthenticateWithToken ¶
func (*SimpleGitHubAuthService) ExchangeCodeForToken ¶
func (s *SimpleGitHubAuthService) ExchangeCodeForToken(ctx context.Context, code, state string) (*services_ports.OAuthToken, error)
func (*SimpleGitHubAuthService) GenerateOAuthURL ¶
func (*SimpleGitHubAuthService) GetUserInfo ¶
func (s *SimpleGitHubAuthService) GetUserInfo(ctx context.Context, token string) (*entities.GitHubUserInfo, error)
func (*SimpleGitHubAuthService) GetUserTeams ¶
func (s *SimpleGitHubAuthService) GetUserTeams(ctx context.Context, token string, user *entities.GitHubUserInfo) ([]entities.GitHubTeamMembership, error)
func (*SimpleGitHubAuthService) RevokeOAuthToken ¶
func (s *SimpleGitHubAuthService) RevokeOAuthToken(ctx context.Context, token string) error
func (*SimpleGitHubAuthService) ValidateGitHubToken ¶
Click to show internal directories.
Click to hide internal directories.