Documentation
¶
Index ¶
- type App
- type Server
- func (s *Server) GetPrivateAddress() string
- func (s *Server) GetPrivatePort() int
- func (s *Server) OnStarted(f func()) *Server
- func (s *Server) Shutdown(ctx context.Context)
- func (s *Server) Start(startHook func(*http.ServeMux), shutdownHook func())
- func (s *Server) StartWithPrivateRouting(publicSetup func(*http.ServeMux, *App), ...)
- func (s *Server) StartWithPrivateServer(startHook func(*http.ServeMux), privateStartHook func(*http.ServeMux), ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Auth *auth.Auth
Cluster *cluster.Cluster
Config *config.Config
DatabaseManager *database.DatabaseManager
LogManager *logs.LogManager
ServeMux *netHttp.ServeMux
// contains filtered or unexported fields
}
func (*App) IsInitialized ¶
type Server ¶
type Server struct {
HttpServer *http.Server
PrivatePort int // Store the actual assigned private port
PrivateServeMux *http.ServeMux
PrivateServer *http.Server
ServeMux *http.ServeMux
// contains filtered or unexported fields
}
func (*Server) GetPrivateAddress ¶ added in v0.5.0
GetPrivateAddress returns the full address of the private server
func (*Server) GetPrivatePort ¶ added in v0.5.0
GetPrivatePort returns the actual port number assigned to the private server
func (*Server) OnStarted ¶
OnStarted sets a callback function that is called when the server has successfully started and is ready to accept connections.
func (*Server) StartWithPrivateRouting ¶ added in v0.5.0
func (s *Server) StartWithPrivateRouting( publicSetup func(*http.ServeMux, *App), privateSetup func(*http.ServeMux, *App), shutdownHook func(*App), )
StartWithPrivateRouting starts the server with both public and private servers, automatically setting up the private port provider for cluster communication. This is the recommended way to start a Litebase server.
Click to show internal directories.
Click to hide internal directories.