Files
protocol/rpc/sip.psrpc.go
2025-04-07 22:24:48 +03:00

217 lines
11 KiB
Go

// Code generated by protoc-gen-psrpc v0.6.0, DO NOT EDIT.
// source: rpc/sip.proto
package rpc
import (
"context"
"github.com/livekit/psrpc"
"github.com/livekit/psrpc/pkg/client"
"github.com/livekit/psrpc/pkg/info"
"github.com/livekit/psrpc/pkg/rand"
"github.com/livekit/psrpc/pkg/server"
"github.com/livekit/psrpc/version"
)
import google_protobuf "google.golang.org/protobuf/types/known/emptypb"
var _ = version.PsrpcVersion_0_6
// ============================
// SIPInternal Client Interface
// ============================
type SIPInternalClient interface {
CreateSIPParticipant(ctx context.Context, topic string, req *InternalCreateSIPParticipantRequest, opts ...psrpc.RequestOption) (*InternalCreateSIPParticipantResponse, error)
TransferSIPParticipant(ctx context.Context, sipCallId string, req *InternalTransferSIPParticipantRequest, opts ...psrpc.RequestOption) (*google_protobuf.Empty, error)
// Close immediately, without waiting for pending RPCs
Close()
}
// ================================
// SIPInternal ServerImpl Interface
// ================================
type SIPInternalServerImpl interface {
CreateSIPParticipant(context.Context, *InternalCreateSIPParticipantRequest) (*InternalCreateSIPParticipantResponse, error)
CreateSIPParticipantAffinity(context.Context, *InternalCreateSIPParticipantRequest) float32
TransferSIPParticipant(context.Context, *InternalTransferSIPParticipantRequest) (*google_protobuf.Empty, error)
}
// ============================
// SIPInternal Server Interface
// ============================
type SIPInternalServer interface {
RegisterCreateSIPParticipantTopic(topic string) error
DeregisterCreateSIPParticipantTopic(topic string)
RegisterTransferSIPParticipantTopic(sipCallId string) error
DeregisterTransferSIPParticipantTopic(sipCallId string)
// Close and wait for pending RPCs to complete
Shutdown()
// Close immediately, without waiting for pending RPCs
Kill()
}
// ==================
// SIPInternal Client
// ==================
type sIPInternalClient struct {
client *client.RPCClient
}
// NewSIPInternalClient creates a psrpc client that implements the SIPInternalClient interface.
func NewSIPInternalClient(bus psrpc.MessageBus, opts ...psrpc.ClientOption) (SIPInternalClient, error) {
sd := &info.ServiceDefinition{
Name: "SIPInternal",
ID: rand.NewClientID(),
}
sd.RegisterMethod("CreateSIPParticipant", true, false, true, false)
sd.RegisterMethod("TransferSIPParticipant", false, false, true, true)
rpcClient, err := client.NewRPCClient(sd, bus, opts...)
if err != nil {
return nil, err
}
return &sIPInternalClient{
client: rpcClient,
}, nil
}
func (c *sIPInternalClient) CreateSIPParticipant(ctx context.Context, topic string, req *InternalCreateSIPParticipantRequest, opts ...psrpc.RequestOption) (*InternalCreateSIPParticipantResponse, error) {
return client.RequestSingle[*InternalCreateSIPParticipantResponse](ctx, c.client, "CreateSIPParticipant", []string{topic}, req, opts...)
}
func (c *sIPInternalClient) TransferSIPParticipant(ctx context.Context, sipCallId string, req *InternalTransferSIPParticipantRequest, opts ...psrpc.RequestOption) (*google_protobuf.Empty, error) {
return client.RequestSingle[*google_protobuf.Empty](ctx, c.client, "TransferSIPParticipant", []string{sipCallId}, req, opts...)
}
func (s *sIPInternalClient) Close() {
s.client.Close()
}
// ==================
// SIPInternal Server
// ==================
type sIPInternalServer struct {
svc SIPInternalServerImpl
rpc *server.RPCServer
}
// NewSIPInternalServer builds a RPCServer that will route requests
// to the corresponding method in the provided svc implementation.
func NewSIPInternalServer(svc SIPInternalServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (SIPInternalServer, error) {
sd := &info.ServiceDefinition{
Name: "SIPInternal",
ID: rand.NewServerID(),
}
s := server.NewRPCServer(sd, bus, opts...)
sd.RegisterMethod("CreateSIPParticipant", true, false, true, false)
sd.RegisterMethod("TransferSIPParticipant", false, false, true, true)
return &sIPInternalServer{
svc: svc,
rpc: s,
}, nil
}
func (s *sIPInternalServer) RegisterCreateSIPParticipantTopic(topic string) error {
return server.RegisterHandler(s.rpc, "CreateSIPParticipant", []string{topic}, s.svc.CreateSIPParticipant, s.svc.CreateSIPParticipantAffinity)
}
func (s *sIPInternalServer) DeregisterCreateSIPParticipantTopic(topic string) {
s.rpc.DeregisterHandler("CreateSIPParticipant", []string{topic})
}
func (s *sIPInternalServer) RegisterTransferSIPParticipantTopic(sipCallId string) error {
return server.RegisterHandler(s.rpc, "TransferSIPParticipant", []string{sipCallId}, s.svc.TransferSIPParticipant, nil)
}
func (s *sIPInternalServer) DeregisterTransferSIPParticipantTopic(sipCallId string) {
s.rpc.DeregisterHandler("TransferSIPParticipant", []string{sipCallId})
}
func (s *sIPInternalServer) Shutdown() {
s.rpc.Close(false)
}
func (s *sIPInternalServer) Kill() {
s.rpc.Close(true)
}
var psrpcFileDescriptor10 = []byte{
// 991 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcd, 0x72, 0xdb, 0x36,
0x10, 0x1e, 0x5a, 0xfe, 0x5d, 0x59, 0x3f, 0x86, 0x2c, 0x07, 0xa6, 0x9b, 0x44, 0x75, 0x9a, 0x19,
0xa5, 0x07, 0xba, 0x75, 0xa6, 0xd3, 0x4e, 0x0e, 0x9d, 0x3a, 0x8e, 0x3d, 0xd1, 0x21, 0x8d, 0x2b,
0x2b, 0x97, 0x5e, 0x38, 0x10, 0x09, 0xdb, 0xa8, 0x49, 0x82, 0x05, 0xc0, 0x28, 0xea, 0x1b, 0xe4,
0x2d, 0xfa, 0x0c, 0x79, 0x88, 0x3e, 0x47, 0xdf, 0xa3, 0x97, 0x0e, 0x00, 0xd2, 0xa6, 0x65, 0x29,
0x95, 0xa6, 0x37, 0xee, 0x7e, 0xbb, 0x1f, 0xb0, 0xab, 0xdd, 0x0f, 0x82, 0x9a, 0x48, 0x83, 0x03,
0xc9, 0x52, 0x2f, 0x15, 0x5c, 0x71, 0x54, 0x11, 0x69, 0xe0, 0xee, 0x5d, 0x72, 0x7e, 0x19, 0xd1,
0x03, 0xe3, 0x1a, 0x66, 0x17, 0x07, 0x34, 0x4e, 0xd5, 0xd8, 0x46, 0xb8, 0x8f, 0x26, 0xc1, 0x30,
0x13, 0x44, 0x31, 0x9e, 0xe4, 0x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