server

package
v0.0.0-...-b8af129 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentServiceHandler

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

AgentServiceHandler implements the AgentService ConnectRPC interface

func NewAgentServiceHandler

func NewAgentServiceHandler(opts ...AgentServiceHandlerOption) *AgentServiceHandler

NewAgentServiceHandler creates a new AgentService handler

func (*AgentServiceHandler) DeleteAgent

DeleteAgent deletes an agent

func (*AgentServiceHandler) GetAgent

GetAgent retrieves an agent by ID

func (*AgentServiceHandler) GetHealth

GetHealth returns the health status of the service

func (*AgentServiceHandler) InvokeAgent

InvokeAgent executes an agent with the provided payload

func (*AgentServiceHandler) InvokeAgentStream

InvokeAgentStream executes an agent with the provided payload and returns a streaming response

func (*AgentServiceHandler) ListAgents

ListAgents lists registered agents with pagination

func (*AgentServiceHandler) RegisterAgent

RegisterAgent registers a new agent

func (*AgentServiceHandler) UpdateAgent

UpdateAgent updates an existing agent

type AgentServiceHandlerOption

type AgentServiceHandlerOption func(*AgentServiceHandler)

AgentServiceHandlerOption is a functional option for configuring AgentServiceHandler

func WithAgentServiceBackend

func WithAgentServiceBackend(backend backend.ContainerBackend) AgentServiceHandlerOption

WithAgentServiceBackend sets the backend

func WithAgentServiceConfig

func WithAgentServiceConfig(config *config.Config) AgentServiceHandlerOption

WithAgentServiceConfig sets the config

func WithAgentServiceLogger

func WithAgentServiceLogger(logger *slog.Logger) AgentServiceHandlerOption

WithAgentServiceLogger sets the logger

func WithAgentServiceRegistry

func WithAgentServiceRegistry(registry *storage.AgentRegistry) AgentServiceHandlerOption

WithAgentServiceRegistry sets the agent registry

func WithAgentServiceSessionManager

func WithAgentServiceSessionManager(manager *storage.SessionManager) AgentServiceHandlerOption

WithAgentServiceSessionManager sets the session manager

type DistributedAgentServiceHandler

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

DistributedAgentServiceHandler implements the AgentService interface for distributed mode

func NewDistributedAgentServiceHandler

func NewDistributedAgentServiceHandler(opts ...DistributedAgentServiceOption) *DistributedAgentServiceHandler

NewDistributedAgentServiceHandler creates a new distributed agent service handler

func (*DistributedAgentServiceHandler) DeleteAgent

func (*DistributedAgentServiceHandler) GetAgent

func (*DistributedAgentServiceHandler) GetHealth

Health check - Check both local registry and orchestrator

func (*DistributedAgentServiceHandler) InvokeAgent

Agent Execution - This is forwarded to the orchestrator

func (*DistributedAgentServiceHandler) ListAgents

func (*DistributedAgentServiceHandler) RegisterAgent

Agent Management Methods - These work locally as they manage agent registration

func (*DistributedAgentServiceHandler) UpdateAgent

type DistributedAgentServiceOption

type DistributedAgentServiceOption func(*DistributedAgentServiceHandler)

DistributedAgentServiceOption is a functional option for configuring DistributedAgentServiceHandler

func WithDistributedAgentServiceConfig

func WithDistributedAgentServiceConfig(config *config.Config) DistributedAgentServiceOption

WithDistributedAgentServiceConfig sets the configuration

func WithDistributedAgentServiceLogger

func WithDistributedAgentServiceLogger(logger *slog.Logger) DistributedAgentServiceOption

WithDistributedAgentServiceLogger sets the logger

func WithDistributedAgentServiceOrchestratorClient

func WithDistributedAgentServiceOrchestratorClient(client *orchestrator.Client) DistributedAgentServiceOption

WithDistributedAgentServiceOrchestratorClient sets the orchestrator client

func WithDistributedAgentServiceRegistry

func WithDistributedAgentServiceRegistry(registry *storage.AgentRegistry) DistributedAgentServiceOption

WithDistributedAgentServiceRegistry sets the agent registry

type ErrorInterceptor

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

ErrorInterceptor handles errors and converts them to appropriate Connect errors

func NewErrorInterceptor

func NewErrorInterceptor(logger *slog.Logger) *ErrorInterceptor

func (*ErrorInterceptor) WrapStreamingClient

func (*ErrorInterceptor) WrapStreamingHandler

func (*ErrorInterceptor) WrapUnary

