ghost-listmonk-connector/handlers/handlers.go
troneras ff5b39241a first commit
fixed cache

Refactoring from app router to page router

Refactoring from app router to page router

Add authentication with JWT

base ui done

protect the dashboard

added transitions

styling

type trick added

cleanup

Add enable-disable logic

add transactional emails

Improvements on delay and frontend

added description on select

implement auth with magic link

migrate to mariadb

webhook signature working

Adding async processing with queues

Implemented webhook reply functionality

Add son execution logs

update status logic

Add recent activity monitoring to sons

show son performance in dashboard

add readme

implement listmonk connector

listmonk-connector-v1

Create CODE_OF_CONDUCT.md

Create LICENSE
2024-08-21 02:09:24 +02:00

47 lines
1.5 KiB
Go

package handlers
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/troneras/ghost-listmonk-connector/services"
)
type Handlers struct {
Auth *AuthHandler
Son *SonHandler
Webhook *WebhookHandler
Listmonk *ListmonkHandler
Home *HomeHandler
WebhookLog *WebhookLogHandler
SonExecutionLog *SonExecutionLogHandler
RecentActivity *RecentActivityHandler
SonStats *SonStatsHandler
}
func NewHandlers(services *services.Services) *Handlers {
return &Handlers{
Auth: NewAuthHandler(services.User, services.MagicLink, services.Email),
Son: NewSonHandler(services.SonStorage),
Webhook: NewWebhookHandler(services.SonStorage, services.SonExecutor, services.Webhook, services.WebhookLogger),
Listmonk: NewListmonkHandler(services.ListmonkClient),
Home: NewHomeHandler(),
WebhookLog: NewWebhookLogHandler(services.WebhookLogger),
SonExecutionLog: NewSonExecutionLogHandler(services.SonExecutionLogger),
RecentActivity: NewRecentActivityHandler(services.RecentActivity),
SonStats: NewSonStatsHandler(services.SonExecutionLogger),
}
}
// HomeHandler handles the home route
type HomeHandler struct{}
func NewHomeHandler() *HomeHandler {
return &HomeHandler{}
}
func (h *HomeHandler) HandleHome(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"message": "Welcome to the Ghost-Listmonk Connector API"})
}
// Implement NewWebhookLogHandler and WebhookLogHandler methods here