// 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{ // 358 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4d, 0x4f, 0xc2, 0x30, 0x18, 0xc7, 0x53, 0x90, 0x01, 0x8f, 0xc1, 0x98, 0x8a, 0xda, 0xe0, 0xc5, 0xa0, 0x26, 0x68, 0xcc, 0xe6, 0xcb, 0x17, 0x30, 0x7a, 0xda, 0xc5, 0x10, 0xd0, 0x8b, 0x97, 0x65, 0x74, 0x0d, 0x36, 0x6c, 0x6d, 0x6d, 0x3b, 0x16, 0x6f, 0x9e, 0x4c, 0xfc, 0x20, 0x7e, 0x01, 0x3f, 0xa1, 0xd9, 0x06, 0x28, 0x89, 0x18, 0x4e, 0xcb, 0xff, 0xf9, 0x3d, 0xcf, 0xfa, 0xeb, 0x0b, 0xb4, 0xb4, 0xa2, 0x9e, 0xe1, 0xca, 0x55, 0x5a, 0x5a, 0x89, 0xab, 0x5a, 0xd1, 0x4e, 0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