Documentation
¶
Index ¶
- func ExtractRepositoryInfo(tags map[string]string, cloneDir string) *entities.RepositoryInfo
- type CustomHandler
- type HandlerRegistry
- type OAuthCallbackRequest
- type OAuthLoginRequest
- type OAuthLoginResponse
- type OAuthSession
- type OAuthSessionResponse
- type OAuthTokenResponse
- type Router
- type Server
- func (s *Server) AddCustomHandler(handler CustomHandler)
- func (s *Server) CreateSession(sessionID string, startReq entities.StartRequest, userID, userRole string, ...) (entities.Session, error)
- func (s *Server) DeleteSessionByID(sessionID string) error
- func (s *Server) GetConfig() *config.Config
- func (s *Server) GetContainer() *di.Container
- func (s *Server) GetEcho() *echo.Echo
- func (s *Server) GetNotificationService() *notification.Service
- func (s *Server) GetSessionManager() portrepos.SessionManager
- func (s *Server) GetSettingsRepository() portrepos.SettingsRepository
- func (s *Server) GetShareRepository() portrepos.ShareRepository
- func (s *Server) SetSessionManager(manager portrepos.SessionManager)
- func (s *Server) SetShareRepository(repo portrepos.ShareRepository)
- func (s *Server) Shutdown(timeout time.Duration) error
- func (s *Server) StartMonitoring()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractRepositoryInfo ¶
func ExtractRepositoryInfo(tags map[string]string, cloneDir string) *entities.RepositoryInfo
ExtractRepositoryInfo extracts repository information from tags. This is a public function that can be used by other packages (e.g., schedule). The cloneDir parameter is typically the session ID.
Types ¶
type CustomHandler ¶
type CustomHandler interface {
RegisterRoutes(e *echo.Echo, server *Server) error
GetName() string
}
CustomHandler interface for adding custom routes
type HandlerRegistry ¶
type HandlerRegistry struct {
// contains filtered or unexported fields
}
HandlerRegistry contains all handlers
type OAuthCallbackRequest ¶
OAuthCallbackRequest represents the OAuth callback parameters
type OAuthLoginRequest ¶
type OAuthLoginRequest struct {
RedirectURI string `json:"redirect_uri"`
}
OAuthLoginRequest represents the request body for OAuth login
type OAuthLoginResponse ¶
OAuthLoginResponse represents the response for OAuth login
type OAuthSession ¶
type OAuthSession struct {
ID string
UserContext *auth.UserContext
CreatedAt time.Time
ExpiresAt time.Time
}
OAuthSession represents an authenticated OAuth session
type OAuthSessionResponse ¶
type OAuthSessionResponse struct {
SessionID string `json:"session_id"`
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
ExpiresAt time.Time `json:"expires_at"`
User *auth.UserContext `json:"user"`
}
OAuthSessionResponse represents the response with session information
type OAuthTokenResponse ¶
type OAuthTokenResponse struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
ExpiresAt time.Time `json:"expires_at"`
User *auth.UserContext `json:"user"`
}
OAuthTokenResponse represents the response after successful OAuth
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router handles route registration and management
func (*Router) AddCustomHandler ¶
func (r *Router) AddCustomHandler(handler CustomHandler)
AddCustomHandler adds a custom handler to the registry
func (*Router) RegisterRoutes ¶
RegisterRoutes registers all routes
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the HTTP server
func (*Server) AddCustomHandler ¶
func (s *Server) AddCustomHandler(handler CustomHandler)
AddCustomHandler adds a custom handler to the router
func (*Server) CreateSession ¶
func (s *Server) CreateSession(sessionID string, startReq entities.StartRequest, userID, userRole string, teams []string) (entities.Session, error)
CreateSession creates a new agent session
func (*Server) DeleteSessionByID ¶
DeleteSessionByID deletes a session by ID
func (*Server) GetContainer ¶
GetContainer returns the DI container
func (*Server) GetNotificationService ¶
func (s *Server) GetNotificationService() *notification.Service
GetNotificationService returns the notification service
func (*Server) GetSessionManager ¶
func (s *Server) GetSessionManager() portrepos.SessionManager
GetSessionManager returns the session manager
func (*Server) GetSettingsRepository ¶
func (s *Server) GetSettingsRepository() portrepos.SettingsRepository
GetSettingsRepository returns the settings repository
func (*Server) GetShareRepository ¶
func (s *Server) GetShareRepository() portrepos.ShareRepository
GetShareRepository returns the share repository
func (*Server) SetSessionManager ¶
func (s *Server) SetSessionManager(manager portrepos.SessionManager)
SetSessionManager allows configuration of a custom session manager (for testing)
func (*Server) SetShareRepository ¶
func (s *Server) SetShareRepository(repo portrepos.ShareRepository)
SetShareRepository allows configuration of a custom share repository (for testing)
func (*Server) Shutdown ¶
Shutdown gracefully stops all running sessions and waits for them to terminate
func (*Server) StartMonitoring ¶
func (s *Server) StartMonitoring()
StartMonitoring starts the session monitoring (called after server is fully initialized)