http

package
v0.0.0-...-c563d8d Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(cfg Config) *Client

func (*Client) CallTool

func (c *Client) CallTool(ctx context.Context, name string, args map[string]any) (types.ToolResult, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) ListTools

func (c *Client) ListTools(ctx context.Context) ([]types.MCPToolMeta, error)

func (*Client) RecentCallSummary

func (c *Client) RecentCallSummary(n int) []mcpdiag.CallRecord

type Config

type Config struct {
	Endpoint             string
	Headers              map[string]string
	ClientName           string
	ClientVersion        string
	CallTimeout          time.Duration
	Retry                int
	Backoff              time.Duration
	MaxReconnects        int
	HeartbeatInterval    time.Duration
	HeartbeatTimeout     time.Duration
	DisableStandaloneSSE bool
	Profile              mcpprofile.Name
	RuntimePolicy        *types.MCPRuntimePolicy
	RuntimeManager       *runtimeconfig.Manager
	EventHandler         types.EventHandler
	RunID                string
	Connect              ConnectFunc
	HTTPClient           *nethttp.Client
	SessionOptions       *mcp.ClientSessionOptions
}

type ConnectFunc

type ConnectFunc func(ctx context.Context) (Session, error)

type OfficialClient

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

func NewOfficialClient

func NewOfficialClient(cfg OfficialConfig) *OfficialClient

func (*OfficialClient) CallTool

func (c *OfficialClient) CallTool(ctx context.Context, name string, args map[string]any) (types.ToolResult, error)

func (*OfficialClient) Close

func (c *OfficialClient) Close() error

func (*OfficialClient) ListTools

func (c *OfficialClient) ListTools(ctx context.Context) ([]types.MCPToolMeta, error)

type OfficialConfig

type OfficialConfig struct {
	Endpoint             string
	Headers              map[string]string
	ClientName           string
	ClientVersion        string
	ClientSessionOptions *mcp.ClientSessionOptions
}

type Session

type Session interface {
	ListTools(ctx context.Context, params *mcp.ListToolsParams) (*mcp.ListToolsResult, error)
	CallTool(ctx context.Context, params *mcp.CallToolParams) (*mcp.CallToolResult, error)
	Close() error
}

Jump to

Keyboard shortcuts

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