155 lines
6.2 KiB
Go
155 lines
6.2 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{
|
|
// 447 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x5f, 0x6e, 0xd3, 0x40,
|
|
0x10, 0xc6, 0xb5, 0x4d, 0xeb, 0x24, 0x93, 0xba, 0xad, 0x96, 0x00, 0xab, 0x20, 0x41, 0x49, 0x41,
|
|
0x4a, 0x5f, 0x12, 0xfe, 0x5c, 0x00, 0xd1, 0x27, 0x3f, 0x80, 0xa2, 0x14, 0x5e, 0x78, 0xb1, 0x36,
|
|
0xde, 0xa5, 0xac, 0xba, 0xde, 0x5d, 0x76, 0xc7, 0x44, 0xbd, 0x00, 0x12, 0xb7, 0xe0, 0x0c, 0x9c,
|
|
0x87, 0xc3, 0x20, 0xaf, 0x1d, 0x48, 0x4b, 0x5b, 0xf5, 0xcd, 0xdf, 0xf7, 0x9b, 0x19, 0xcf, 0x8c,
|
|
0xc7, 0x90, 0x7a, 0x57, 0xcc, 0x82, 0x72, 0x53, 0xe7, 0x2d, 0x5a, 0xda, 0xf1, 0xae, 0x18, 0xa5,
|
|
0xd6, 0xa1, 0xb2, 0x26, 0x34, 0xde, 0xf8, 0x77, 0x07, 0x8e, 0x32, 0x83, 0xd2, 0x1b, 0xae, 0x4f,
|
|
0xbc, 0xe4, 0x28, 0x4f, 0xb3, 0xf9, 0x9c, 0x7b, 0x54, 0x85, 0x72, 0xdc, 0xe0, 0x42, 0x7e, 0xad,
|
|
0x64, 0x40, 0xfa, 0x18, 0x06, 0x41, 0xb9, 0xbc, 0xe0, 0x5a, 0xe7, 0x4a, 0xb0, 0xf4, 0x90, 0x4c,
|
|
0xfa, 0x8b, 0x7e, 0x50, 0xee, 0x84, 0x6b, 0x9d, 0x09, 0xca, 0xa0, 0xcb, 0x85, 0xf0, 0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