app

package
v1.167.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

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

type OAuthCallbackRequest struct {
	Code  string `query:"code"`
	State string `query:"state"`
}

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

type OAuthLoginResponse struct {
	AuthURL string `json:"auth_url"`
	State   string `json:"state"`
}

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 NewRouter

func NewRouter(e *echo.Echo, server *Server) *Router

NewRouter creates a new Router instance

func (*Router) AddCustomHandler

func (r *Router) AddCustomHandler(handler CustomHandler)

AddCustomHandler adds a custom handler to the registry

func (*Router) RegisterRoutes

func (r *Router) RegisterRoutes() error

RegisterRoutes registers all routes

type Server

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

Server represents the HTTP server

func NewServer

func NewServer(cfg *config.Config, verbose bool) *Server

NewServer creates a new server instance

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

func (s *Server) DeleteSessionByID(sessionID string) error

DeleteSessionByID deletes a session by ID

func (*Server) GetConfig

func (s *Server) GetConfig() *config.Config

GetConfig returns the server configuration

func (*Server) GetContainer

func (s *Server) GetContainer() *di.Container

GetContainer returns the DI container

func (*Server) GetEcho

func (s *Server) GetEcho() *echo.Echo

GetEcho returns the Echo instance for external access

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

func (s *Server) Shutdown(timeout time.Duration) error

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)

Jump to

Keyboard shortcuts

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