mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
In order to allow Coder Agents to use AI Gateway in OSS, we need to rehome the `aibridged`\-related code into the AGPL path. The HTTP API is only registered under enterprise so will still require the AI Governance Add-on to be present in order to use it, whereas Coder Agents uses an in-memory pipe to the same handlers.
502 lines
18 KiB
Go
502 lines
18 KiB
Go
// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
|
|
// protoc-gen-go-drpc version: v0.0.34
|
|
// source: coderd/aibridged/proto/aibridged.proto
|
|
|
|
package proto
|
|
|
|
import (
|
|
context "context"
|
|
errors "errors"
|
|
protojson "google.golang.org/protobuf/encoding/protojson"
|
|
proto "google.golang.org/protobuf/proto"
|
|
drpc "storj.io/drpc"
|
|
drpcerr "storj.io/drpc/drpcerr"
|
|
)
|
|
|
|
type drpcEncoding_File_coderd_aibridged_proto_aibridged_proto struct{}
|
|
|
|
func (drpcEncoding_File_coderd_aibridged_proto_aibridged_proto) Marshal(msg drpc.Message) ([]byte, error) {
|
|
return proto.Marshal(msg.(proto.Message))
|
|
}
|
|
|
|
func (drpcEncoding_File_coderd_aibridged_proto_aibridged_proto) MarshalAppend(buf []byte, msg drpc.Message) ([]byte, error) {
|
|
return proto.MarshalOptions{}.MarshalAppend(buf, msg.(proto.Message))
|
|
}
|
|
|
|
func (drpcEncoding_File_coderd_aibridged_proto_aibridged_proto) Unmarshal(buf []byte, msg drpc.Message) error {
|
|
return proto.Unmarshal(buf, msg.(proto.Message))
|
|
}
|
|
|
|
func (drpcEncoding_File_coderd_aibridged_proto_aibridged_proto) JSONMarshal(msg drpc.Message) ([]byte, error) {
|
|
return protojson.Marshal(msg.(proto.Message))
|
|
}
|
|
|
|
func (drpcEncoding_File_coderd_aibridged_proto_aibridged_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
|
|
return protojson.Unmarshal(buf, msg.(proto.Message))
|
|
}
|
|
|
|
type DRPCRecorderClient interface {
|
|
DRPCConn() drpc.Conn
|
|
|
|
RecordInterception(ctx context.Context, in *RecordInterceptionRequest) (*RecordInterceptionResponse, error)
|
|
RecordInterceptionEnded(ctx context.Context, in *RecordInterceptionEndedRequest) (*RecordInterceptionEndedResponse, error)
|
|
RecordTokenUsage(ctx context.Context, in *RecordTokenUsageRequest) (*RecordTokenUsageResponse, error)
|
|
RecordPromptUsage(ctx context.Context, in *RecordPromptUsageRequest) (*RecordPromptUsageResponse, error)
|
|
RecordToolUsage(ctx context.Context, in *RecordToolUsageRequest) (*RecordToolUsageResponse, error)
|
|
RecordModelThought(ctx context.Context, in *RecordModelThoughtRequest) (*RecordModelThoughtResponse, error)
|
|
}
|
|
|
|
type drpcRecorderClient struct {
|
|
cc drpc.Conn
|
|
}
|
|
|
|
func NewDRPCRecorderClient(cc drpc.Conn) DRPCRecorderClient {
|
|
return &drpcRecorderClient{cc}
|
|
}
|
|
|
|
func (c *drpcRecorderClient) DRPCConn() drpc.Conn { return c.cc }
|
|
|
|
func (c *drpcRecorderClient) RecordInterception(ctx context.Context, in *RecordInterceptionRequest) (*RecordInterceptionResponse, error) {
|
|
out := new(RecordInterceptionResponse)
|
|
err := c.cc.Invoke(ctx, "/proto.Recorder/RecordInterception", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}, in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *drpcRecorderClient) RecordInterceptionEnded(ctx context.Context, in *RecordInterceptionEndedRequest) (*RecordInterceptionEndedResponse, error) {
|
|
out := new(RecordInterceptionEndedResponse)
|
|
err := c.cc.Invoke(ctx, "/proto.Recorder/RecordInterceptionEnded", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}, in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *drpcRecorderClient) RecordTokenUsage(ctx context.Context, in *RecordTokenUsageRequest) (*RecordTokenUsageResponse, error) {
|
|
out := new(RecordTokenUsageResponse)
|
|
err := c.cc.Invoke(ctx, "/proto.Recorder/RecordTokenUsage", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}, in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *drpcRecorderClient) RecordPromptUsage(ctx context.Context, in *RecordPromptUsageRequest) (*RecordPromptUsageResponse, error) {
|
|
out := new(RecordPromptUsageResponse)
|
|
err := c.cc.Invoke(ctx, "/proto.Recorder/RecordPromptUsage", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}, in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *drpcRecorderClient) RecordToolUsage(ctx context.Context, in *RecordToolUsageRequest) (*RecordToolUsageResponse, error) {
|
|
out := new(RecordToolUsageResponse)
|
|
err := c.cc.Invoke(ctx, "/proto.Recorder/RecordToolUsage", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}, in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *drpcRecorderClient) RecordModelThought(ctx context.Context, in *RecordModelThoughtRequest) (*RecordModelThoughtResponse, error) {
|
|
out := new(RecordModelThoughtResponse)
|
|
err := c.cc.Invoke(ctx, "/proto.Recorder/RecordModelThought", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}, in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
type DRPCRecorderServer interface {
|
|
RecordInterception(context.Context, *RecordInterceptionRequest) (*RecordInterceptionResponse, error)
|
|
RecordInterceptionEnded(context.Context, *RecordInterceptionEndedRequest) (*RecordInterceptionEndedResponse, error)
|
|
RecordTokenUsage(context.Context, *RecordTokenUsageRequest) (*RecordTokenUsageResponse, error)
|
|
RecordPromptUsage(context.Context, *RecordPromptUsageRequest) (*RecordPromptUsageResponse, error)
|
|
RecordToolUsage(context.Context, *RecordToolUsageRequest) (*RecordToolUsageResponse, error)
|
|
RecordModelThought(context.Context, *RecordModelThoughtRequest) (*RecordModelThoughtResponse, error)
|
|
}
|
|
|
|
type DRPCRecorderUnimplementedServer struct{}
|
|
|
|
func (s *DRPCRecorderUnimplementedServer) RecordInterception(context.Context, *RecordInterceptionRequest) (*RecordInterceptionResponse, error) {
|
|
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
func (s *DRPCRecorderUnimplementedServer) RecordInterceptionEnded(context.Context, *RecordInterceptionEndedRequest) (*RecordInterceptionEndedResponse, error) {
|
|
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
func (s *DRPCRecorderUnimplementedServer) RecordTokenUsage(context.Context, *RecordTokenUsageRequest) (*RecordTokenUsageResponse, error) {
|
|
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
func (s *DRPCRecorderUnimplementedServer) RecordPromptUsage(context.Context, *RecordPromptUsageRequest) (*RecordPromptUsageResponse, error) {
|
|
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
func (s *DRPCRecorderUnimplementedServer) RecordToolUsage(context.Context, *RecordToolUsageRequest) (*RecordToolUsageResponse, error) {
|
|
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
func (s *DRPCRecorderUnimplementedServer) RecordModelThought(context.Context, *RecordModelThoughtRequest) (*RecordModelThoughtResponse, error) {
|
|
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
type DRPCRecorderDescription struct{}
|
|
|
|
func (DRPCRecorderDescription) NumMethods() int { return 6 }
|
|
|
|
func (DRPCRecorderDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
|
|
switch n {
|
|
case 0:
|
|
return "/proto.Recorder/RecordInterception", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return srv.(DRPCRecorderServer).
|
|
RecordInterception(
|
|
ctx,
|
|
in1.(*RecordInterceptionRequest),
|
|
)
|
|
}, DRPCRecorderServer.RecordInterception, true
|
|
case 1:
|
|
return "/proto.Recorder/RecordInterceptionEnded", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return srv.(DRPCRecorderServer).
|
|
RecordInterceptionEnded(
|
|
ctx,
|
|
in1.(*RecordInterceptionEndedRequest),
|
|
)
|
|
}, DRPCRecorderServer.RecordInterceptionEnded, true
|
|
case 2:
|
|
return "/proto.Recorder/RecordTokenUsage", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return srv.(DRPCRecorderServer).
|
|
RecordTokenUsage(
|
|
ctx,
|
|
in1.(*RecordTokenUsageRequest),
|
|
)
|
|
}, DRPCRecorderServer.RecordTokenUsage, true
|
|
case 3:
|
|
return "/proto.Recorder/RecordPromptUsage", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return srv.(DRPCRecorderServer).
|
|
RecordPromptUsage(
|
|
ctx,
|
|
in1.(*RecordPromptUsageRequest),
|
|
)
|
|
}, DRPCRecorderServer.RecordPromptUsage, true
|
|
case 4:
|
|
return "/proto.Recorder/RecordToolUsage", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return srv.(DRPCRecorderServer).
|
|
RecordToolUsage(
|
|
ctx,
|
|
in1.(*RecordToolUsageRequest),
|
|
)
|
|
}, DRPCRecorderServer.RecordToolUsage, true
|
|
case 5:
|
|
return "/proto.Recorder/RecordModelThought", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return srv.(DRPCRecorderServer).
|
|
RecordModelThought(
|
|
ctx,
|
|
in1.(*RecordModelThoughtRequest),
|
|
)
|
|
}, DRPCRecorderServer.RecordModelThought, true
|
|
default:
|
|
return "", nil, nil, nil, false
|
|
}
|
|
}
|
|
|
|
func DRPCRegisterRecorder(mux drpc.Mux, impl DRPCRecorderServer) error {
|
|
return mux.Register(impl, DRPCRecorderDescription{})
|
|
}
|
|
|
|
type DRPCRecorder_RecordInterceptionStream interface {
|
|
drpc.Stream
|
|
SendAndClose(*RecordInterceptionResponse) error
|
|
}
|
|
|
|
type drpcRecorder_RecordInterceptionStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcRecorder_RecordInterceptionStream) SendAndClose(m *RecordInterceptionResponse) error {
|
|
if err := x.MsgSend(m, drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}); err != nil {
|
|
return err
|
|
}
|
|
return x.CloseSend()
|
|
}
|
|
|
|
type DRPCRecorder_RecordInterceptionEndedStream interface {
|
|
drpc.Stream
|
|
SendAndClose(*RecordInterceptionEndedResponse) error
|
|
}
|
|
|
|
type drpcRecorder_RecordInterceptionEndedStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcRecorder_RecordInterceptionEndedStream) SendAndClose(m *RecordInterceptionEndedResponse) error {
|
|
if err := x.MsgSend(m, drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}); err != nil {
|
|
return err
|
|
}
|
|
return x.CloseSend()
|
|
}
|
|
|
|
type DRPCRecorder_RecordTokenUsageStream interface {
|
|
drpc.Stream
|
|
SendAndClose(*RecordTokenUsageResponse) error
|
|
}
|
|
|
|
type drpcRecorder_RecordTokenUsageStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcRecorder_RecordTokenUsageStream) SendAndClose(m *RecordTokenUsageResponse) error {
|
|
if err := x.MsgSend(m, drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}); err != nil {
|
|
return err
|
|
}
|
|
return x.CloseSend()
|
|
}
|
|
|
|
type DRPCRecorder_RecordPromptUsageStream interface {
|
|
drpc.Stream
|
|
SendAndClose(*RecordPromptUsageResponse) error
|
|
}
|
|
|
|
type drpcRecorder_RecordPromptUsageStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcRecorder_RecordPromptUsageStream) SendAndClose(m *RecordPromptUsageResponse) error {
|
|
if err := x.MsgSend(m, drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}); err != nil {
|
|
return err
|
|
}
|
|
return x.CloseSend()
|
|
}
|
|
|
|
type DRPCRecorder_RecordToolUsageStream interface {
|
|
drpc.Stream
|
|
SendAndClose(*RecordToolUsageResponse) error
|
|
}
|
|
|
|
type drpcRecorder_RecordToolUsageStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcRecorder_RecordToolUsageStream) SendAndClose(m *RecordToolUsageResponse) error {
|
|
if err := x.MsgSend(m, drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}); err != nil {
|
|
return err
|
|
}
|
|
return x.CloseSend()
|
|
}
|
|
|
|
type DRPCRecorder_RecordModelThoughtStream interface {
|
|
drpc.Stream
|
|
SendAndClose(*RecordModelThoughtResponse) error
|
|
}
|
|
|
|
type drpcRecorder_RecordModelThoughtStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcRecorder_RecordModelThoughtStream) SendAndClose(m *RecordModelThoughtResponse) error {
|
|
if err := x.MsgSend(m, drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}); err != nil {
|
|
return err
|
|
}
|
|
return x.CloseSend()
|
|
}
|
|
|
|
type DRPCMCPConfiguratorClient interface {
|
|
DRPCConn() drpc.Conn
|
|
|
|
GetMCPServerConfigs(ctx context.Context, in *GetMCPServerConfigsRequest) (*GetMCPServerConfigsResponse, error)
|
|
GetMCPServerAccessTokensBatch(ctx context.Context, in *GetMCPServerAccessTokensBatchRequest) (*GetMCPServerAccessTokensBatchResponse, error)
|
|
}
|
|
|
|
type drpcMCPConfiguratorClient struct {
|
|
cc drpc.Conn
|
|
}
|
|
|
|
func NewDRPCMCPConfiguratorClient(cc drpc.Conn) DRPCMCPConfiguratorClient {
|
|
return &drpcMCPConfiguratorClient{cc}
|
|
}
|
|
|
|
func (c *drpcMCPConfiguratorClient) DRPCConn() drpc.Conn { return c.cc }
|
|
|
|
func (c *drpcMCPConfiguratorClient) GetMCPServerConfigs(ctx context.Context, in *GetMCPServerConfigsRequest) (*GetMCPServerConfigsResponse, error) {
|
|
out := new(GetMCPServerConfigsResponse)
|
|
err := c.cc.Invoke(ctx, "/proto.MCPConfigurator/GetMCPServerConfigs", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}, in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *drpcMCPConfiguratorClient) GetMCPServerAccessTokensBatch(ctx context.Context, in *GetMCPServerAccessTokensBatchRequest) (*GetMCPServerAccessTokensBatchResponse, error) {
|
|
out := new(GetMCPServerAccessTokensBatchResponse)
|
|
err := c.cc.Invoke(ctx, "/proto.MCPConfigurator/GetMCPServerAccessTokensBatch", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}, in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
type DRPCMCPConfiguratorServer interface {
|
|
GetMCPServerConfigs(context.Context, *GetMCPServerConfigsRequest) (*GetMCPServerConfigsResponse, error)
|
|
GetMCPServerAccessTokensBatch(context.Context, *GetMCPServerAccessTokensBatchRequest) (*GetMCPServerAccessTokensBatchResponse, error)
|
|
}
|
|
|
|
type DRPCMCPConfiguratorUnimplementedServer struct{}
|
|
|
|
func (s *DRPCMCPConfiguratorUnimplementedServer) GetMCPServerConfigs(context.Context, *GetMCPServerConfigsRequest) (*GetMCPServerConfigsResponse, error) {
|
|
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
func (s *DRPCMCPConfiguratorUnimplementedServer) GetMCPServerAccessTokensBatch(context.Context, *GetMCPServerAccessTokensBatchRequest) (*GetMCPServerAccessTokensBatchResponse, error) {
|
|
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
type DRPCMCPConfiguratorDescription struct{}
|
|
|
|
func (DRPCMCPConfiguratorDescription) NumMethods() int { return 2 }
|
|
|
|
func (DRPCMCPConfiguratorDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
|
|
switch n {
|
|
case 0:
|
|
return "/proto.MCPConfigurator/GetMCPServerConfigs", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return srv.(DRPCMCPConfiguratorServer).
|
|
GetMCPServerConfigs(
|
|
ctx,
|
|
in1.(*GetMCPServerConfigsRequest),
|
|
)
|
|
}, DRPCMCPConfiguratorServer.GetMCPServerConfigs, true
|
|
case 1:
|
|
return "/proto.MCPConfigurator/GetMCPServerAccessTokensBatch", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return srv.(DRPCMCPConfiguratorServer).
|
|
GetMCPServerAccessTokensBatch(
|
|
ctx,
|
|
in1.(*GetMCPServerAccessTokensBatchRequest),
|
|
)
|
|
}, DRPCMCPConfiguratorServer.GetMCPServerAccessTokensBatch, true
|
|
default:
|
|
return "", nil, nil, nil, false
|
|
}
|
|
}
|
|
|
|
func DRPCRegisterMCPConfigurator(mux drpc.Mux, impl DRPCMCPConfiguratorServer) error {
|
|
return mux.Register(impl, DRPCMCPConfiguratorDescription{})
|
|
}
|
|
|
|
type DRPCMCPConfigurator_GetMCPServerConfigsStream interface {
|
|
drpc.Stream
|
|
SendAndClose(*GetMCPServerConfigsResponse) error
|
|
}
|
|
|
|
type drpcMCPConfigurator_GetMCPServerConfigsStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcMCPConfigurator_GetMCPServerConfigsStream) SendAndClose(m *GetMCPServerConfigsResponse) error {
|
|
if err := x.MsgSend(m, drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}); err != nil {
|
|
return err
|
|
}
|
|
return x.CloseSend()
|
|
}
|
|
|
|
type DRPCMCPConfigurator_GetMCPServerAccessTokensBatchStream interface {
|
|
drpc.Stream
|
|
SendAndClose(*GetMCPServerAccessTokensBatchResponse) error
|
|
}
|
|
|
|
type drpcMCPConfigurator_GetMCPServerAccessTokensBatchStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcMCPConfigurator_GetMCPServerAccessTokensBatchStream) SendAndClose(m *GetMCPServerAccessTokensBatchResponse) error {
|
|
if err := x.MsgSend(m, drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}); err != nil {
|
|
return err
|
|
}
|
|
return x.CloseSend()
|
|
}
|
|
|
|
type DRPCAuthorizerClient interface {
|
|
DRPCConn() drpc.Conn
|
|
|
|
IsAuthorized(ctx context.Context, in *IsAuthorizedRequest) (*IsAuthorizedResponse, error)
|
|
}
|
|
|
|
type drpcAuthorizerClient struct {
|
|
cc drpc.Conn
|
|
}
|
|
|
|
func NewDRPCAuthorizerClient(cc drpc.Conn) DRPCAuthorizerClient {
|
|
return &drpcAuthorizerClient{cc}
|
|
}
|
|
|
|
func (c *drpcAuthorizerClient) DRPCConn() drpc.Conn { return c.cc }
|
|
|
|
func (c *drpcAuthorizerClient) IsAuthorized(ctx context.Context, in *IsAuthorizedRequest) (*IsAuthorizedResponse, error) {
|
|
out := new(IsAuthorizedResponse)
|
|
err := c.cc.Invoke(ctx, "/proto.Authorizer/IsAuthorized", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}, in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
type DRPCAuthorizerServer interface {
|
|
IsAuthorized(context.Context, *IsAuthorizedRequest) (*IsAuthorizedResponse, error)
|
|
}
|
|
|
|
type DRPCAuthorizerUnimplementedServer struct{}
|
|
|
|
func (s *DRPCAuthorizerUnimplementedServer) IsAuthorized(context.Context, *IsAuthorizedRequest) (*IsAuthorizedResponse, error) {
|
|
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
type DRPCAuthorizerDescription struct{}
|
|
|
|
func (DRPCAuthorizerDescription) NumMethods() int { return 1 }
|
|
|
|
func (DRPCAuthorizerDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
|
|
switch n {
|
|
case 0:
|
|
return "/proto.Authorizer/IsAuthorized", drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return srv.(DRPCAuthorizerServer).
|
|
IsAuthorized(
|
|
ctx,
|
|
in1.(*IsAuthorizedRequest),
|
|
)
|
|
}, DRPCAuthorizerServer.IsAuthorized, true
|
|
default:
|
|
return "", nil, nil, nil, false
|
|
}
|
|
}
|
|
|
|
func DRPCRegisterAuthorizer(mux drpc.Mux, impl DRPCAuthorizerServer) error {
|
|
return mux.Register(impl, DRPCAuthorizerDescription{})
|
|
}
|
|
|
|
type DRPCAuthorizer_IsAuthorizedStream interface {
|
|
drpc.Stream
|
|
SendAndClose(*IsAuthorizedResponse) error
|
|
}
|
|
|
|
type drpcAuthorizer_IsAuthorizedStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcAuthorizer_IsAuthorizedStream) SendAndClose(m *IsAuthorizedResponse) error {
|
|
if err := x.MsgSend(m, drpcEncoding_File_coderd_aibridged_proto_aibridged_proto{}); err != nil {
|
|
return err
|
|
}
|
|
return x.CloseSend()
|
|
}
|