Documentation
¶
Index ¶
- type Server
- func (s *Server) GetEmbeddedAgentStore() *cache.Store
- func (s *Server) InitAdminUser(username, password string) error
- func (s *Server) Run() error
- func (s *Server) SetChannelMasterListen(addr string)
- func (s *Server) SetupEmbeddedAgentForTest(listenAddr string) error
- func (s *Server) Shutdown(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
Cfg *config.MasterRuntimeConfig
Logger *zap.Logger
DB *gorm.DB
Bus app.EventBus
Router *gin.Engine
Version atomic.Int64
Hub *msync.Hub
Listener net.Listener
App app.Application
// contains filtered or unexported fields
}
func (*Server) GetEmbeddedAgentStore ¶
GetEmbeddedAgentStore returns the embedded agent's cache store. Tests use this to wait for cache sync barriers (e.g. polling until __system_test__ token is visible to the relay's auth middleware).
Returns nil if embedded agent has not been set up yet.
func (*Server) InitAdminUser ¶
func (*Server) SetChannelMasterListen ¶
SetChannelMasterListen overrides the channel handler's MasterListen after master.New() has run. Used by tests that bind a real listener (which yields the actual port) only after server construction.
func (*Server) SetupEmbeddedAgentForTest ¶
SetupEmbeddedAgentForTest mounts the embedded agent relay routes on the master router using the given listen address. This is the test-only escape hatch that replicates the production path in Run() without requiring a real net.Listener. Call it after httptest.NewServer so you have the actual port.