2025-09-25 15:40:25 +02:00
|
|
|
package aibridged
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
|
|
|
|
"storj.io/drpc"
|
|
|
|
|
|
2026-05-22 09:11:37 +02:00
|
|
|
"github.com/coder/coder/v2/coderd/aibridged/proto"
|
2025-09-25 15:40:25 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type Dialer func(ctx context.Context) (DRPCClient, error)
|
|
|
|
|
|
|
|
|
|
type ClientFunc func() (DRPCClient, error)
|
|
|
|
|
|
|
|
|
|
// DRPCClient is the union of various service interfaces the client must support.
|
|
|
|
|
type DRPCClient interface {
|
|
|
|
|
proto.DRPCRecorderClient
|
|
|
|
|
proto.DRPCMCPConfiguratorClient
|
|
|
|
|
proto.DRPCAuthorizerClient
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var _ DRPCClient = &Client{}
|
|
|
|
|
|
|
|
|
|
type Client struct {
|
|
|
|
|
proto.DRPCRecorderClient
|
|
|
|
|
proto.DRPCMCPConfiguratorClient
|
|
|
|
|
proto.DRPCAuthorizerClient
|
|
|
|
|
|
|
|
|
|
Conn drpc.Conn
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *Client) DRPCConn() drpc.Conn {
|
|
|
|
|
return c.Conn
|
|
|
|
|
}
|