Files
livekit-3d/pkg/service/rpc/egress.psrpc.go
T
Raja Subramanian 80c647ef15 Update PSRPC to 0.2.5 (#1357)
Not able to update cloud without this.
2023-01-31 14:11:44 +05:30

254 lines
9.1 KiB
Go

// Code generated by protoc-gen-psrpc v0.2.5, DO NOT EDIT.
// source: pkg/service/rpc/egress.proto
package rpc
import context "context"
import psrpc "github.com/livekit/psrpc"
import version "github.com/livekit/psrpc/version"
import livekit "github.com/livekit/protocol/livekit"
import livekit3 "github.com/livekit/protocol/livekit"
var _ = version.PsrpcVersion_0_2_5
// ===============================
// EgressInternal Client Interface
// ===============================
type EgressInternalClient interface {
StartEgress(context.Context, string, *livekit3.StartEgressRequest, ...psrpc.RequestOption) (*livekit.EgressInfo, error)
ListActiveEgress(context.Context, *ListActiveEgressRequest, ...psrpc.RequestOption) (<-chan *psrpc.Response[*ListActiveEgressResponse], error)
}
// ===================================
// EgressInternal ServerImpl Interface
// ===================================
type EgressInternalServerImpl interface {
StartEgress(context.Context, *livekit3.StartEgressRequest) (*livekit.EgressInfo, error)
StartEgressAffinity(*livekit3.StartEgressRequest) float32
ListActiveEgress(context.Context, *ListActiveEgressRequest) (*ListActiveEgressResponse, error)
}
// ===============================
// EgressInternal Server Interface
// ===============================
type EgressInternalServer interface {
RegisterStartEgressTopic(string) error
DeregisterStartEgressTopic(string)
// Close and wait for pending RPCs to complete
Shutdown()
// Close immediately, without waiting for pending RPCs
Kill()
}
// =====================
// EgressInternal Client
// =====================
type egressInternalClient struct {
client *psrpc.RPCClient
}
// NewEgressInternalClient creates a psrpc client that implements the EgressInternalClient interface.
func NewEgressInternalClient(clientID string, bus psrpc.MessageBus, opts ...psrpc.ClientOption) (EgressInternalClient, error) {
rpcClient, err := psrpc.NewRPCClient("EgressInternal", clientID, bus, opts...)
if err != nil {
return nil, err
}
return &egressInternalClient{
client: rpcClient,
}, nil
}
func (c *egressInternalClient) StartEgress(ctx context.Context, topic string, req *livekit3.StartEgressRequest, opts ...psrpc.RequestOption) (*livekit.EgressInfo, error) {
return psrpc.RequestSingle[*livekit.EgressInfo](ctx, c.client, "StartEgress", topic, req, opts...)
}
func (c *egressInternalClient) ListActiveEgress(ctx context.Context, req *ListActiveEgressRequest, opts ...psrpc.RequestOption) (<-chan *psrpc.Response[*ListActiveEgressResponse], error) {
return psrpc.RequestMulti[*ListActiveEgressResponse](ctx, c.client, "ListActiveEgress", "", req, opts...)
}
// =====================
// EgressInternal Server
// =====================
type egressInternalServer struct {
svc EgressInternalServerImpl
rpc *psrpc.RPCServer
}
// NewEgressInternalServer builds a RPCServer that will route requests
// to the corresponding method in the provided svc implementation.
func NewEgressInternalServer(serverID string, svc EgressInternalServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (EgressInternalServer, error) {
s := psrpc.NewRPCServer("EgressInternal", serverID, bus, opts...)
var err error
err = psrpc.RegisterHandler(s, "ListActiveEgress", "", svc.ListActiveEgress, nil)
if err != nil {
s.Close(false)
return nil, err
}
return &egressInternalServer{
svc: svc,
rpc: s,
}, nil
}
func (s *egressInternalServer) RegisterStartEgressTopic(topic string) error {
return psrpc.RegisterHandler(s.rpc, "StartEgress", topic, s.svc.StartEgress, s.svc.StartEgressAffinity)
}
func (s *egressInternalServer) DeregisterStartEgressTopic(topic string) {
s.rpc.DeregisterHandler("StartEgress", topic)
}
func (s *egressInternalServer) Shutdown() {
s.rpc.Close(false)
}
func (s *egressInternalServer) Kill() {
s.rpc.Close(true)
}
// ==============================
// EgressHandler Client Interface
// ==============================
type EgressHandlerClient interface {
UpdateStream(context.Context, string, *livekit.UpdateStreamRequest, ...psrpc.RequestOption) (*livekit.EgressInfo, error)
StopEgress(context.Context, string, *livekit.StopEgressRequest, ...psrpc.RequestOption) (*livekit.EgressInfo, error)
}
// ==================================
// EgressHandler ServerImpl Interface
// ==================================
type EgressHandlerServerImpl interface {
UpdateStream(context.Context, *livekit.UpdateStreamRequest) (*livekit.EgressInfo, error)
StopEgress(context.Context, *livekit.StopEgressRequest) (*livekit.EgressInfo, error)
}
// ==============================
// EgressHandler Server Interface
// ==============================
type EgressHandlerServer interface {
RegisterUpdateStreamTopic(string) error
DeregisterUpdateStreamTopic(string)
RegisterStopEgressTopic(string) error
DeregisterStopEgressTopic(string)
// Close and wait for pending RPCs to complete
Shutdown()
// Close immediately, without waiting for pending RPCs
Kill()
}
// ====================
// EgressHandler Client
// ====================
type egressHandlerClient struct {
client *psrpc.RPCClient
}
// NewEgressHandlerClient creates a psrpc client that implements the EgressHandlerClient interface.
func NewEgressHandlerClient(clientID string, bus psrpc.MessageBus, opts ...psrpc.ClientOption) (EgressHandlerClient, error) {
rpcClient, err := psrpc.NewRPCClient("EgressHandler", clientID, bus, opts...)
if err != nil {
return nil, err
}
return &egressHandlerClient{
client: rpcClient,
}, nil
}
func (c *egressHandlerClient) UpdateStream(ctx context.Context, topic string, req *livekit.UpdateStreamRequest, opts ...psrpc.RequestOption) (*livekit.EgressInfo, error) {
return psrpc.RequestSingle[*livekit.EgressInfo](ctx, c.client, "UpdateStream", topic, req, opts...)
}
func (c *egressHandlerClient) StopEgress(ctx context.Context, topic string, req *livekit.StopEgressRequest, opts ...psrpc.RequestOption) (*livekit.EgressInfo, error) {
return psrpc.RequestSingle[*livekit.EgressInfo](ctx, c.client, "StopEgress", topic, req, opts...)
}
// ====================
// EgressHandler Server
// ====================
type egressHandlerServer struct {
svc EgressHandlerServerImpl
rpc *psrpc.RPCServer
}
// NewEgressHandlerServer builds a RPCServer that will route requests
// to the corresponding method in the provided svc implementation.
func NewEgressHandlerServer(serverID string, svc EgressHandlerServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (EgressHandlerServer, error) {
s := psrpc.NewRPCServer("EgressHandler", serverID, bus, opts...)
return &egressHandlerServer{
svc: svc,
rpc: s,
}, nil
}
func (s *egressHandlerServer) RegisterUpdateStreamTopic(topic string) error {
return psrpc.RegisterHandler(s.rpc, "UpdateStream", topic, s.svc.UpdateStream, nil)
}
func (s *egressHandlerServer) DeregisterUpdateStreamTopic(topic string) {
s.rpc.DeregisterHandler("UpdateStream", topic)
}
func (s *egressHandlerServer) RegisterStopEgressTopic(topic string) error {
return psrpc.RegisterHandler(s.rpc, "StopEgress", topic, s.svc.StopEgress, nil)
}
func (s *egressHandlerServer) DeregisterStopEgressTopic(topic string) {
s.rpc.DeregisterHandler("StopEgress", topic)
}
func (s *egressHandlerServer) Shutdown() {
s.rpc.Close(false)
}
func (s *egressHandlerServer) Kill() {
s.rpc.Close(true)
}
var psrpcFileDescriptor0 = []byte{
// 312 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xd1, 0x4a, 0xc3, 0x30,
0x14, 0x86, 0x89, 0x93, 0xb1, 0x1d, 0x9d, 0x48, 0x14, 0xac, 0x75, 0x83, 0xd1, 0x2b, 0x11, 0x69,
0x61, 0x5e, 0x79, 0xa9, 0x30, 0xb0, 0xe0, 0xd5, 0x86, 0x08, 0xde, 0x8c, 0x2e, 0x3d, 0xce, 0xb0,
0xad, 0x89, 0xc9, 0xd9, 0xde, 0x61, 0x8f, 0xe1, 0x2b, 0x0c, 0x1f, 0x50, 0x58, 0xb2, 0x52, 0x26,
0x13, 0xaf, 0x02, 0xff, 0x97, 0xfc, 0xf9, 0x0e, 0x09, 0xb4, 0xf5, 0x74, 0x92, 0x58, 0x34, 0x4b,
0x29, 0x30, 0x31, 0x5a, 0x24, 0x38, 0x31, 0x68, 0x6d, 0xac, 0x8d, 0x22, 0xc5, 0x6b, 0x46, 0x8b,
0xb0, 0xa5, 0x34, 0x49, 0x55, 0xf8, 0x2c, 0x0c, 0x67, 0x72, 0x89, 0x53, 0x49, 0x23, 0xa3, 0xc5,
0x48, 0x16, 0x84, 0xa6, 0xc8, 0x66, 0x9e, 0x9d, 0x6f, 0x59, 0xb5, 0x25, 0xba, 0x84, 0x8b, 0x67,
0x69, 0xe9, 0x41, 0x90, 0x5c, 0x62, 0x7f, 0x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