github.com/livekit/protocol@v1.39.3/rpc/sip.psrpc.go (about)

     1  // Code generated by protoc-gen-psrpc v0.6.0, DO NOT EDIT.
     2  // source: rpc/sip.proto
     3  
     4  package rpc
     5  
     6  import (
     7  	"context"
     8  
     9  	"github.com/livekit/psrpc"
    10  	"github.com/livekit/psrpc/pkg/client"
    11  	"github.com/livekit/psrpc/pkg/info"
    12  	"github.com/livekit/psrpc/pkg/rand"
    13  	"github.com/livekit/psrpc/pkg/server"
    14  	"github.com/livekit/psrpc/version"
    15  )
    16  import google_protobuf "google.golang.org/protobuf/types/known/emptypb"
    17  
    18  var _ = version.PsrpcVersion_0_6
    19  
    20  // ============================
    21  // SIPInternal Client Interface
    22  // ============================
    23  
    24  type SIPInternalClient interface {
    25  	CreateSIPParticipant(ctx context.Context, topic string, req *InternalCreateSIPParticipantRequest, opts ...psrpc.RequestOption) (*InternalCreateSIPParticipantResponse, error)
    26  
    27  	TransferSIPParticipant(ctx context.Context, sipCallId string, req *InternalTransferSIPParticipantRequest, opts ...psrpc.RequestOption) (*google_protobuf.Empty, error)
    28  
    29  	// Close immediately, without waiting for pending RPCs
    30  	Close()
    31  }
    32  
    33  // ================================
    34  // SIPInternal ServerImpl Interface
    35  // ================================
    36  
    37  type SIPInternalServerImpl interface {
    38  	CreateSIPParticipant(context.Context, *InternalCreateSIPParticipantRequest) (*InternalCreateSIPParticipantResponse, error)
    39  	CreateSIPParticipantAffinity(context.Context, *InternalCreateSIPParticipantRequest) float32
    40  
    41  	TransferSIPParticipant(context.Context, *InternalTransferSIPParticipantRequest) (*google_protobuf.Empty, error)
    42  }
    43  
    44  // ============================
    45  // SIPInternal Server Interface
    46  // ============================
    47  
    48  type SIPInternalServer interface {
    49  	RegisterCreateSIPParticipantTopic(topic string) error
    50  	DeregisterCreateSIPParticipantTopic(topic string)
    51  	RegisterTransferSIPParticipantTopic(sipCallId string) error
    52  	DeregisterTransferSIPParticipantTopic(sipCallId string)
    53  
    54  	// Close and wait for pending RPCs to complete
    55  	Shutdown()
    56  
    57  	// Close immediately, without waiting for pending RPCs
    58  	Kill()
    59  }
    60  
    61  // ==================
    62  // SIPInternal Client
    63  // ==================
    64  
    65  type sIPInternalClient struct {
    66  	client *client.RPCClient
    67  }
    68  
    69  // NewSIPInternalClient creates a psrpc client that implements the SIPInternalClient interface.
    70  func NewSIPInternalClient(bus psrpc.MessageBus, opts ...psrpc.ClientOption) (SIPInternalClient, error) {
    71  	sd := &info.ServiceDefinition{
    72  		Name: "SIPInternal",
    73  		ID:   rand.NewClientID(),
    74  	}
    75  
    76  	sd.RegisterMethod("CreateSIPParticipant", true, false, true, false)
    77  	sd.RegisterMethod("TransferSIPParticipant", false, false, true, true)
    78  
    79  	rpcClient, err := client.NewRPCClient(sd, bus, opts...)
    80  	if err != nil {
    81  		return nil, err
    82  	}
    83  
    84  	return &sIPInternalClient{
    85  		client: rpcClient,
    86  	}, nil
    87  }
    88  
    89  func (c *sIPInternalClient) CreateSIPParticipant(ctx context.Context, topic string, req *InternalCreateSIPParticipantRequest, opts ...psrpc.RequestOption) (*InternalCreateSIPParticipantResponse, error) {
    90  	return client.RequestSingle[*InternalCreateSIPParticipantResponse](ctx, c.client, "CreateSIPParticipant", []string{topic}, req, opts...)
    91  }
    92  
    93  func (c *sIPInternalClient) TransferSIPParticipant(ctx context.Context, sipCallId string, req *InternalTransferSIPParticipantRequest, opts ...psrpc.RequestOption) (*google_protobuf.Empty, error) {
    94  	return client.RequestSingle[*google_protobuf.Empty](ctx, c.client, "TransferSIPParticipant", []string{sipCallId}, req, opts...)
    95  }
    96  
    97  func (s *sIPInternalClient) Close() {
    98  	s.client.Close()
    99  }
   100  
   101  // ==================
   102  // SIPInternal Server
   103  // ==================
   104  
   105  type sIPInternalServer struct {
   106  	svc SIPInternalServerImpl
   107  	rpc *server.RPCServer
   108  }
   109  
   110  // NewSIPInternalServer builds a RPCServer that will route requests
   111  // to the corresponding method in the provided svc implementation.
   112  func NewSIPInternalServer(svc SIPInternalServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (SIPInternalServer, error) {
   113  	sd := &info.ServiceDefinition{
   114  		Name: "SIPInternal",
   115  		ID:   rand.NewServerID(),
   116  	}
   117  
   118  	s := server.NewRPCServer(sd, bus, opts...)
   119  
   120  	sd.RegisterMethod("CreateSIPParticipant", true, false, true, false)
   121  	sd.RegisterMethod("TransferSIPParticipant", false, false, true, true)
   122  	return &sIPInternalServer{
   123  		svc: svc,
   124  		rpc: s,
   125  	}, nil
   126  }
   127  
   128  func (s *sIPInternalServer) RegisterCreateSIPParticipantTopic(topic string) error {
   129  	return server.RegisterHandler(s.rpc, "CreateSIPParticipant", []string{topic}, s.svc.CreateSIPParticipant, s.svc.CreateSIPParticipantAffinity)
   130  }
   131  
   132  func (s *sIPInternalServer) DeregisterCreateSIPParticipantTopic(topic string) {
   133  	s.rpc.DeregisterHandler("CreateSIPParticipant", []string{topic})
   134  }
   135  
   136  func (s *sIPInternalServer) RegisterTransferSIPParticipantTopic(sipCallId string) error {
   137  	return server.RegisterHandler(s.rpc, "TransferSIPParticipant", []string{sipCallId}, s.svc.TransferSIPParticipant, nil)
   138  }
   139  
   140  func (s *sIPInternalServer) DeregisterTransferSIPParticipantTopic(sipCallId string) {
   141  	s.rpc.DeregisterHandler("TransferSIPParticipant", []string{sipCallId})
   142  }
   143  
   144  func (s *sIPInternalServer) Shutdown() {
   145  	s.rpc.Close(false)
   146  }
   147  
   148  func (s *sIPInternalServer) Kill() {
   149  	s.rpc.Close(true)
   150  }
   151  
   152  var psrpcFileDescriptor11 = []byte{
   153  	// 1013 bytes of a gzipped FileDescriptorProto
   154  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcd, 0x72, 0xdb, 0x36,
   155  	0x10, 0x1e, 0x5a, 0xf1, 0xdf, 0xca, 0xfa, 0x31, 0x64, 0x39, 0xb0, 0xdc, 0x38, 0xaa, 0xd3, 0xcc,
   156  	0x28, 0x3d, 0x48, 0xad, 0x33, 0x9d, 0x76, 0x72, 0xe8, 0xd4, 0x71, 0xec, 0x89, 0x0e, 0x69, 0x5c,
   157  	0x59, 0xb9, 0xf4, 0xc2, 0x81, 0x48, 0xd8, 0x46, 0x4d, 0x02, 0x2c, 0x00, 0x46, 0x51, 0xdf, 0x20,
   158  	0x6f, 0xd1, 0x67, 0xc8, 0x13, 0xf5, 0x2d, 0x7a, 0xe8, 0xa5, 0x03, 0x80, 0xb4, 0x69, 0x59, 0x4a,
   159  	0xad, 0xe9, 0x8d, 0xbb, 0xdf, 0xee, 0x07, 0xec, 0x62, 0xf1, 0x81, 0x50, 0x91, 0x49, 0xd0, 0x53,
   160  	0x2c, 0xe9, 0x26, 0x52, 0x68, 0x81, 0x4a, 0x32, 0x09, 0x5a, 0xbb, 0x17, 0x42, 0x5c, 0x44, 0xb4,
   161  	0x67, 0x5d, 0xa3, 0xf4, 0xbc, 0x47, 0xe3, 0x44, 0x4f, 0x5c, 0x44, 0x6b, 0x6f, 0x1a, 0x0c, 0x53,
   162  	0x49, 0x34, 0x13, 0x3c, 0xc3, 0x2b, 0x22, 0x31, 0x96, 0xca, 0xcc, 0xcd, 0x88, 0xbd, 0xa7, 0x57,
   163  	0x4c, 0xfb, 0xd7, 0x6b, 0xec, 0xff, 0x5d, 0x81, 0x27, 0x7d, 0xae, 0xa9, 0xe4, 0x24, 0x3a, 0x92,
   164  	0x94, 0x68, 0x7a, 0xd6, 0x3f, 0x3d, 0x25, 0x52, 0xb3, 0x80, 0x25, 0x84, 0xeb, 0x01, 0xfd, 0x3d,
   165  	0xa5, 0x4a, 0xa3, 0x47, 0x00, 0x89, 0x14, 0xbf, 0xd1, 0x40, 0xfb, 0x2c, 0xc4, 0xa8, 0xed, 0x75,
   166  	0xd6, 0x07, 0xeb, 0x99, 0xa7, 0x1f, 0xa2, 0x3d, 0x28, 0x2b, 0x96, 0xf8, 0x01, 0x89, 0x22, 0x83,
   167  	0x57, 0x1c, 0xae, 0x58, 0x72, 0x44, 0xa2, 0xa8, 0x1f, 0xa2, 0x36, 0x6c, 0x18, 0x5c, 0xcb, 0x94,
   168  	0x5f, 0x99, 0x80, 0x86, 0x0d, 0x00, 0xc5, 0x92, 0xa1, 0x71, 0xf5, 0x43, 0x84, 0x61, 0x95, 0x84,
   169  	0xa1, 0xa4, 0x4a, 0xe1, 0x25, 0x0b, 0xe6, 0x26, 0x6a, 0xc1, 0xda, 0xa5, 0x50, 0x9a, 0x93, 0x98,
   170  	0xe2, 0x2d, 0x0b, 0x5d, 0xdb, 0xa8, 0x07, 0x8d, 0x90, 0x2a, 0xcd, 0xb8, 0xad, 0xda, 0x0f, 0x44,
   171  	0xca, 0xb5, 0x9c, 0xe0, 0x3d, 0x1b, 0x86, 0x0a, 0xd0, 0x91, 0x43, 0xd0, 0x73, 0x58, 0xd7, 0x92,
   172  	0x70, 0x95, 0x08, 0xa9, 0x71, 0xbd, 0xed, 0x75, 0xaa, 0x07, 0xcd, 0x6e, 0xd6, 0x96, 0xee, 0x59,
   173  	0xff, 0x74, 0x98, 0x83, 0x83, 0x9b, 0x38, 0xb4, 0x0d, 0x2b, 0x3c, 0x8d, 0x47, 0x54, 0xe2, 0x92,
   174  	0x25, 0xce, 0x2c, 0xf4, 0x10, 0x56, 0x6d, 0xc5, 0x5a, 0xe0, 0x07, 0x0e, 0x30, 0xe6, 0x50, 0x98,
   175  	0x2d, 0xa7, 0xca, 0xf4, 0x34, 0xa6, 0x78, 0xd9, 0x6d, 0x39, 0xb7, 0x0d, 0x96, 0x10, 0xa5, 0xc6,
   176  	0x42, 0x86, 0x78, 0xc5, 0x61, 0xb9, 0x8d, 0x76, 0x61, 0x5d, 0x0a, 0x11, 0xfb, 0x36, 0x71, 0xd5,
   177  	0x81, 0xc6, 0xf1, 0xb3, 0x49, 0xfc, 0x16, 0xb6, 0x92, 0x9b, 0x83, 0xf1, 0x59, 0x48, 0xb9, 0x66,
   178  	0x7a, 0x82, 0xd7, 0x6c, 0x5c, 0xa3, 0x80, 0xf5, 0x33, 0x08, 0x3d, 0x83, 0x7a, 0x31, 0xc5, 0xd2,
   179  	0x56, 0x6d, 0x78, 0xad, 0xe0, 0x9f, 0xc5, 0x1e, 0x53, 0x4d, 0x42, 0xa2, 0x09, 0xae, 0xdd, 0x61,
   180  	0x7f, 0x93, 0x41, 0xe8, 0x0f, 0xd8, 0x2e, 0xa6, 0x10, 0xad, 0x25, 0x1b, 0xa5, 0x9a, 0x2a, 0xbc,
   181  	0xd9, 0x2e, 0x75, 0xca, 0x07, 0x47, 0x5d, 0x99, 0x04, 0xdd, 0x7b, 0x4c, 0x57, 0xb7, 0xe0, 0x3a,
   182  	0xbc, 0x66, 0x39, 0x36, 0x07, 0x36, 0x68, 0x26, 0xb3, 0x30, 0xb4, 0x05, 0xcb, 0x5a, 0x5c, 0x51,
   183  	0x8e, 0xd7, 0xed, 0xfe, 0x9c, 0x81, 0x9a, 0xb0, 0x32, 0x56, 0x7e, 0x2a, 0x23, 0x0c, 0xce, 0x3d,
   184  	0x56, 0xef, 0x64, 0x84, 0x10, 0x3c, 0x08, 0x75, 0x7c, 0x8e, 0xcb, 0xd6, 0x69, 0xbf, 0xd1, 0x13,
   185  	0xa8, 0x24, 0x11, 0x99, 0xf8, 0x21, 0x23, 0x91, 0x16, 0x9c, 0xe2, 0x8d, 0xb6, 0xd7, 0x59, 0x1b,
   186  	0x6c, 0x18, 0xe7, 0xab, 0xcc, 0x87, 0xde, 0xc2, 0xea, 0x25, 0x25, 0x21, 0x95, 0x0a, 0x37, 0x6d,
   187  	0x49, 0xdf, 0xdd, 0xbb, 0xa4, 0xd7, 0x2e, 0xcf, 0x15, 0x91, 0xb3, 0xa0, 0x14, 0x9a, 0xd9, 0xa7,
   188  	0xaf, 0x45, 0xb1, 0x63, 0xdb, 0x96, 0xfe, 0x70, 0x51, 0xfa, 0xa1, 0x98, 0xee, 0x57, 0xe3, 0xf2,
   189  	0x2e, 0x62, 0x96, 0xbd, 0x59, 0xcb, 0xac, 0x9c, 0x57, 0xd5, 0x5a, 0x70, 0xd9, 0x1b, 0xce, 0xa1,
   190  	0xb8, 0x55, 0x61, 0x83, 0xdc, 0x45, 0xd0, 0x4b, 0xa8, 0x31, 0x1e, 0x44, 0x69, 0x48, 0xaf, 0x17,
   191  	0xdc, 0xb5, 0x57, 0x6e, 0xa7, 0x78, 0xe5, 0x5c, 0xf4, 0x5b, 0xa7, 0x54, 0x83, 0x6a, 0x96, 0x91,
   192  	0x73, 0xfc, 0x08, 0x75, 0xca, 0xc9, 0x28, 0xa2, 0xa1, 0x7f, 0x4e, 0x89, 0x4e, 0x25, 0x55, 0x78,
   193  	0xa7, 0x5d, 0xea, 0x54, 0x0f, 0x1a, 0x45, 0x92, 0x13, 0x87, 0x0d, 0x6a, 0x59, 0x70, 0x66, 0xdb,
   194  	0x3d, 0x48, 0xc6, 0x2f, 0x18, 0xbf, 0xf0, 0x35, 0x8b, 0xa9, 0x48, 0x35, 0x7e, 0xd8, 0xf6, 0x3a,
   195  	0xe5, 0x83, 0x9d, 0xae, 0x13, 0xcf, 0x6e, 0x2e, 0x9e, 0xdd, 0x57, 0x99, 0x78, 0x0e, 0xaa, 0x59,
   196  	0xc6, 0xd0, 0x25, 0xa0, 0x63, 0xd8, 0x8c, 0xc9, 0x07, 0xa7, 0x6e, 0xb9, 0xc2, 0x62, 0xfc, 0x5f,
   197  	0x2c, 0xb5, 0x98, 0x7c, 0x30, 0xf2, 0x97, 0x3b, 0xd0, 0x09, 0xd4, 0x63, 0x1a, 0x32, 0xe2, 0x53,
   198  	0x1e, 0xc8, 0x89, 0xad, 0x17, 0x7f, 0x61, 0xfb, 0xb1, 0x5b, 0x2c, 0xe5, 0x8d, 0x89, 0x39, 0xbe,
   199  	0x0e, 0x19, 0xd4, 0xe2, 0xdb, 0x0e, 0xd4, 0x85, 0xc6, 0x98, 0x30, 0xed, 0xa7, 0x5c, 0xb3, 0xc8,
   200  	0x27, 0x5c, 0x8d, 0xa9, 0xa4, 0x21, 0x7e, 0x64, 0x07, 0x78, 0xd3, 0x40, 0xef, 0x0c, 0x72, 0x98,
   201  	0x01, 0xad, 0xd7, 0xd0, 0x9a, 0x7f, 0xc1, 0x50, 0x1d, 0x4a, 0x57, 0x74, 0x82, 0x3d, 0x7b, 0x37,
   202  	0xcc, 0xa7, 0xb9, 0x5b, 0xef, 0x49, 0x94, 0xd2, 0x4c, 0x88, 0x9d, 0xf1, 0x62, 0xe9, 0x07, 0xaf,
   203  	0xf5, 0x02, 0x36, 0x8a, 0xa7, 0xbe, 0x50, 0xee, 0x09, 0xe0, 0x79, 0x43, 0xbb, 0x28, 0xcf, 0xbc,
   204  	0x29, 0x5c, 0x84, 0x67, 0xff, 0x4f, 0x0f, 0xbe, 0xfa, 0xfc, 0xc8, 0xab, 0x44, 0x70, 0x45, 0xd1,
   205  	0x53, 0xa8, 0xde, 0xd6, 0xdd, 0x8c, 0xbf, 0x72, 0x4b, 0x71, 0xe7, 0xca, 0xf3, 0xd2, 0x7c, 0x79,
   206  	0x9e, 0x7a, 0x35, 0x4b, 0x53, 0xaf, 0xe6, 0xfe, 0x5f, 0x4b, 0xf0, 0x34, 0xdf, 0xa2, 0x7d, 0x98,
   207  	0xce, 0xa9, 0x9c, 0xfd, 0x3c, 0x4f, 0x31, 0x79, 0xd3, 0xef, 0xef, 0x63, 0x28, 0xeb, 0x8c, 0xc0,
   208  	0xbc, 0x56, 0x6e, 0x4f, 0x90, 0xbb, 0x86, 0xe2, 0xae, 0x1c, 0x96, 0x66, 0xc8, 0xe1, 0x2f, 0x37,
   209  	0x72, 0xf8, 0xc0, 0x0a, 0xc7, 0xf7, 0xb7, 0x84, 0xe3, 0xb3, 0x5b, 0x9c, 0x23, 0x88, 0x33, 0xae,
   210  	0xe7, 0xf2, 0x82, 0xd7, 0xf3, 0xff, 0x4c, 0xe5, 0xc1, 0x3f, 0x1e, 0x94, 0xcf, 0xfa, 0xa7, 0x79,
   211  	0x09, 0x68, 0x0c, 0x5b, 0xb3, 0x86, 0x01, 0x75, 0xee, 0x2b, 0x91, 0xad, 0x67, 0xf7, 0x88, 0x74,
   212  	0x93, 0xb5, 0x0f, 0x9f, 0x3e, 0x7a, 0x2b, 0x75, 0xef, 0x27, 0xef, 0x1b, 0x0f, 0x29, 0xd8, 0x9e,
   213  	0xdd, 0x3f, 0xf4, 0xf5, 0xfd, 0x9b, 0xdc, 0xda, 0xbe, 0xd3, 0xb5, 0x63, 0xf3, 0xbb, 0xb8, 0xdf,
   214  	0xfc, 0xf4, 0xd1, 0xdb, 0xac, 0x7b, 0xad, 0x0a, 0x2a, 0xce, 0xc9, 0xcb, 0x2f, 0x7f, 0x7d, 0x7c,
   215  	0xc1, 0xf4, 0x65, 0x3a, 0xea, 0x06, 0x22, 0xee, 0x65, 0x1a, 0xe4, 0xfe, 0x26, 0x03, 0x11, 0xf5,
   216  	0x64, 0x12, 0x8c, 0x56, 0xac, 0xf5, 0xfc, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xc9, 0x75,
   217  	0x58, 0x9c, 0x0a, 0x00, 0x00,
   218  }