* update psrpc * generated protobuf * client * gen --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
202 lines
9.4 KiB
Go
202 lines
9.4 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{
|
|
// 744 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x41, 0x4f, 0xeb, 0x46,
|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