* update psrpc * generated protobuf * Create beige-impalas-judge.md --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
351 lines
13 KiB
Go
351 lines
13 KiB
Go
// Code generated by protoc-gen-psrpc v0.7.0, DO NOT EDIT.
|
|
// source: rpc/egress.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"
|
|
)
|
|
import livekit4 "github.com/livekit/protocol/livekit"
|
|
|
|
var _ = version.PsrpcVersion_0_7
|
|
|
|
// ===============================
|
|
// EgressInternal Client Interface
|
|
// ===============================
|
|
|
|
type EgressInternalClient interface {
|
|
StartEgress(ctx context.Context, topic string, req *StartEgressRequest, opts ...psrpc.RequestOption) (*livekit4.EgressInfo, error)
|
|
|
|
ListActiveEgress(ctx context.Context, topic string, req *ListActiveEgressRequest, opts ...psrpc.RequestOption) (<-chan *psrpc.Response[*ListActiveEgressResponse], error)
|
|
|
|
// Close immediately, without waiting for pending RPCs
|
|
Close()
|
|
}
|
|
|
|
// ===================================
|
|
// EgressInternal ServerImpl Interface
|
|
// ===================================
|
|
|
|
type EgressInternalServerImpl interface {
|
|
StartEgress(context.Context, *StartEgressRequest) (*livekit4.EgressInfo, error)
|
|
StartEgressAffinity(context.Context, *StartEgressRequest) float32
|
|
|
|
ListActiveEgress(context.Context, *ListActiveEgressRequest) (*ListActiveEgressResponse, error)
|
|
}
|
|
|
|
// ===============================
|
|
// EgressInternal Server Interface
|
|
// ===============================
|
|
|
|
type EgressInternalServer interface {
|
|
RegisterStartEgressTopic(topic string) error
|
|
DeregisterStartEgressTopic(topic string)
|
|
RegisterListActiveEgressTopic(topic string) error
|
|
DeregisterListActiveEgressTopic(topic string)
|
|
|
|
// Close and wait for pending RPCs to complete
|
|
Shutdown()
|
|
|
|
// Close immediately, without waiting for pending RPCs
|
|
Kill()
|
|
}
|
|
|
|
// =====================
|
|
// EgressInternal Client
|
|
// =====================
|
|
|
|
type egressInternalClient struct {
|
|
client *client.RPCClient
|
|
}
|
|
|
|
// NewEgressInternalClient creates a psrpc client that implements the EgressInternalClient interface.
|
|
func NewEgressInternalClient(bus psrpc.MessageBus, opts ...psrpc.ClientOption) (EgressInternalClient, error) {
|
|
sd := &info.ServiceDefinition{
|
|
Name: "EgressInternal",
|
|
ID: rand.NewClientID(),
|
|
}
|
|
|
|
sd.RegisterMethod("StartEgress", true, false, true, false)
|
|
sd.RegisterMethod("ListActiveEgress", false, true, false, false)
|
|
|
|
rpcClient, err := client.NewRPCClient(sd, bus, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &egressInternalClient{
|
|
client: rpcClient,
|
|
}, nil
|
|
}
|
|
|
|
func (c *egressInternalClient) StartEgress(ctx context.Context, topic string, req *StartEgressRequest, opts ...psrpc.RequestOption) (*livekit4.EgressInfo, error) {
|
|
return client.RequestSingle[*livekit4.EgressInfo](ctx, c.client, "StartEgress", []string{topic}, req, opts...)
|
|
}
|
|
|
|
func (c *egressInternalClient) ListActiveEgress(ctx context.Context, topic string, req *ListActiveEgressRequest, opts ...psrpc.RequestOption) (<-chan *psrpc.Response[*ListActiveEgressResponse], error) {
|
|
return client.RequestMulti[*ListActiveEgressResponse](ctx, c.client, "ListActiveEgress", []string{topic}, req, opts...)
|
|
}
|
|
|
|
func (s *egressInternalClient) Close() {
|
|
s.client.Close()
|
|
}
|
|
|
|
// =====================
|
|
// EgressInternal Server
|
|
// =====================
|
|
|
|
type egressInternalServer struct {
|
|
svc EgressInternalServerImpl
|
|
rpc *server.RPCServer
|
|
}
|
|
|
|
// NewEgressInternalServer builds a RPCServer that will route requests
|
|
// to the corresponding method in the provided svc implementation.
|
|
func NewEgressInternalServer(svc EgressInternalServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (EgressInternalServer, error) {
|
|
sd := &info.ServiceDefinition{
|
|
Name: "EgressInternal",
|
|
ID: rand.NewServerID(),
|
|
}
|
|
|
|
s := server.NewRPCServer(sd, bus, opts...)
|
|
|
|
sd.RegisterMethod("StartEgress", true, false, true, false)
|
|
sd.RegisterMethod("ListActiveEgress", false, true, false, false)
|
|
return &egressInternalServer{
|
|
svc: svc,
|
|
rpc: s,
|
|
}, nil
|
|
}
|
|
|
|
func (s *egressInternalServer) RegisterStartEgressTopic(topic string) error {
|
|
return server.RegisterHandler(s.rpc, "StartEgress", []string{topic}, s.svc.StartEgress, s.svc.StartEgressAffinity)
|
|
}
|
|
|
|
func (s *egressInternalServer) DeregisterStartEgressTopic(topic string) {
|
|
s.rpc.DeregisterHandler("StartEgress", []string{topic})
|
|
}
|
|
|
|
func (s *egressInternalServer) RegisterListActiveEgressTopic(topic string) error {
|
|
return server.RegisterHandler(s.rpc, "ListActiveEgress", []string{topic}, s.svc.ListActiveEgress, nil)
|
|
}
|
|
|
|
func (s *egressInternalServer) DeregisterListActiveEgressTopic(topic string) {
|
|
s.rpc.DeregisterHandler("ListActiveEgress", []string{topic})
|
|
}
|
|
|
|
func (s *egressInternalServer) Shutdown() {
|
|
s.rpc.Close(false)
|
|
}
|
|
|
|
func (s *egressInternalServer) Kill() {
|
|
s.rpc.Close(true)
|
|
}
|
|
|
|
// ===================================
|
|
// EgressInternal Unimplemented Server
|
|
// ===================================
|
|
|
|
type UnimplementedEgressInternalServer struct{}
|
|
|
|
func (UnimplementedEgressInternalServer) StartEgress(context.Context, *StartEgressRequest) (*livekit4.EgressInfo, error) {
|
|
return nil, psrpc.ErrUnimplemented
|
|
}
|
|
func (UnimplementedEgressInternalServer) StartEgressAffinity(context.Context, *StartEgressRequest) float32 {
|
|
return -1
|
|
}
|
|
|
|
func (UnimplementedEgressInternalServer) ListActiveEgress(context.Context, *ListActiveEgressRequest) (*ListActiveEgressResponse, error) {
|
|
return nil, psrpc.ErrUnimplemented
|
|
}
|
|
|
|
// ==============================
|
|
// EgressHandler Client Interface
|
|
// ==============================
|
|
|
|
type EgressHandlerClient interface {
|
|
UpdateStream(ctx context.Context, topic string, req *livekit4.UpdateStreamRequest, opts ...psrpc.RequestOption) (*livekit4.EgressInfo, error)
|
|
|
|
StopEgress(ctx context.Context, topic string, req *livekit4.StopEgressRequest, opts ...psrpc.RequestOption) (*livekit4.EgressInfo, error)
|
|
|
|
// Close immediately, without waiting for pending RPCs
|
|
Close()
|
|
}
|
|
|
|
// ==================================
|
|
// EgressHandler ServerImpl Interface
|
|
// ==================================
|
|
|
|
type EgressHandlerServerImpl interface {
|
|
UpdateStream(context.Context, *livekit4.UpdateStreamRequest) (*livekit4.EgressInfo, error)
|
|
|
|
StopEgress(context.Context, *livekit4.StopEgressRequest) (*livekit4.EgressInfo, error)
|
|
}
|
|
|
|
// ==============================
|
|
// EgressHandler Server Interface
|
|
// ==============================
|
|
|
|
type EgressHandlerServer interface {
|
|
RegisterUpdateStreamTopic(topic string) error
|
|
DeregisterUpdateStreamTopic(topic string)
|
|
RegisterStopEgressTopic(topic string) error
|
|
DeregisterStopEgressTopic(topic string)
|
|
|
|
// Close and wait for pending RPCs to complete
|
|
Shutdown()
|
|
|
|
// Close immediately, without waiting for pending RPCs
|
|
Kill()
|
|
}
|
|
|
|
// ====================
|
|
// EgressHandler Client
|
|
// ====================
|
|
|
|
type egressHandlerClient struct {
|
|
client *client.RPCClient
|
|
}
|
|
|
|
// NewEgressHandlerClient creates a psrpc client that implements the EgressHandlerClient interface.
|
|
func NewEgressHandlerClient(bus psrpc.MessageBus, opts ...psrpc.ClientOption) (EgressHandlerClient, error) {
|
|
sd := &info.ServiceDefinition{
|
|
Name: "EgressHandler",
|
|
ID: rand.NewClientID(),
|
|
}
|
|
|
|
sd.RegisterMethod("UpdateStream", false, false, true, true)
|
|
sd.RegisterMethod("StopEgress", false, false, true, true)
|
|
|
|
rpcClient, err := client.NewRPCClient(sd, bus, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &egressHandlerClient{
|
|
client: rpcClient,
|
|
}, nil
|
|
}
|
|
|
|
func (c *egressHandlerClient) UpdateStream(ctx context.Context, topic string, req *livekit4.UpdateStreamRequest, opts ...psrpc.RequestOption) (*livekit4.EgressInfo, error) {
|
|
return client.RequestSingle[*livekit4.EgressInfo](ctx, c.client, "UpdateStream", []string{topic}, req, opts...)
|
|
}
|
|
|
|
func (c *egressHandlerClient) StopEgress(ctx context.Context, topic string, req *livekit4.StopEgressRequest, opts ...psrpc.RequestOption) (*livekit4.EgressInfo, error) {
|
|
return client.RequestSingle[*livekit4.EgressInfo](ctx, c.client, "StopEgress", []string{topic}, req, opts...)
|
|
}
|
|
|
|
func (s *egressHandlerClient) Close() {
|
|
s.client.Close()
|
|
}
|
|
|
|
// ====================
|
|
// EgressHandler Server
|
|
// ====================
|
|
|
|
type egressHandlerServer struct {
|
|
svc EgressHandlerServerImpl
|
|
rpc *server.RPCServer
|
|
}
|
|
|
|
// NewEgressHandlerServer builds a RPCServer that will route requests
|
|
// to the corresponding method in the provided svc implementation.
|
|
func NewEgressHandlerServer(svc EgressHandlerServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (EgressHandlerServer, error) {
|
|
sd := &info.ServiceDefinition{
|
|
Name: "EgressHandler",
|
|
ID: rand.NewServerID(),
|
|
}
|
|
|
|
s := server.NewRPCServer(sd, bus, opts...)
|
|
|
|
sd.RegisterMethod("UpdateStream", false, false, true, true)
|
|
sd.RegisterMethod("StopEgress", false, false, true, true)
|
|
return &egressHandlerServer{
|
|
svc: svc,
|
|
rpc: s,
|
|
}, nil
|
|
}
|
|
|
|
func (s *egressHandlerServer) RegisterUpdateStreamTopic(topic string) error {
|
|
return server.RegisterHandler(s.rpc, "UpdateStream", []string{topic}, s.svc.UpdateStream, nil)
|
|
}
|
|
|
|
func (s *egressHandlerServer) DeregisterUpdateStreamTopic(topic string) {
|
|
s.rpc.DeregisterHandler("UpdateStream", []string{topic})
|
|
}
|
|
|
|
func (s *egressHandlerServer) RegisterStopEgressTopic(topic string) error {
|
|
return server.RegisterHandler(s.rpc, "StopEgress", []string{topic}, s.svc.StopEgress, nil)
|
|
}
|
|
|
|
func (s *egressHandlerServer) DeregisterStopEgressTopic(topic string) {
|
|
s.rpc.DeregisterHandler("StopEgress", []string{topic})
|
|
}
|
|
|
|
func (s *egressHandlerServer) Shutdown() {
|
|
s.rpc.Close(false)
|
|
}
|
|
|
|
func (s *egressHandlerServer) Kill() {
|
|
s.rpc.Close(true)
|
|
}
|
|
|
|
// ==================================
|
|
// EgressHandler Unimplemented Server
|
|
// ==================================
|
|
|
|
type UnimplementedEgressHandlerServer struct{}
|
|
|
|
func (UnimplementedEgressHandlerServer) UpdateStream(context.Context, *livekit4.UpdateStreamRequest) (*livekit4.EgressInfo, error) {
|
|
return nil, psrpc.ErrUnimplemented
|
|
}
|
|
|
|
func (UnimplementedEgressHandlerServer) StopEgress(context.Context, *livekit4.StopEgressRequest) (*livekit4.EgressInfo, error) {
|
|
return nil, psrpc.ErrUnimplemented
|
|
}
|
|
|
|
var psrpcFileDescriptor2 = []byte{
|
|
// 544 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xd1, 0x4e, 0xdb, 0x3e,
|
|
0x14, 0xc6, 0xff, 0xa6, 0x7f, 0x02, 0x39, 0xa5, 0x5d, 0xe5, 0x31, 0x61, 0x0a, 0x68, 0xa5, 0xec,
|
|
0x22, 0x37, 0x4b, 0x11, 0x5c, 0xed, 0x6e, 0x03, 0x55, 0xa3, 0x12, 0xd2, 0xa6, 0x74, 0x68, 0xd2,
|
|
0x76, 0x11, 0x25, 0x8e, 0xc7, 0xac, 0x26, 0xb1, 0x67, 0x3b, 0xf4, 0x19, 0x78, 0x8c, 0x69, 0x6f,
|
|
0xc0, 0xc5, 0x9e, 0x6f, 0xaa, 0xd3, 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