Documentation
¶
Index ¶
- type UtcpClient
- func (c *UtcpClient) CallTool(ctx context.Context, toolName string, args map[string]any) (any, error)
- func (c *UtcpClient) CallToolStream(ctx context.Context, toolName string, args map[string]any) (transports.StreamResult, error)
- func (c *UtcpClient) DeregisterToolProvider(ctx context.Context, providerName string) error
- func (u *UtcpClient) GetTransports() map[string]ClientTransport
- func (c *UtcpClient) RegisterToolProvider(ctx context.Context, prov Provider) ([]Tool, error)
- func (c *UtcpClient) SearchTools(query string, limit int) ([]Tool, error)
- type UtcpClientConfig
- type UtcpClientInterface
- type UtcpDotEnv
- type UtcpVariableNotFound
- type UtcpVariablesConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UtcpClient ¶
type UtcpClient struct {
// contains filtered or unexported fields
}
UtcpClient holds all state and implements UtcpClientInterface.
func (*UtcpClient) CallTool ¶
func (c *UtcpClient) CallTool( ctx context.Context, toolName string, args map[string]any, ) (any, error)
--- HOT PATH: CallTool with lock-free fast lookup ---
func (*UtcpClient) CallToolStream ¶ added in v1.5.8
func (c *UtcpClient) CallToolStream( ctx context.Context, toolName string, args map[string]any, ) (transports.StreamResult, error)
func (*UtcpClient) DeregisterToolProvider ¶
func (c *UtcpClient) DeregisterToolProvider(ctx context.Context, providerName string) error
func (*UtcpClient) GetTransports ¶ added in v1.5.1
func (u *UtcpClient) GetTransports() map[string]ClientTransport
func (*UtcpClient) RegisterToolProvider ¶
func (c *UtcpClient) RegisterToolProvider( ctx context.Context, prov Provider, ) ([]Tool, error)
RegisterToolProvider applies variable substitution, picks the right transport, and registers tools.
func (*UtcpClient) SearchTools ¶
func (c *UtcpClient) SearchTools(query string, limit int) ([]Tool, error)
type UtcpClientConfig ¶
type UtcpClientConfig struct { // Variables explicitly passed in (takes precedence) Variables map[string]string // Optional path to a providers‐definition file ProvidersFilePath string // A list of providers to load from (e.g. .env, AWS SSM, Vault, etc.) LoadVariablesFrom []UtcpVariablesConfig }
UtcpClientConfig holds your resolved variables and provider settings.
func NewClientConfig ¶
func NewClientConfig() *UtcpClientConfig
NewClientConfig constructs a config with sensible defaults.
type UtcpClientInterface ¶
type UtcpClientInterface interface { RegisterToolProvider(ctx context.Context, prov Provider) ([]Tool, error) DeregisterToolProvider(ctx context.Context, providerName string) error CallTool(ctx context.Context, toolName string, args map[string]any) (any, error) SearchTools(query string, limit int) ([]Tool, error) GetTransports() map[string]ClientTransport CallToolStream(ctx context.Context, toolName string, args map[string]any) (transports.StreamResult, error) }
UtcpClientInterface defines the public API.
func NewUTCPClient ¶
func NewUTCPClient( ctx context.Context, cfg *UtcpClientConfig, repo ToolRepository, strat ToolSearchStrategy, ) (UtcpClientInterface, error)
NewUTCPClient constructs a new client, loading providers if configured.
type UtcpDotEnv ¶
type UtcpDotEnv struct {
EnvFilePath string
}
UtcpDotEnv implements UtcpVariablesConfig by loading a .env file.
func NewDotEnv ¶
func NewDotEnv(path string) *UtcpDotEnv
type UtcpVariableNotFound ¶
type UtcpVariableNotFound struct {
VariableName string
}
UtcpVariableNotFound is returned when a requested variable isn't present.
func (*UtcpVariableNotFound) Error ¶
func (e *UtcpVariableNotFound) Error() string
type UtcpVariablesConfig ¶
type UtcpVariablesConfig interface { // Load returns all variables available from this provider. Load() (map[string]string, error) // Get returns a single variable value or an error if not present. Get(key string) (string, error) }
UtcpVariablesConfig is the interface for any variable‐loading strategy.
Directories
¶
Path | Synopsis |
---|---|
examples
|
|
mcp_http_client
command
|
|
src
|
|
transports/sse
sse_client_transport.go
|
sse_client_transport.go |