api

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

type Router struct {
	*chi.Mux
	// contains filtered or unexported fields
}

Router configuration for the REST API

func NewRouter

func NewRouter(config RouterConfig) *Router

NewRouter creates a new API router with all routes configured

type RouterConfig

type RouterConfig struct {
	Logger             *zap.Logger
	DomainService      *service.DomainService
	UserService        *service.UserService
	AliasService       *service.AliasService
	MailboxService     *service.MailboxService
	MessageService     *service.MessageService
	PhishingService    *phishing.PhishingDetectionService
	QueueService       *service.QueueService
	SetupService       *service.SetupService
	SettingsService    *service.SettingsService
	PGPService         *service.PGPService
	AuditService       *service.AuditService
	WebhookService     *service.WebhookService
	ContactService     *contactService.ContactService
	AddressbookService *contactService.AddressbookService
	CalendarService    *calendarService.CalendarService
	EventService       *calendarService.EventService
	AuditorService     *repService.AuditorService
	ScoresRepo         repRepository.ScoresRepository
	EventsRepo         repRepository.EventsRepository
	CircuitRepo        repRepository.CircuitBreakerRepository
	// Phase 5 repositories
	DMARCRepo          repRepository.DMARCReportsRepository
	ARFRepo            repRepository.ARFReportsRepository
	PostmasterRepo     repRepository.PostmasterMetricsRepository
	SNDSRepo           repRepository.SNDSMetricsRepository
	ProviderLimitsRepo repRepository.ProviderRateLimitsRepository
	WarmupRepo         repRepository.CustomWarmupRepository
	PredictionsRepo    repRepository.PredictionsRepository
	AlertsRepo         repRepository.AlertsRepository
	// Phase 5 services
	DMARCAnalyzer   *repService.DMARCAnalyzerService
	ARFParser       *repService.ARFParserService
	GmailPostmaster *repService.GmailPostmasterService
	MicrosoftSNDS   *repService.MicrosoftSNDSService
	ProviderLimits  *repService.ProviderRateLimitsService
	CustomWarmup    *repService.CustomWarmupService
	Predictions     *repService.PredictionsService
	Alerts          *repService.AlertsService
	APIKeyRepo      repository.APIKeyRepository
	RateLimitRepo   repository.RateLimitRepository
	DB              *sql.DB
	JWTSecret       string
	CORSOrigins     []string
	WebUIConfig     *config.WebUIConfig
}

RouterConfig contains dependencies for the API router

type Server

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

Server represents the admin API HTTP server

func NewServer

func NewServer(
	cfg *config.APIConfig,
	fullConfig *config.Config,
	configPath string,
	db *database.DB,
	domainRepo repository.DomainRepository,
	userRepo repository.UserRepository,
	aliasRepo repository.AliasRepository,
	mailboxRepo repository.MailboxRepository,
	messageRepo repository.MessageRepository,
	queueRepo repository.QueueRepository,
	apiKeyRepo repository.APIKeyRepository,
	rateLimitRepo repository.RateLimitRepository,
	webhookRepo repository.WebhookRepository,
	contactService *contactService.ContactService,
	addressbookService *contactService.AddressbookService,
	calendarService *calendarService.CalendarService,
	eventService *calendarService.EventService,
	telemetryService *repService.TelemetryService,
	auditorService *repService.AuditorService,
	reputationDB interface {
		GetEventRepo() repRepository.EventsRepository
		GetScoresRepo() repRepository.ScoresRepository
		GetCircuitBreakerRepo() repRepository.CircuitBreakerRepository
	},
	logger *zap.Logger,
) *Server

NewServer creates a new admin API server This is a wrapper around NewRouter for backward compatibility

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the admin API server

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start starts the admin API server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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