Versions in this module Expand all Collapse all v0 v0.3.3 Nov 4, 2026 Changes in this version + const DefaultCallTimeout + const DefaultChunkBytes + const DefaultMaxInFlight + const DefaultMaxResponseBytes + const DefaultPingInterval + const HeaderCredential + const HeaderDeadline + const HeaderLocale + const HeaderPick + const HeaderRequestID + const HostPath + const PairExchangePath + const TunnelPath + const TunnelProtocol + var ErrClosed = errors.New("remote: closed") + var ErrDisconnected = errors.New("remote: tunnel disconnected") + var ErrInvalid = errors.New("remote: invalid request") + var ErrNotFound = errors.New("remote: not found") + var ErrPermissionDenied = errors.New("remote: permission denied") + var ErrStreamNotHandled = errors.New("remote: stream handler declined") + var ErrTooLarge = errors.New("remote: response body too large") + var ErrUnauthorized = errors.New("remote: unauthorized") + var ErrUnavailable = errors.New("remote: unavailable") + func GrantsLAN(grantsOf func(ctx context.Context, pluginID string) (plugins.Grants, error)) func(string) bool + func IsBlocked(err error) bool + type CredentialResolver interface + ResolvePluginCredential func(ctx context.Context, credential string) (string, error) + type CredentialResolverFunc func(ctx context.Context, credential string) (string, error) + func (f CredentialResolverFunc) ResolvePluginCredential(ctx context.Context, credential string) (string, error) + type Factory struct + Credential func(pluginID string) string + Guard *safefetch.Guard + Locale string + Logger *slog.Logger + TrustedLAN func(pluginID string) bool + Tunnel *TunnelServer + func (f *Factory) RuntimeFactory() plugins.RuntimeFactory + type HandlerFunc func(ctx context.Context, req Request) (Response, error) + type Host interface + CatalogGet func(ctx context.Context, pluginID, id string) (json.RawMessage, error) + CatalogSearch func(ctx context.Context, pluginID, query string, limit, offset int) (json.RawMessage, error) + CollectionsUpsert func(ctx context.Context, pluginID string, collection json.RawMessage) error + KVDelete func(ctx context.Context, pluginID, key string) error + KVGet func(ctx context.Context, pluginID, key string) ([]byte, bool, error) + KVList func(ctx context.Context, pluginID, prefix string) ([]string, error) + KVPut func(ctx context.Context, pluginID, key string, value []byte) error + Log func(ctx context.Context, pluginID, level, msg string, attrs map[string]any) error + NotifyOwner func(ctx context.Context, pluginID, text string) error + SetWatchState func(ctx context.Context, pluginID string, viewerID int64, titleID string, ...) error + Settings func(ctx context.Context, pluginID string) (map[string]any, error) + ViewerGranted func(ctx context.Context, pluginID string) (json.RawMessage, error) + ViewerHistory func(ctx context.Context, pluginID string, viewerID int64, limit, offset int) (json.RawMessage, error) + type HostAdapter struct + HostFor func(pluginID string) plugins.Host + SettingsWithSecrets func(ctx context.Context, pluginID string) (map[string]any, error) + func (a HostAdapter) CatalogGet(ctx context.Context, pluginID, id string) (json.RawMessage, error) + func (a HostAdapter) CatalogSearch(ctx context.Context, pluginID, query string, limit, offset int) (json.RawMessage, error) + func (a HostAdapter) CollectionsUpsert(ctx context.Context, pluginID string, collection json.RawMessage) error + func (a HostAdapter) KVDelete(ctx context.Context, pluginID, key string) error + func (a HostAdapter) KVGet(ctx context.Context, pluginID, key string) ([]byte, bool, error) + func (a HostAdapter) KVList(ctx context.Context, pluginID, prefix string) ([]string, error) + func (a HostAdapter) KVPut(ctx context.Context, pluginID, key string, value []byte) error + func (a HostAdapter) Log(ctx context.Context, pluginID, level, msg string, attrs map[string]any) error + func (a HostAdapter) NotifyOwner(ctx context.Context, pluginID, text string) error + func (a HostAdapter) SetWatchState(ctx context.Context, pluginID string, viewerID int64, titleID string, ...) error + func (a HostAdapter) Settings(ctx context.Context, pluginID string) (map[string]any, error) + func (a HostAdapter) ViewerGranted(ctx context.Context, pluginID string) (json.RawMessage, error) + func (a HostAdapter) ViewerHistory(ctx context.Context, pluginID string, viewerID int64, limit, offset int) (json.RawMessage, error) + type HostHandler struct + func NewHostHandler(opts HostOptions) *HostHandler + func (h *HostHandler) Mount(mux *http.ServeMux) + func (h *HostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + type HostOptions struct + Auth CredentialResolver + Host Host + Logger *slog.Logger + type Pairing struct + Exists func(context.Context, string) bool + TunnelURL func(*http.Request) string + func NewPairing(db *sql.DB, grants *identity.Grants, ...) *Pairing + func (p *Pairing) Exchange(w http.ResponseWriter, r *http.Request) + func (p *Pairing) WrapOwner(next http.Handler) http.Handler + type Request struct + Body []byte + Headers map[string][]string + Locale string + Method string + Path string + Query map[string][]string + RequestID string + Timeout time.Duration + type Response struct + Body []byte + Headers map[string][]string + Status int + func (r Response) Header(name string) string + type Runtime interface + Call func(ctx context.Context, req Request) (Response, error) + Close func() error + type StaticCredentials map[string]string + func (s StaticCredentials) ResolvePluginCredential(_ context.Context, credential string) (string, error) + type StreamCall interface + CallStream func(ctx context.Context, req plugins.Request) (plugins.Response, io.ReadCloser, error) + type StreamHandlerFunc func(ctx context.Context, req Request) (*StreamResponse, error) + func FileHandler(root string) StreamHandlerFunc + type StreamResponse struct + Body io.ReadCloser + Headers map[string][]string + Status int + func (s *StreamResponse) Header(name string) string + type Streamer interface + CallStream func(ctx context.Context, req Request) (*StreamResponse, error) + type TunnelClient struct + func NewTunnelClient(opts TunnelClientOptions) (*TunnelClient, error) + func (c *TunnelClient) Serve(ctx context.Context) error + func (c *TunnelClient) ServeOnce(ctx context.Context) error + type TunnelClientOptions struct + Credential string + Handler HandlerFunc + Logger *slog.Logger + Plugin string + StreamHandler StreamHandlerFunc + URL string + type TunnelOptions struct + Auth CredentialResolver + ChunkBytes int + Locale string + Logger *slog.Logger + MaxInFlight int + MaxResponseBytes int64 + PingInterval time.Duration + Timeout time.Duration + type TunnelServer struct + func NewTunnelServer(opts TunnelOptions) *TunnelServer + func (s *TunnelServer) Close() error + func (s *TunnelServer) Connected() []string + func (s *TunnelServer) Disconnect(pluginID string) + func (s *TunnelServer) Handler() http.Handler + func (s *TunnelServer) IsConnected(pluginID string) bool + func (s *TunnelServer) RuntimeFor(pluginID string) Runtime + type URLClient struct + func NewURLClient(opts URLOptions) (*URLClient, error) + func (c *URLClient) Base() string + func (c *URLClient) Call(ctx context.Context, req Request) (Response, error) + func (c *URLClient) CallStream(ctx context.Context, req Request) (*StreamResponse, error) + func (c *URLClient) Close() error + type URLOptions struct + AllowPublicRedirects bool + Base string + BaseTransport http.RoundTripper + Credential string + Guard *safefetch.Guard + Locale string + Logger *slog.Logger + MaxResponseBytes int64 + MaxStreamBytes int64 + Plain bool + Timeout time.Duration + TrustedOrigin string