{"modulePath":"github.com/FelineStateMachine/tinyrelay","version":"v0.0.0-20260923223823-92682824e566","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package client\n\nPackage client provides the native Tinyrelay transport used by tinyagent.\n\n## Types\n\n```go\ntype Client struct {\n\tBaseURL, Secret, PubKey string\n\tHTTP                    *http.Client\n}\n```\n\n```go\nfunc New(base, secret string) (*Client, error)\n```\n\n```go\nfunc (c *Client) Download(ctx context.Context, requestPath string) (map[string]any, error)\n```\n\n```go\nfunc (c *Client) Identity() map[string]string\n```\n\n```go\nfunc (c *Client) MCP(ctx context.Context, method string, params map[string]any, info mcp.Implementation) (json.RawMessage, error)\n```\nMCP posts one JSON-RPC request to the relay's stateless MCP endpoint and returns the raw result. Each call carries a fresh NIP-98 proof bound to the URL and body, the mirrored Mcp-\\* headers and the reserved \\_meta fields. The endpoint is /mcp under the client's base URL, so a tenant served under a path prefix is reached at /r/\\\u003cname\u003e/mcp.\n\n```go\nfunc (c *Client) Publish(ctx context.Context, e nostr.Event) (nostr.Event, error)\n```\n\n```go\nfunc (c *Client) Query(ctx context.Context, filters []Filter) ([]nostr.Event, error)\n```\n\n```go\nfunc (c *Client) Request(ctx context.Context, requestPath, method string, body json.RawMessage) (any, error)\n```\n\n```go\nfunc (c *Client) Subscribe(ctx context.Context, name string, filter Filter, sink EventSink) error\n```\n\n```go\nfunc (c *Client) Upload(ctx context.Context, room, filename, typ string, data []byte) (UploadResult, error)\n```\n\n```go\ntype EventSink func(string, nostr.Event)\n```\n\n```go\ntype Filter map[string]any\n```\n\n```go\ntype MCPError struct {\n\tStatus  int\n\tCode    int\n\tMessage string\n\tData    any\n}\n```\nMCPError is a JSON-RPC error answered by the relay's MCP endpoint together with the HTTP status it arrived with. Failures to reach the relay at all are returned as ordinary errors instead.\n\n```go\nfunc (e *MCPError) Error() string\n```\n\n```go\ntype UploadResult map[string]any\n```\n\n","path":"github.com/FelineStateMachine/tinyrelay/tinyagent/client","name":"client","synopsis":"Package client provides the native Tinyrelay transport used by tinyagent.","isRedistributable":true}
