158 lines
6.4 KiB
Go
158 lines
6.4 KiB
Go
// Code generated by protoc-gen-psrpc v0.5.1, 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"
|
|
)
|
|
|
|
var _ = version.PsrpcVersion_0_5
|
|
|
|
// ============================
|
|
// SIPInternal Client Interface
|
|
// ============================
|
|
|
|
type SIPInternalClient interface {
|
|
CreateSIPParticipant(ctx context.Context, topic string, req *InternalCreateSIPParticipantRequest, opts ...psrpc.RequestOption) (*InternalCreateSIPParticipantResponse, error)
|
|
}
|
|
|
|
// ================================
|
|
// SIPInternal ServerImpl Interface
|
|
// ================================
|
|
|
|
type SIPInternalServerImpl interface {
|
|
CreateSIPParticipant(context.Context, *InternalCreateSIPParticipantRequest) (*InternalCreateSIPParticipantResponse, error)
|
|
CreateSIPParticipantAffinity(context.Context, *InternalCreateSIPParticipantRequest) float32
|
|
}
|
|
|
|
// ============================
|
|
// SIPInternal Server Interface
|
|
// ============================
|
|
|
|
type SIPInternalServer interface {
|
|
RegisterCreateSIPParticipantTopic(topic string) error
|
|
DeregisterCreateSIPParticipantTopic(topic 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)
|
|
|
|
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...)
|
|
}
|
|
|
|
// ==================
|
|
// 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)
|
|
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) Shutdown() {
|
|
s.rpc.Close(false)
|
|
}
|
|
|
|
func (s *sIPInternalServer) Kill() {
|
|
s.rpc.Close(true)
|
|
}
|
|
|
|
var psrpcFileDescriptor8 = []byte{
|
|
// 481 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xd1, 0x6e, 0xd3, 0x30,
|
|
0x14, 0x86, 0xe5, 0xb5, 0x6b, 0x9b, 0xd3, 0xa5, 0x2b, 0xa6, 0x03, 0xab, 0x48, 0x50, 0x3a, 0x90,
|
|
0xba, 0x9b, 0x14, 0xb6, 0x17, 0x40, 0xec, 0x2a, 0x17, 0xa0, 0x2a, 0x1d, 0x37, 0xdc, 0x44, 0x6e,
|
|
0x62, 0x86, 0x35, 0xc7, 0x36, 0xb6, 0x43, 0xb5, 0x17, 0x40, 0xe2, 0x92, 0x37, 0xe0, 0x19, 0x78,
|
|
0x42, 0x14, 0x27, 0xdd, 0xba, 0xb1, 0xa1, 0xdd, 0xf5, 0xff, 0xbf, 0xff, 0x9c, 0x1e, 0x1f, 0x9d,
|
|
0x40, 0x68, 0x74, 0x36, 0xb7, 0x5c, 0x47, 0xda, 0x28, 0xa7, 0x70, 0xcb, 0xe8, 0x6c, 0x1c, 0x2a,
|
|
0xed, 0xb8, 0x92, 0xb6, 0xf6, 0xc6, 0x8f, 0x04, 0xff, 0xce, 0x2e, 0xb8, 0x4b, 0xaf, 0x62, 0xd3,
|
|
0x5f, 0x6d, 0x38, 0x8c, 0xa5, 0x63, 0x46, 0x52, 0x71, 0x6a, 0x18, 0x75, 0x6c, 0x19, 0x2f, 0x16,
|
|
0xd4, 0x38, 0x9e, 0x71, 0x4d, 0xa5, 0x4b, 0xd8, 0xb7, 0x92, 0x59, 0x87, 0x9f, 0x43, 0xdf, 0x72,
|
|
0x9d, 0x66, 0x54, 0x88, 0x94, 0xe7, 0x24, 0x9c, 0xa0, 0x59, 0x90, 0x04, 0x96, 0xeb, 0x53, 0x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