controllers

package
v1.76.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthController

type AuthController struct {
	// contains filtered or unexported fields
}

AuthController handles HTTP requests for authentication operations

func NewAuthController

func NewAuthController(
	authenticateUserUC *auth.AuthenticateUserUseCase,
	validateAPIKeyUC *auth.ValidateAPIKeyUseCase,
	githubAuthenticateUC *auth.GitHubAuthenticateUseCase,
	validatePermissionUC *auth.ValidatePermissionUseCase,
	authPresenter presenters.AuthPresenter,
) *AuthController

NewAuthController creates a new AuthController

func (*AuthController) GitHubLogin

func (c *AuthController) GitHubLogin(w http.ResponseWriter, r *http.Request)

GitHubLogin handles POST /auth/github

func (*AuthController) Login

func (c *AuthController) Login(w http.ResponseWriter, r *http.Request)

Login handles POST /auth/login

func (*AuthController) Logout

func (c *AuthController) Logout(w http.ResponseWriter, r *http.Request)

Logout handles POST /auth/logout

func (*AuthController) ValidateAPIKey

func (c *AuthController) ValidateAPIKey(w http.ResponseWriter, r *http.Request)

ValidateAPIKey handles POST /auth/validate

type AuthMiddleware

type AuthMiddleware struct {
	// contains filtered or unexported fields
}

AuthMiddleware provides authentication middleware

func NewAuthMiddleware

func NewAuthMiddleware(
	validateAPIKeyUC *auth.ValidateAPIKeyUseCase,
	authPresenter presenters.AuthPresenter,
) *AuthMiddleware

NewAuthMiddleware creates a new AuthMiddleware

func (*AuthMiddleware) Authenticate

func (m *AuthMiddleware) Authenticate(next http.Handler) http.Handler

Authenticate is a middleware that validates API keys and sets user context

type CreateSubscriptionRequest

type CreateSubscriptionRequest struct {
	Type     string            `json:"type"`
	Endpoint string            `json:"endpoint"`
	Keys     map[string]string `json:"keys,omitempty"`
}

CreateSubscriptionRequest represents the HTTP request for creating a subscription

type GitHubLoginRequest

type GitHubLoginRequest struct {
	Token string `json:"token"`
}

GitHubLoginRequest represents the HTTP request for GitHub login

type LoginRequest

type LoginRequest struct {
	Type     string `json:"type"` // "password", "token", "api_key"
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
	Token    string `json:"token,omitempty"`
	APIKey   string `json:"api_key,omitempty"`
}

LoginRequest represents the HTTP request for user login

type NotificationController

type NotificationController struct {
	// contains filtered or unexported fields
}

NotificationController handles HTTP requests for notification operations

func NewNotificationController

func NewNotificationController(
	sendNotificationUC *notification.SendNotificationUseCase,
	manageSubscriptionUC *notification.ManageSubscriptionUseCase,
	notificationPresenter presenters.NotificationPresenter,
) *NotificationController

NewNotificationController creates a new NotificationController

func (*NotificationController) CreateSubscription

func (c *NotificationController) CreateSubscription(w http.ResponseWriter, r *http.Request)

CreateSubscription handles POST /subscriptions

func (*NotificationController) DeleteSubscription

func (c *NotificationController) DeleteSubscription(w http.ResponseWriter, r *http.Request)

DeleteSubscription handles DELETE /subscriptions/{id}

func (*NotificationController) SendNotification

func (c *NotificationController) SendNotification(w http.ResponseWriter, r *http.Request)

SendNotification handles POST /notifications

type SendNotificationRequest

type SendNotificationRequest struct {
	Title   string            `json:"title"`
	Body    string            `json:"body"`
	URL     *string           `json:"url,omitempty"`
	Tags    map[string]string `json:"tags,omitempty"`
	IconURL *string           `json:"icon_url,omitempty"`
}

SendNotificationRequest represents the HTTP request for sending a notification

Jump to

Keyboard shortcuts

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