http

package
v0.0.0-...-aefc8fd Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: AGPL-3.0, GPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteJSONError

func WriteJSONError(w http.ResponseWriter, message string, statusCode int)

WriteJSONError writes a JSON error response with the given message and status code. It sets the Content-Type header to application/json and automatically formats the response as {"error": "message"}.

Types

type AcceptInvitationRequest

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

AcceptInvitationRequest defines the request structure for accepting invitations

type AnalyticsHandler

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

AnalyticsHandler handles HTTP requests related to analytics

func NewAnalyticsHandler

func NewAnalyticsHandler(
	service domain.AnalyticsService,
	getJWTSecret func() ([]byte, error),
	logger logger.Logger,
) *AnalyticsHandler

NewAnalyticsHandler creates a new analytics handler

func (*AnalyticsHandler) RegisterRoutes

func (h *AnalyticsHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the analytics-related routes

type AnalyticsQueryRequest

type AnalyticsQueryRequest struct {
	WorkspaceID string          `json:"workspace_id"`
	Query       analytics.Query `json:"query"`
}

AnalyticsQueryRequest represents the request payload for analytics queries

type AnalyticsSchemasRequest

type AnalyticsSchemasRequest struct {
	WorkspaceID string `json:"workspace_id"`
}

AnalyticsSchemasRequest represents the request payload for getting schemas

type AppShutdowner

type AppShutdowner interface {
	Shutdown(ctx context.Context) error
}

AppShutdowner defines the interface for triggering app shutdown

type AutomationHandler

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

AutomationHandler handles HTTP requests for automation management

func NewAutomationHandler

func NewAutomationHandler(service domain.AutomationService, getJWTSecret func() ([]byte, error), logger logger.Logger) *AutomationHandler

NewAutomationHandler creates a new AutomationHandler

func (*AutomationHandler) RegisterRoutes

func (h *AutomationHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the automation routes on the given mux

type BlogHandler

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

func NewBlogHandler

func NewBlogHandler(service domain.BlogService, getJWTSecret func() ([]byte, error), logger logger.Logger, isDemo bool) *BlogHandler

func (*BlogHandler) HandleCreateCategory

func (h *BlogHandler) HandleCreateCategory(w http.ResponseWriter, r *http.Request)

HandleCreateCategory handles the create category request (POST)

func (*BlogHandler) HandleCreatePost

func (h *BlogHandler) HandleCreatePost(w http.ResponseWriter, r *http.Request)

HandleCreatePost handles the create post request (POST)

func (*BlogHandler) HandleDeleteCategory

func (h *BlogHandler) HandleDeleteCategory(w http.ResponseWriter, r *http.Request)

HandleDeleteCategory handles the delete category request (POST)

func (*BlogHandler) HandleDeletePost

func (h *BlogHandler) HandleDeletePost(w http.ResponseWriter, r *http.Request)

HandleDeletePost handles the delete post request (POST)

func (*BlogHandler) HandleGetCategory

func (h *BlogHandler) HandleGetCategory(w http.ResponseWriter, r *http.Request)

HandleGetCategory handles the get category request (GET)

func (*BlogHandler) HandleGetPost

func (h *BlogHandler) HandleGetPost(w http.ResponseWriter, r *http.Request)

HandleGetPost handles the get post request (GET)

func (*BlogHandler) HandleListCategories

func (h *BlogHandler) HandleListCategories(w http.ResponseWriter, r *http.Request)

HandleListCategories handles the list categories request (GET)

func (*BlogHandler) HandleListPosts

func (h *BlogHandler) HandleListPosts(w http.ResponseWriter, r *http.Request)

HandleListPosts handles the list posts request (GET)

func (*BlogHandler) HandlePublishPost

func (h *BlogHandler) HandlePublishPost(w http.ResponseWriter, r *http.Request)

HandlePublishPost handles the publish post request (POST)

func (*BlogHandler) HandleUnpublishPost

func (h *BlogHandler) HandleUnpublishPost(w http.ResponseWriter, r *http.Request)

HandleUnpublishPost handles the unpublish post request (POST)

func (*BlogHandler) HandleUpdateCategory

func (h *BlogHandler) HandleUpdateCategory(w http.ResponseWriter, r *http.Request)

HandleUpdateCategory handles the update category request (POST)

func (*BlogHandler) HandleUpdatePost

func (h *BlogHandler) HandleUpdatePost(w http.ResponseWriter, r *http.Request)

HandleUpdatePost handles the update post request (POST)

func (*BlogHandler) RegisterRoutes

func (h *BlogHandler) RegisterRoutes(mux *http.ServeMux)

type BlogThemeHandler

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

BlogThemeHandler handles HTTP requests for blog themes

func NewBlogThemeHandler

func NewBlogThemeHandler(service domain.BlogService, getJWTSecret func() ([]byte, error), logger logger.Logger) *BlogThemeHandler

NewBlogThemeHandler creates a new blog theme handler

func (*BlogThemeHandler) HandleCreate

func (h *BlogThemeHandler) HandleCreate(w http.ResponseWriter, r *http.Request)

HandleCreate creates a new blog theme

func (*BlogThemeHandler) HandleGet

func (h *BlogThemeHandler) HandleGet(w http.ResponseWriter, r *http.Request)

HandleGet retrieves a blog theme by version

func (*BlogThemeHandler) HandleGetPublished

func (h *BlogThemeHandler) HandleGetPublished(w http.ResponseWriter, r *http.Request)

HandleGetPublished retrieves the currently published blog theme

func (*BlogThemeHandler) HandleList

func (h *BlogThemeHandler) HandleList(w http.ResponseWriter, r *http.Request)

HandleList retrieves blog themes with pagination

func (*BlogThemeHandler) HandlePublish

func (h *BlogThemeHandler) HandlePublish(w http.ResponseWriter, r *http.Request)

HandlePublish publishes a blog theme

func (*BlogThemeHandler) HandleUpdate

func (h *BlogThemeHandler) HandleUpdate(w http.ResponseWriter, r *http.Request)

HandleUpdate updates an existing blog theme

func (*BlogThemeHandler) RegisterRoutes

func (h *BlogThemeHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the blog theme HTTP endpoints

type BroadcastHandler

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

func NewBroadcastHandler

func NewBroadcastHandler(service domain.BroadcastService, templateSvc domain.TemplateService, getJWTSecret func() ([]byte, error), logger logger.Logger, isDemo bool) *BroadcastHandler

func (*BroadcastHandler) HandleCancel

func (h *BroadcastHandler) HandleCancel(w http.ResponseWriter, r *http.Request)

HandleCancel handles the broadcast cancel request

func (*BroadcastHandler) HandleCreate

func (h *BroadcastHandler) HandleCreate(w http.ResponseWriter, r *http.Request)

HandleCreate handles the broadcast create request

func (*BroadcastHandler) HandleDelete

func (h *BroadcastHandler) HandleDelete(w http.ResponseWriter, r *http.Request)

HandleDelete handles the broadcast delete request

func (*BroadcastHandler) HandleGet

func (h *BroadcastHandler) HandleGet(w http.ResponseWriter, r *http.Request)

HandleGet handles the broadcast get request

func (*BroadcastHandler) HandleGetTestResults

func (h *BroadcastHandler) HandleGetTestResults(w http.ResponseWriter, r *http.Request)

HandleGetTestResults handles the A/B test results request

func (*BroadcastHandler) HandleList

func (h *BroadcastHandler) HandleList(w http.ResponseWriter, r *http.Request)

HandleList handles the broadcast list request

func (*BroadcastHandler) HandlePause

func (h *BroadcastHandler) HandlePause(w http.ResponseWriter, r *http.Request)

HandlePause handles the broadcast pause request

func (*BroadcastHandler) HandleRefreshGlobalFeed

func (h *BroadcastHandler) HandleRefreshGlobalFeed(w http.ResponseWriter, r *http.Request)

HandleRefreshGlobalFeed handles the POST /api/broadcasts.refreshGlobalFeed request

func (*BroadcastHandler) HandleResume

func (h *BroadcastHandler) HandleResume(w http.ResponseWriter, r *http.Request)

HandleResume handles the broadcast resume request

func (*BroadcastHandler) HandleSchedule

func (h *BroadcastHandler) HandleSchedule(w http.ResponseWriter, r *http.Request)

HandleSchedule handles the broadcast schedule request

func (*BroadcastHandler) HandleSelectWinner

func (h *BroadcastHandler) HandleSelectWinner(w http.ResponseWriter, r *http.Request)

HandleSelectWinner handles the winner selection request

func (*BroadcastHandler) HandleSendToIndividual

func (h *BroadcastHandler) HandleSendToIndividual(w http.ResponseWriter, r *http.Request)

HandleSendToIndividual handles the broadcast send to individual request

func (*BroadcastHandler) HandleTestRecipientFeed

func (h *BroadcastHandler) HandleTestRecipientFeed(w http.ResponseWriter, r *http.Request)

HandleTestRecipientFeed handles the POST /api/broadcasts.testRecipientFeed request

func (*BroadcastHandler) HandleUpdate

func (h *BroadcastHandler) HandleUpdate(w http.ResponseWriter, r *http.Request)

HandleUpdate handles the broadcast update request

func (*BroadcastHandler) RegisterRoutes

func (h *BroadcastHandler) RegisterRoutes(mux *http.ServeMux)

type ContactHandler

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

func NewContactHandler

func NewContactHandler(service domain.ContactService, getJWTSecret func() ([]byte, error), logger logger.Logger) *ContactHandler

func (*ContactHandler) RegisterRoutes

func (h *ContactHandler) RegisterRoutes(mux *http.ServeMux)

type ContactListHandler

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

func NewContactListHandler

func NewContactListHandler(service domain.ContactListService, getJWTSecret func() ([]byte, error), logger logger.Logger) *ContactListHandler

func (*ContactListHandler) RegisterRoutes

func (h *ContactListHandler) RegisterRoutes(mux *http.ServeMux)

type ContactTimelineHandler

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

ContactTimelineHandler handles HTTP requests for contact timeline

func NewContactTimelineHandler

func NewContactTimelineHandler(
	service domain.ContactTimelineService,
	authService domain.AuthService,
	getJWTSecret func() ([]byte, error),
	logger logger.Logger,
) *ContactTimelineHandler

NewContactTimelineHandler creates a new contact timeline handler

func NewContactTimelineHandlerWithTracer

func NewContactTimelineHandlerWithTracer(
	service domain.ContactTimelineService,
	authService domain.AuthService,
	getJWTSecret func() ([]byte, error),
	logger logger.Logger,
	tracer tracing.Tracer,
) *ContactTimelineHandler

NewContactTimelineHandlerWithTracer creates a new contact timeline handler with a custom tracer

func (*ContactTimelineHandler) RegisterRoutes

func (h *ContactTimelineHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the contact timeline HTTP endpoints

type CustomEventHandler

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

func NewCustomEventHandler

func NewCustomEventHandler(service domain.CustomEventService, getJWTSecret func() ([]byte, error), logger logger.Logger) *CustomEventHandler

func (*CustomEventHandler) GetCustomEvent

func (h *CustomEventHandler) GetCustomEvent(w http.ResponseWriter, r *http.Request)

GET /api/customEvents.get

func (*CustomEventHandler) ImportCustomEvents

func (h *CustomEventHandler) ImportCustomEvents(w http.ResponseWriter, r *http.Request)

POST /api/customEvents.import

func (*CustomEventHandler) ListCustomEvents

func (h *CustomEventHandler) ListCustomEvents(w http.ResponseWriter, r *http.Request)

GET /api/customEvents.list

func (*CustomEventHandler) RegisterRoutes

func (h *CustomEventHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the custom event HTTP endpoints

func (*CustomEventHandler) UpsertCustomEvent

func (h *CustomEventHandler) UpsertCustomEvent(w http.ResponseWriter, r *http.Request)

POST /api/customEvents.upsert - creates or updates a custom event Supports goal tracking (goal_name, goal_type, goal_value) and soft-delete (deleted_at)

type DemoHandler

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

DemoHandler handles HTTP requests for demo operations

func NewDemoHandler

func NewDemoHandler(service *service.DemoService, logger logger.Logger) *DemoHandler

NewDemoHandler creates a new demo handler

func (*DemoHandler) RegisterRoutes

func (h *DemoHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the demo HTTP endpoints

type EmailHandler

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

EmailHandler handles HTTP requests for email operations

func NewEmailHandler

func NewEmailHandler(
	emailService domain.EmailServiceInterface,
	getJWTSecret func() ([]byte, error),
	logger logger.Logger,
	secretKey string,
) *EmailHandler

NewEmailHandler creates a new email handler

func (*EmailHandler) RegisterRoutes

func (h *EmailHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers all workspace RPC-style routes with authentication middleware

type FaviconRequest

type FaviconRequest struct {
	URL string `json:"url"`
}

FaviconRequest represents the request to detect a favicon

type FaviconResponse

type FaviconResponse struct {
	IconURL  string `json:"iconUrl,omitempty"`
	CoverURL string `json:"coverUrl,omitempty"`
	Message  string `json:"message,omitempty"`
}

FaviconResponse represents the response with detected favicon and cover URLs

type InboundWebhookEventHandler

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

InboundWebhookEventHandler handles HTTP requests for inbound webhook events

func NewInboundWebhookEventHandler

func NewInboundWebhookEventHandler(service domain.InboundWebhookEventServiceInterface, getJWTSecret func() ([]byte, error), logger logger.Logger) *InboundWebhookEventHandler

NewInboundWebhookEventHandler creates a new inbound webhook event handler

func (*InboundWebhookEventHandler) RegisterRoutes

func (h *InboundWebhookEventHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the inbound webhook event HTTP endpoints

type InitializeRequest

type InitializeRequest struct {
	RootEmail              string `json:"root_email"`
	APIEndpoint            string `json:"api_endpoint"`
	SMTPHost               string `json:"smtp_host"`
	SMTPPort               int    `json:"smtp_port"`
	SMTPUsername           string `json:"smtp_username"`
	SMTPPassword           string `json:"smtp_password"`
	SMTPFromEmail          string `json:"smtp_from_email"`
	SMTPFromName           string `json:"smtp_from_name"`
	SMTPUseTLS             *bool  `json:"smtp_use_tls"`
	SMTPEHLOHostname       string `json:"smtp_ehlo_hostname"`
	TelemetryEnabled       bool   `json:"telemetry_enabled"`
	CheckForUpdates        bool   `json:"check_for_updates"`
	SMTPRelayEnabled       bool   `json:"smtp_relay_enabled"`
	SMTPRelayHost          string `json:"smtp_relay_domain"`
	SMTPRelayPort          int    `json:"smtp_relay_port"`
	SMTPRelayTLSCertBase64 string `json:"smtp_relay_tls_cert_base64"`
	SMTPRelayTLSKeyBase64  string `json:"smtp_relay_tls_key_base64"`
}

InitializeRequest represents the setup initialization request

type InitializeResponse

type InitializeResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

InitializeResponse represents the setup completion response

type LLMHandler

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

LLMHandler handles LLM-related HTTP requests

func NewLLMHandler

func NewLLMHandler(
	service domain.LLMService,
	getJWTSecret func() ([]byte, error),
	logger logger.Logger,
) *LLMHandler

NewLLMHandler creates a new LLM handler

func (*LLMHandler) RegisterRoutes

func (h *LLMHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the LLM handler routes

type ListHandler

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

func NewListHandler

func NewListHandler(service domain.ListService, getJWTSecret func() ([]byte, error), logger logger.Logger) *ListHandler

func (*ListHandler) RegisterRoutes

func (h *ListHandler) RegisterRoutes(mux *http.ServeMux)

type MessageHistoryHandler

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

MessageHistoryHandler handles HTTP requests for message history

func NewMessageHistoryHandler

func NewMessageHistoryHandler(
	service domain.MessageHistoryService,
	authService domain.AuthService,
	getJWTSecret func() ([]byte, error),
	logger logger.Logger,
) *MessageHistoryHandler

NewMessageHistoryHandler creates a new message history handler

func NewMessageHistoryHandlerWithTracer

func NewMessageHistoryHandlerWithTracer(
	service domain.MessageHistoryService,
	authService domain.AuthService,
	getJWTSecret func() ([]byte, error),
	logger logger.Logger,
	tracer tracing.Tracer,
) *MessageHistoryHandler

NewMessageHistoryHandlerWithTracer creates a new message history handler with a custom tracer

func (*MessageHistoryHandler) RegisterRoutes

func (h *MessageHistoryHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the message history HTTP endpoints

type MissingParameterError

type MissingParameterError struct {
	Param string
}

MissingParameterError is an error type for missing URL parameters

func (*MissingParameterError) Error

func (e *MissingParameterError) Error() string

Error returns the error message

type NotificationCenterHandler

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

func NewNotificationCenterHandler

func NewNotificationCenterHandler(service domain.NotificationCenterService, listService domain.ListService, logger logger.Logger, rateLimiter *ratelimiter.RateLimiter) *NotificationCenterHandler

func (*NotificationCenterHandler) HandleDetectFavicon

func (h *NotificationCenterHandler) HandleDetectFavicon(w http.ResponseWriter, r *http.Request)

func (*NotificationCenterHandler) RegisterRoutes

func (h *NotificationCenterHandler) RegisterRoutes(mux *http.ServeMux)

type RemoveMemberRequest

type RemoveMemberRequest struct {
	WorkspaceID string `json:"workspace_id"`
	UserID      string `json:"user_id"`
}

RemoveMemberRequest defines the request structure for removing a member

type RootHandler

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

func NewRootHandler

func NewRootHandler(
	consoleDir string,
	notificationCenterDir string,
	logger logger.Logger,
	apiEndpoint string,
	version string,
	rootEmail string,
	isInstalledPtr *bool,
	smtpRelayEnabled bool,
	smtpRelayDomain string,
	smtpRelayPort int,
	smtpRelayTLSEnabled bool,
	workspaceRepo domain.WorkspaceRepository,
	blogService domain.BlogService,
	cache cache.Cache,
) *RootHandler

NewRootHandler creates a root handler that serves both console and notification center static files

func (*RootHandler) Handle

func (h *RootHandler) Handle(w http.ResponseWriter, r *http.Request)

func (*RootHandler) RegisterRoutes

func (h *RootHandler) RegisterRoutes(mux *http.ServeMux)

type SegmentHandler

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

func NewSegmentHandler

func NewSegmentHandler(service domain.SegmentService, getJWTSecret func() ([]byte, error), logger logger.Logger) *SegmentHandler

func (*SegmentHandler) RegisterRoutes

func (h *SegmentHandler) RegisterRoutes(mux *http.ServeMux)

type SetupHandler

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

SetupHandler handles setup wizard endpoints

func NewSetupHandler

func NewSetupHandler(
	setupService *service.SetupService,
	settingService *service.SettingService,
	logger logger.Logger,
	app AppShutdowner,
) *SetupHandler

NewSetupHandler creates a new setup handler

func (*SetupHandler) Initialize

func (h *SetupHandler) Initialize(w http.ResponseWriter, r *http.Request)

Initialize completes the setup wizard

func (*SetupHandler) RegisterRoutes

func (h *SetupHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the setup handler routes

func (*SetupHandler) Status

func (h *SetupHandler) Status(w http.ResponseWriter, r *http.Request)

Status returns the current installation status

func (*SetupHandler) TestSMTP

func (h *SetupHandler) TestSMTP(w http.ResponseWriter, r *http.Request)

TestSMTP tests the SMTP connection with the provided configuration

type StatusResponse

type StatusResponse struct {
	IsInstalled           bool `json:"is_installed"`
	SMTPConfigured        bool `json:"smtp_configured"`
	APIEndpointConfigured bool `json:"api_endpoint_configured"`
	RootEmailConfigured   bool `json:"root_email_configured"`
	SMTPRelayConfigured   bool `json:"smtp_relay_configured"`
}

StatusResponse represents the installation status response

type SupabaseWebhookHandler

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

SupabaseWebhookHandler handles HTTP requests for Supabase webhooks

func NewSupabaseWebhookHandler

func NewSupabaseWebhookHandler(supabaseService *service.SupabaseService, logger logger.Logger) *SupabaseWebhookHandler

NewSupabaseWebhookHandler creates a new Supabase webhook handler

func (*SupabaseWebhookHandler) RegisterRoutes

func (h *SupabaseWebhookHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the Supabase webhook HTTP endpoints

type TaskHandler

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

TaskHandler handles HTTP requests related to tasks

func NewTaskHandler

func NewTaskHandler(
	taskService domain.TaskService,
	getJWTSecret func() ([]byte, error),
	logger logger.Logger,
	secretKey string,
) *TaskHandler

NewTaskHandler creates a new task handler

func (*TaskHandler) CreateTask

func (h *TaskHandler) CreateTask(w http.ResponseWriter, r *http.Request)

CreateTask handles creation of a new task

func (*TaskHandler) DeleteTask

func (h *TaskHandler) DeleteTask(w http.ResponseWriter, r *http.Request)

DeleteTask handles deletion of a task

func (*TaskHandler) ExecutePendingTasks

func (h *TaskHandler) ExecutePendingTasks(w http.ResponseWriter, r *http.Request)

ExecutePendingTasks handles the cron-triggered task execution

func (*TaskHandler) ExecuteTask

func (h *TaskHandler) ExecuteTask(w http.ResponseWriter, r *http.Request)

ExecuteTask handles execution of a single task

func (*TaskHandler) GetCronStatus

func (h *TaskHandler) GetCronStatus(w http.ResponseWriter, r *http.Request)

GetCronStatus returns the last cron run timestamp from settings

func (*TaskHandler) GetTask

func (h *TaskHandler) GetTask(w http.ResponseWriter, r *http.Request)

GetTask handles retrieval of a task by ID

func (*TaskHandler) ListTasks

func (h *TaskHandler) ListTasks(w http.ResponseWriter, r *http.Request)

ListTasks handles listing tasks with optional filtering

func (*TaskHandler) RegisterRoutes

func (h *TaskHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the task-related routes

func (*TaskHandler) ResetTask

func (h *TaskHandler) ResetTask(w http.ResponseWriter, r *http.Request)

ResetTask resets a failed recurring task, clearing error state and scheduling for immediate execution

func (*TaskHandler) TriggerTask

func (h *TaskHandler) TriggerTask(w http.ResponseWriter, r *http.Request)

TriggerTask triggers an immediate execution of a recurring task

type TemplateBlockHandler

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

func NewTemplateBlockHandler

func NewTemplateBlockHandler(service domain.TemplateBlockService, getJWTSecret func() ([]byte, error), logger logger.Logger) *TemplateBlockHandler

func (*TemplateBlockHandler) RegisterRoutes

func (h *TemplateBlockHandler) RegisterRoutes(mux *http.ServeMux)

type TemplateHandler

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

func NewTemplateHandler

func NewTemplateHandler(service domain.TemplateService, getJWTSecret func() ([]byte, error), logger logger.Logger) *TemplateHandler

func (*TemplateHandler) RegisterRoutes

func (h *TemplateHandler) RegisterRoutes(mux *http.ServeMux)

type TestSMTPRequest

type TestSMTPRequest struct {
	SMTPHost         string `json:"smtp_host"`
	SMTPPort         int    `json:"smtp_port"`
	SMTPUsername     string `json:"smtp_username"`
	SMTPPassword     string `json:"smtp_password"`
	SMTPUseTLS       *bool  `json:"smtp_use_tls"`
	SMTPEHLOHostname string `json:"smtp_ehlo_hostname"`
}

TestSMTPRequest represents the SMTP connection test request

type TestSMTPResponse

type TestSMTPResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

TestSMTPResponse represents the SMTP connection test response

type TransactionalNotificationHandler

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

TransactionalNotificationHandler handles HTTP requests for transactional notifications

func NewTransactionalNotificationHandler

func NewTransactionalNotificationHandler(
	service domain.TransactionalNotificationService,
	getJWTSecret func() ([]byte, error),
	logger logger.Logger,
	isDemo bool,
) *TransactionalNotificationHandler

NewTransactionalNotificationHandler creates a new instance of TransactionalNotificationHandler

func (*TransactionalNotificationHandler) RegisterRoutes

func (h *TransactionalNotificationHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers all routes for transactional notifications

type UserHandler

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

func NewUserHandler

func NewUserHandler(userService UserServiceInterface, workspaceService domain.WorkspaceServiceInterface, cfg *config.Config, getJWTSecret func() ([]byte, error), logger logger.Logger) *UserHandler

func (*UserHandler) GetCurrentUser

func (h *UserHandler) GetCurrentUser(w http.ResponseWriter, r *http.Request)

GetCurrentUser returns the authenticated user and their workspaces

func (*UserHandler) Logout

func (h *UserHandler) Logout(w http.ResponseWriter, r *http.Request)

Logout logs out the current user by deleting all their sessions

func (*UserHandler) RegisterRoutes

func (h *UserHandler) RegisterRoutes(mux *http.ServeMux)

func (*UserHandler) RootSignIn

func (h *UserHandler) RootSignIn(w http.ResponseWriter, r *http.Request)

RootSignIn handles programmatic signin for the root user using HMAC signature

func (*UserHandler) SignIn

func (h *UserHandler) SignIn(w http.ResponseWriter, r *http.Request)

func (*UserHandler) VerifyCode

func (h *UserHandler) VerifyCode(w http.ResponseWriter, r *http.Request)

type UserServiceInterface

type UserServiceInterface interface {
	SignIn(ctx context.Context, input domain.SignInInput) (string, error)
	VerifyCode(ctx context.Context, input domain.VerifyCodeInput) (*domain.AuthResponse, error)
	RootSignin(ctx context.Context, input domain.RootSigninInput) (*domain.AuthResponse, error)
	VerifyUserSession(ctx context.Context, userID string, sessionID string) (*domain.User, error)
	GetUserByID(ctx context.Context, userID string) (*domain.User, error)
	Logout(ctx context.Context, userID string) error
}

UserServiceInterface defines the methods required from a user service

type VerifyInvitationTokenRequest

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

VerifyInvitationTokenRequest defines the request structure for verifying invitation tokens

type WebhookRegistrationHandler

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

WebhookRegistrationHandler handles webhook registration HTTP requests

func NewWebhookRegistrationHandler

func NewWebhookRegistrationHandler(
	service domain.WebhookRegistrationService,
	getJWTSecret func() ([]byte, error),
	logger logger.Logger,
) *WebhookRegistrationHandler

NewWebhookRegistrationHandler creates a new webhook registration handler

func (*WebhookRegistrationHandler) RegisterRoutes

func (h *WebhookRegistrationHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the webhook registration HTTP endpoints

type WebhookSubscriptionHandler

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

WebhookSubscriptionHandler handles HTTP requests for webhook subscriptions

func NewWebhookSubscriptionHandler

func NewWebhookSubscriptionHandler(
	svc *service.WebhookSubscriptionService,
	worker *service.WebhookDeliveryWorker,
	getJWTSecret func() ([]byte, error),
	logger logger.Logger,
) *WebhookSubscriptionHandler

NewWebhookSubscriptionHandler creates a new webhook subscription handler

func (*WebhookSubscriptionHandler) RegisterRoutes

func (h *WebhookSubscriptionHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the webhook subscription routes

type WorkspaceHandler

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

WorkspaceHandler handles HTTP requests for workspace operations

func NewWorkspaceHandler

func NewWorkspaceHandler(
	workspaceService domain.WorkspaceServiceInterface,
	authService domain.AuthService,
	getJWTSecret func() ([]byte, error),
	logger logger.Logger,
	secretKey string,
) *WorkspaceHandler

NewWorkspaceHandler creates a new workspace handler

func (*WorkspaceHandler) RegisterRoutes

func (h *WorkspaceHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers all workspace RPC-style routes with authentication middleware

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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