func (e *ErrorInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc

type LoggingInterceptor

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

LoggingInterceptor logs requests and responses

func NewLoggingInterceptor

func NewLoggingInterceptor(logger *slog.Logger) *LoggingInterceptor

func (*LoggingInterceptor) WrapStreamingClient

func (*LoggingInterceptor) WrapStreamingHandler

func (*LoggingInterceptor) WrapUnary

type Server

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

Server represents the OAR HTTP server

func NewServer

func NewServer(cfg *config.Config, logger *slog.Logger, opts ...ServerOption) (*Server, error)

NewServer creates a new OAR server

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start starts the server and background services

type ServerOption

type ServerOption func(*Server) error

ServerOption is a functional option for configuring Server

func WithAgentRegistry

func WithAgentRegistry(registry *storage.AgentRegistry) ServerOption

WithAgentRegistry sets a custom agent registry

func WithOrchestratorFactory

func WithOrchestratorFactory(factory *orchestrator.Factory) ServerOption

WithOrchestratorFactory sets a custom orchestrator factory

type StandaloneAgentServiceHandler

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

StandaloneAgentServiceHandler implements the AgentService interface for standalone mode It handles agent registry operations locally and forwards container operations to the in-process orchestrator service

func NewStandaloneAgentServiceHandler

func NewStandaloneAgentServiceHandler(opts ...StandaloneAgentServiceHandlerOption) *StandaloneAgentServiceHandler

NewStandaloneAgentServiceHandler creates a new StandaloneAgentServiceHandler

func (*StandaloneAgentServiceHandler) DeleteAgent

DeleteAgent deletes an agent (handled locally)

func (*StandaloneAgentServiceHandler) GetAgent

GetAgent retrieves an agent by ID (handled locally)

func (*StandaloneAgentServiceHandler) GetHealth

GetHealth returns the health status combining agent registry and orchestrator health

func (*StandaloneAgentServiceHandler) InvokeAgent

InvokeAgent forwards agent execution to the in-process orchestrator

func (*StandaloneAgentServiceHandler) ListAgents

ListAgents lists registered agents with pagination (handled locally)

func (*StandaloneAgentServiceHandler) RegisterAgent

RegisterAgent registers a new agent (handled locally)

func (*StandaloneAgentServiceHandler) UpdateAgent

UpdateAgent updates an existing agent (handled locally)

type StandaloneAgentServiceHandlerOption

type StandaloneAgentServiceHandlerOption func(*StandaloneAgentServiceHandler)

StandaloneAgentServiceHandlerOption is a functional option for configuring StandaloneAgentServiceHandler

func WithStandaloneAgentServiceConfig

func WithStandaloneAgentServiceConfig(config *config.Config) StandaloneAgentServiceHandlerOption

WithStandaloneAgentServiceConfig sets the config

func WithStandaloneAgentServiceLogger

func WithStandaloneAgentServiceLogger(logger *slog.Logger) StandaloneAgentServiceHandlerOption

WithStandaloneAgentServiceLogger sets the logger

func WithStandaloneAgentServiceOrchestrator

func WithStandaloneAgentServiceOrchestrator(service *orchestrator.Service) StandaloneAgentServiceHandlerOption

WithStandaloneAgentServiceOrchestrator sets the orchestrator service

func WithStandaloneAgentServiceRegistry

func WithStandaloneAgentServiceRegistry(registry *storage.AgentRegistry) StandaloneAgentServiceHandlerOption

WithStandaloneAgentServiceRegistry sets the agent registry

type UnifiedAgentServiceHandler

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

UnifiedAgentServiceHandler implements the AgentService interface using the separated architecture Agent management operations are handled locally, while container operations are forwarded to the orchestrator using the OrchestratorServiceHandler

func NewUnifiedAgentServiceHandler

func NewUnifiedAgentServiceHandler(opts ...UnifiedAgentServiceHandlerOption) *UnifiedAgentServiceHandler

NewUnifiedAgentServiceHandler creates a new UnifiedAgentServiceHandler

func (*UnifiedAgentServiceHandler) DeleteAgent

DeleteAgent deletes an agent (handled locally)

func (*UnifiedAgentServiceHandler) GetAgent

GetAgent retrieves an agent by ID (handled locally)

func (*UnifiedAgentServiceHandler) GetHealth

GetHealth returns the health status combining agent registry and orchestrator health

func (*UnifiedAgentServiceHandler) InvokeAgent

InvokeAgent forwards agent execution to the orchestrator handler

func (*UnifiedAgentServiceHandler) InvokeAgentStream

InvokeAgentStream executes an agent with the provided payload and returns a streaming response

func (*UnifiedAgentServiceHandler) ListAgents

ListAgents lists registered agents with pagination (handled locally)

func (*UnifiedAgentServiceHandler) RegisterAgent

RegisterAgent registers a new agent (handled locally)

func (*UnifiedAgentServiceHandler) UpdateAgent

UpdateAgent updates an existing agent (handled locally)

type UnifiedAgentServiceHandlerOption

type UnifiedAgentServiceHandlerOption func(*UnifiedAgentServiceHandler)

UnifiedAgentServiceHandlerOption is a functional option for configuring UnifiedAgentServiceHandler

func WithUnifiedAgentServiceConfig

func WithUnifiedAgentServiceConfig(config *config.Config) UnifiedAgentServiceHandlerOption

WithUnifiedAgentServiceConfig sets the config

func WithUnifiedAgentServiceLogger

func WithUnifiedAgentServiceLogger(logger *slog.Logger) UnifiedAgentServiceHandlerOption

WithUnifiedAgentServiceLogger sets the logger

func WithUnifiedAgentServiceOrchestratorHandler

func WithUnifiedAgentServiceOrchestratorHandler(handler orchestrator.OrchestratorServiceHandler) UnifiedAgentServiceHandlerOption

WithUnifiedAgentServiceOrchestratorHandler sets the orchestrator handler

func WithUnifiedAgentServiceRegistry

func WithUnifiedAgentServiceRegistry(registry *storage.AgentRegistry) UnifiedAgentServiceHandlerOption

WithUnifiedAgentServiceRegistry sets the agent registry

Jump to

Keyboard shortcuts

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