Documentation
¶
Overview ¶
Package server implements the HTTP server for the Moolah API. It defines the Server struct, which holds references to all services and the HTTP handler. The server is responsible for starting and shutting down the HTTP server, as well as defining the routes in a separate file (routes.go).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v1.26.0
type Config struct {
MasterPurchaseSvc domain.MasterPurchaseService
InvestmentSvc domain.InvestmentService
RateLimitStore domain.RateLimitStore
AuthSvc domain.AuthService
TenantSvc domain.TenantService
AccountSvc domain.AccountService
Throttler domain.Throttler
CategorySvc domain.CategoryService
IdempotencyStore domain.IdempotencyStore
TransactionSvc domain.TransactionService
InvoiceCloser domain.InvoiceCloser
AdminSvc domain.AdminService
TokenParser middleware.TokenParser
Port string
OTPRateLimit int
OTPRatePeriod time.Duration
}
Config holds the configuration for the Server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the main HTTP server for the API. It holds references to all services and the HTTP handler.
func (*Server) Handler ¶ added in v1.7.0
Handler returns the underlying http.Handler for testing purposes.
func (*Server) ListenAndServe ¶
ListenAndServe starts the HTTP server with the configured address and handler. It also sets the read and write timeouts.
Click to show internal directories.
Click to hide internal directories.