* fix rpc package * generated protobuf --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
152 lines
5.9 KiB
Go
152 lines
5.9 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{
|
|
// 389 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xbf, 0xce, 0xd3, 0x30,
|
|
0x14, 0xc5, 0xe5, 0x7e, 0xdf, 0x97, 0xb6, 0xb7, 0x0d, 0x42, 0xa6, 0x80, 0x55, 0x06, 0x4a, 0x0b,
|
|
0x52, 0x59, 0x12, 0xfe, 0xbc, 0x00, 0x82, 0x29, 0x0b, 0xaa, 0x52, 0x58, 0x58, 0x22, 0xd7, 0x31,
|
|
0xc5, 0xaa, 0x63, 0x1b, 0xdb, 0x21, 0xea, 0xc6, 0x84, 0xc4, 0xeb, 0xf0, 0x40, 0x3c, 0x0b, 0x8a,
|
|
0xd3, 0x02, 0x95, 0x28, 0xea, 0x96, 0x73, 0x7e, 0xd7, 0xba, 0xe7, 0x44, 0x17, 0x62, 0x6b, 0x58,
|
|
0xea, 0x84, 0x49, 0x8c, 0xd5, 0x5e, 0xe3, 0x2b, 0x6b, 0xd8, 0x34, 0xd6, 0xc6, 0x0b, 0xad, 0x5c,
|
|
0xe7, 0xcd, 0x7f, 0xf6, 0x60, 0x91, 0x29, 0xcf, 0xad, 0xa2, 0xf2, 0x8d, 0xe5, 0xd4, 0xf3, 0x75,
|
|
0xb6, 0x5a, 0x51, 0xeb, 0x05, 0x13, 0x86, 0x2a, 0x9f, 0xf3, 0xcf, 0x35, 0x77, 0x1e, 0x13, 0xe8,
|
|
0xd3, 0xb2, 0xb4, 0xdc, 0x39, 0xd2, 0x9b, 0xa1, 0xe5, 0x30, 0x3f, 0x4a, 0x7c, 0x0f, 0x22, 0x55,
|
|
0x57, 0x1b, 0x6e, 0xc9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