proxy

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package proxy provides a conversation-scoped proxy for Fluxor services.

It implements github.com/viant/fluxor/model/types.Service and routes each method call to a per-conversation instance of the underlying service. The conversation ID is read from context via github.com/viant/agently/genai/conversation.

Usage:

base, _ := newYourService("")          // prototype for Name/Methods
svc  := proxy.New(base, func(id string) (types.Service, error) {
    return newYourService(id)            // build per-conversation instance
}, conversation)
// svc can now be registered – method execution is routed by conv ID.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(base types.Service, conversation convcli.Client) types.Service

New constructs a conversation-scoped proxy around the provided base service. The base service supplies Name() and Methods(). Executions are dispatched to a per-conversation service built on first use via the supplied Factory.

Types

type Proxy

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

Proxy is a conversation-aware Service that delegates to per-conversation instances of the underlying service created by Factory.

func (*Proxy) Method

func (p *Proxy) Method(name string) (types.Executable, error)

Method returns an executable that routes the call to the service instance bound to the conversation ID present in ctx. When no conversation ID is present, the base service is used.

func (*Proxy) Methods

func (p *Proxy) Methods() types.Signatures

Methods delegates to the base prototype service.

func (*Proxy) Name

func (p *Proxy) Name() string

Name delegates to the base prototype service.

Jump to

Keyboard shortcuts

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