di

package
v1.331.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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 (s *SimpleGitHubAuthService) AuthenticateWithToken(ctx context.Context, token string) (*entities.User, error)

func (*SimpleGitHubAuthService) ExchangeCodeForToken

func (s *SimpleGitHubAuthService) ExchangeCodeForToken(ctx context.Context, code, state string) (*services_ports.OAuthToken, error)

func (*SimpleGitHubAuthService) GenerateOAuthURL

func (s *SimpleGitHubAuthService) GenerateOAuthURL(ctx context.Context, redirectURI string) (string, string, error)

func (*SimpleGitHubAuthService) GetUserInfo

func (*SimpleGitHubAuthService) GetUserTeams

func (*SimpleGitHubAuthService) RevokeOAuthToken

func (s *SimpleGitHubAuthService) RevokeOAuthToken(ctx context.Context, token string) error

func (*SimpleGitHubAuthService) ValidateGitHubToken

func (s *SimpleGitHubAuthService) ValidateGitHubToken(ctx context.Context, token string) (bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL