Documentation
¶
Overview ¶
Package websocket provides WebSocket upstream integration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Pool ¶
type Pool = pool.Pool[*client.WebsocketClientWrapper]
Pool is a type alias for a pool of WebSocket client connections. It simplifies the type signature for WebSocket connection pools.
func NewPool ¶
NewPool creates a new connection pool for WebSocket clients. It configures the pool with a factory function that establishes new WebSocket connections to the specified address.
maxSize is the maximum number of connections the pool can hold. idleTimeout is the duration after which an idle connection may be closed. address is the target URL of the WebSocket server. It returns a new WebSocket client pool or an error if the pool cannot be created.
type Upstream ¶
type Upstream struct {
// contains filtered or unexported fields
}
Upstream implements the upstream.Upstream interface for services that are exposed via a WebSocket connection. It manages a connection pool and registers tools based on the service configuration.
func (*Upstream) Register ¶
func (u *Upstream) Register( ctx context.Context, serviceConfig *configv1.UpstreamServiceConfig, toolManager tool.ManagerInterface, promptManager prompt.ManagerInterface, resourceManager resource.ManagerInterface, isReload bool, ) (string, []*configv1.ToolDefinition, []*configv1.ResourceDefinition, error)
Register processes the configuration for a WebSocket service. It creates a connection pool and registers tools for each call definition specified in the configuration.