Documentation
¶
Overview ¶
Package upstream provides the upstream service implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HealthChecker ¶
type HealthChecker interface {
// CheckHealth performs a health check on the upstream service.
//
// Parameters:
// - ctx (context.Context): The check context.
//
// Returns:
// - error: nil if healthy, error if unhealthy.
//
// Errors:
// - Returns error if the service is unhealthy or unreachable.
//
// Side Effects:
// - May send a heartbeat or ping request to the upstream service.
CheckHealth(ctx context.Context) error
}
HealthChecker is an optional interface that Upstreams can implement to provide runtime health status.
Summary: Represents a HealthChecker.
type Upstream ¶
type Upstream interface {
// Shutdown gracefully terminates the upstream service.
//
// Parameters:
// - ctx (context.Context): The context for the request.
//
// Returns:
// - error: An error if the operation fails.
//
// Errors:
// - Returns error if shutdown fails.
//
// Side Effects:
// - Closes network connections and releases resources.
Shutdown(ctx context.Context) error
// Register inspects the upstream service defined by the serviceConfig,
// discovers its capabilities, and registers them.
//
// Parameters:
// - ctx (context.Context): The context for the registration process.
// - serviceConfig (*configv1.UpstreamServiceConfig): The configuration for the upstream service.
// - toolManager (tool.ManagerInterface): The manager where discovered tools will be registered.
// - promptManager (prompt.ManagerInterface): The manager where discovered prompts will be registered.
// - resourceManager (resource.ManagerInterface): The manager where discovered resources will be registered.
// - isReload (bool): Indicates whether this is an initial registration or a reload.
//
// Returns:
// - string: A unique service key.
// - []*configv1.ToolDefinition: A list of discovered tool definitions.
// - []*configv1.ResourceDefinition: A list of discovered resource definitions.
// - error: An error if registration fails.
//
// Errors:
// - Returns error if connection or discovery fails.
//
// Side Effects:
// - Establishes connection to the upstream service.
// - Populates managers with capabilities.
Register(
ctx context.Context,
serviceConfig *configv1.UpstreamServiceConfig,
toolManager tool.ManagerInterface,
promptManager prompt.ManagerInterface,
resourceManager resource.ManagerInterface,
isReload bool,
) (string, []*configv1.ToolDefinition, []*configv1.ResourceDefinition, error)
}
Upstream defines the standard interface for all backend service integrations.
Each implementation of this interface is responsible for discovering and registering its capabilities, such as tools, prompts, and resources, with the appropriate managers.
Summary: Represents a Upstream.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package command provides command execution functionality.
|
Package command provides command execution functionality. |
|
Package factory provides upstream factory functionality.
|
Package factory provides upstream factory functionality. |
|
Package filesystem provides the filesystem upstream implementation.
|
Package filesystem provides the filesystem upstream implementation. |
|
provider
Package provider implements filesystem providers.
|
Package provider implements filesystem providers. |
|
Package graphql provides GraphQL upstream integration.
|
Package graphql provides GraphQL upstream integration. |
|
Package grpc provides gRPC upstream integration.
|
Package grpc provides gRPC upstream integration. |
|
protobufparser
Package protobufparser provides a parser for Protocol Buffers.
|
Package protobufparser provides a parser for Protocol Buffers. |
|
Package mcp provides MCP upstream integration.
|
Package mcp provides MCP upstream integration. |
|
Package openapi provides OpenAPI integration for the upstream service.
|
Package openapi provides OpenAPI integration for the upstream service. |
|
Package sql provides a SQL upstream implementation.
|
Package sql provides a SQL upstream implementation. |
|
Package vector provides vector database upstream implementations.
|
Package vector provides vector database upstream implementations. |
|
Package webrtc provides WebRTC upstream integration.
|
Package webrtc provides WebRTC upstream integration. |
|
Package websocket provides WebSocket upstream integration.
|
Package websocket provides WebSocket upstream integration. |
Click to show internal directories.
Click to hide internal directories.