upstream

package
v0.0.0-...-be7b520 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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.
	//
	// Summary: Checks the health of the upstream.
	//
	// Parameters:
	//   - ctx: context.Context. The check context.
	//
	// Returns:
	//   - error: nil if healthy, error if unhealthy.
	CheckHealth(ctx context.Context) error
}

HealthChecker is an optional interface that Upstreams can implement to provide runtime health status.

Summary: Interface for health checking capabilities.

type Upstream

type Upstream interface {
	// Shutdown gracefully terminates the upstream service.
	//
	// Summary: Terminates the upstream connection.
	//
	// Parameters:
	//   - ctx: context.Context. The context for the request.
	//
	// Returns:
	//   - error: An error if the operation fails.
	Shutdown(ctx context.Context) error

	// Register inspects the upstream service defined by the serviceConfig,
	// discovers its capabilities, and registers them.
	//
	// Summary: Connects to upstream and registers capabilities.
	//
	// 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.
	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: Interface for backend service integrations.

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.

Jump to

Keyboard shortcuts

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