* Add ICERestartWHIPResource to RPC * Create witty-tomatoes-smile.md --------- Co-authored-by: Benjamin Pracht <benjamin@livekit.io>
350 lines
15 KiB
Go
350 lines
15 KiB
Go
// Code generated by protoc-gen-psrpc v0.5.1, DO NOT EDIT.
|
|
// source: rpc/ingress.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 google_protobuf "google.golang.org/protobuf/types/known/emptypb"
|
|
import livekit3 "github.com/livekit/protocol/livekit"
|
|
|
|
var _ = version.PsrpcVersion_0_5
|
|
|
|
// ================================
|
|
// IngressInternal Client Interface
|
|
// ================================
|
|
|
|
type IngressInternalClient interface {
|
|
StartIngress(ctx context.Context, req *StartIngressRequest, opts ...psrpc.RequestOption) (*livekit3.IngressInfo, error)
|
|
|
|
ListActiveIngress(ctx context.Context, topic string, req *ListActiveIngressRequest, opts ...psrpc.RequestOption) (<-chan *psrpc.Response[*ListActiveIngressResponse], error)
|
|
}
|
|
|
|
// ====================================
|
|
// IngressInternal ServerImpl Interface
|
|
// ====================================
|
|
|
|
type IngressInternalServerImpl interface {
|
|
StartIngress(context.Context, *StartIngressRequest) (*livekit3.IngressInfo, error)
|
|
StartIngressAffinity(context.Context, *StartIngressRequest) float32
|
|
|
|
ListActiveIngress(context.Context, *ListActiveIngressRequest) (*ListActiveIngressResponse, error)
|
|
}
|
|
|
|
// ================================
|
|
// IngressInternal Server Interface
|
|
// ================================
|
|
|
|
type IngressInternalServer interface {
|
|
RegisterListActiveIngressTopic(topic string) error
|
|
DeregisterListActiveIngressTopic(topic string)
|
|
|
|
// Close and wait for pending RPCs to complete
|
|
Shutdown()
|
|
|
|
// Close immediately, without waiting for pending RPCs
|
|
Kill()
|
|
}
|
|
|
|
// ======================
|
|
// IngressInternal Client
|
|
// ======================
|
|
|
|
type ingressInternalClient struct {
|
|
client *client.RPCClient
|
|
}
|
|
|
|
// NewIngressInternalClient creates a psrpc client that implements the IngressInternalClient interface.
|
|
func NewIngressInternalClient(bus psrpc.MessageBus, opts ...psrpc.ClientOption) (IngressInternalClient, error) {
|
|
sd := &info.ServiceDefinition{
|
|
Name: "IngressInternal",
|
|
ID: rand.NewClientID(),
|
|
}
|
|
|
|
sd.RegisterMethod("StartIngress", true, false, true, false)
|
|
sd.RegisterMethod("ListActiveIngress", false, true, false, false)
|
|
|
|
rpcClient, err := client.NewRPCClient(sd, bus, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &ingressInternalClient{
|
|
client: rpcClient,
|
|
}, nil
|
|
}
|
|
|
|
func (c *ingressInternalClient) StartIngress(ctx context.Context, req *StartIngressRequest, opts ...psrpc.RequestOption) (*livekit3.IngressInfo, error) {
|
|
return client.RequestSingle[*livekit3.IngressInfo](ctx, c.client, "StartIngress", nil, req, opts...)
|
|
}
|
|
|
|
func (c *ingressInternalClient) ListActiveIngress(ctx context.Context, topic string, req *ListActiveIngressRequest, opts ...psrpc.RequestOption) (<-chan *psrpc.Response[*ListActiveIngressResponse], error) {
|
|
return client.RequestMulti[*ListActiveIngressResponse](ctx, c.client, "ListActiveIngress", []string{topic}, req, opts...)
|
|
}
|
|
|
|
// ======================
|
|
// IngressInternal Server
|
|
// ======================
|
|
|
|
type ingressInternalServer struct {
|
|
svc IngressInternalServerImpl
|
|
rpc *server.RPCServer
|
|
}
|
|
|
|
// NewIngressInternalServer builds a RPCServer that will route requests
|
|
// to the corresponding method in the provided svc implementation.
|
|
func NewIngressInternalServer(svc IngressInternalServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (IngressInternalServer, error) {
|
|
sd := &info.ServiceDefinition{
|
|
Name: "IngressInternal",
|
|
ID: rand.NewServerID(),
|
|
}
|
|
|
|
s := server.NewRPCServer(sd, bus, opts...)
|
|
|
|
sd.RegisterMethod("StartIngress", true, false, true, false)
|
|
var err error
|
|
err = server.RegisterHandler(s, "StartIngress", nil, svc.StartIngress, svc.StartIngressAffinity)
|
|
if err != nil {
|
|
s.Close(false)
|
|
return nil, err
|
|
}
|
|
|
|
sd.RegisterMethod("ListActiveIngress", false, true, false, false)
|
|
return &ingressInternalServer{
|
|
svc: svc,
|
|
rpc: s,
|
|
}, nil
|
|
}
|
|
|
|
func (s *ingressInternalServer) RegisterListActiveIngressTopic(topic string) error {
|
|
return server.RegisterHandler(s.rpc, "ListActiveIngress", []string{topic}, s.svc.ListActiveIngress, nil)
|
|
}
|
|
|
|
func (s *ingressInternalServer) DeregisterListActiveIngressTopic(topic string) {
|
|
s.rpc.DeregisterHandler("ListActiveIngress", []string{topic})
|
|
}
|
|
|
|
func (s *ingressInternalServer) Shutdown() {
|
|
s.rpc.Close(false)
|
|
}
|
|
|
|
func (s *ingressInternalServer) Kill() {
|
|
s.rpc.Close(true)
|
|
}
|
|
|
|
// ===============================
|
|
// IngressHandler Client Interface
|
|
// ===============================
|
|
|
|
type IngressHandlerClient interface {
|
|
UpdateIngress(ctx context.Context, topic string, req *livekit3.UpdateIngressRequest, opts ...psrpc.RequestOption) (*livekit3.IngressState, error)
|
|
|
|
DeleteIngress(ctx context.Context, topic string, req *livekit3.DeleteIngressRequest, opts ...psrpc.RequestOption) (*livekit3.IngressState, error)
|
|
|
|
DeleteWHIPResource(ctx context.Context, topic string, req *DeleteWHIPResourceRequest, opts ...psrpc.RequestOption) (*google_protobuf.Empty, error)
|
|
|
|
ICERestartWHIPResource(ctx context.Context, topic string, req *ICERestartWHIPResourceRequest, opts ...psrpc.RequestOption) (*ICERestartWHIPResourceResponse, error)
|
|
}
|
|
|
|
// ===================================
|
|
// IngressHandler ServerImpl Interface
|
|
// ===================================
|
|
|
|
type IngressHandlerServerImpl interface {
|
|
UpdateIngress(context.Context, *livekit3.UpdateIngressRequest) (*livekit3.IngressState, error)
|
|
|
|
DeleteIngress(context.Context, *livekit3.DeleteIngressRequest) (*livekit3.IngressState, error)
|
|
|
|
DeleteWHIPResource(context.Context, *DeleteWHIPResourceRequest) (*google_protobuf.Empty, error)
|
|
|
|
ICERestartWHIPResource(context.Context, *ICERestartWHIPResourceRequest) (*ICERestartWHIPResourceResponse, error)
|
|
}
|
|
|
|
// ===============================
|
|
// IngressHandler Server Interface
|
|
// ===============================
|
|
|
|
type IngressHandlerServer interface {
|
|
RegisterUpdateIngressTopic(topic string) error
|
|
DeregisterUpdateIngressTopic(topic string)
|
|
RegisterDeleteIngressTopic(topic string) error
|
|
DeregisterDeleteIngressTopic(topic string)
|
|
RegisterDeleteWHIPResourceTopic(topic string) error
|
|
DeregisterDeleteWHIPResourceTopic(topic string)
|
|
RegisterICERestartWHIPResourceTopic(topic string) error
|
|
DeregisterICERestartWHIPResourceTopic(topic string)
|
|
|
|
// Close and wait for pending RPCs to complete
|
|
Shutdown()
|
|
|
|
// Close immediately, without waiting for pending RPCs
|
|
Kill()
|
|
}
|
|
|
|
// =====================
|
|
// IngressHandler Client
|
|
// =====================
|
|
|
|
type ingressHandlerClient struct {
|
|
client *client.RPCClient
|
|
}
|
|
|
|
// NewIngressHandlerClient creates a psrpc client that implements the IngressHandlerClient interface.
|
|
func NewIngressHandlerClient(bus psrpc.MessageBus, opts ...psrpc.ClientOption) (IngressHandlerClient, error) {
|
|
sd := &info.ServiceDefinition{
|
|
Name: "IngressHandler",
|
|
ID: rand.NewClientID(),
|
|
}
|
|
|
|
sd.RegisterMethod("UpdateIngress", false, false, true, true)
|
|
sd.RegisterMethod("DeleteIngress", false, false, true, true)
|
|
sd.RegisterMethod("DeleteWHIPResource", false, false, true, true)
|
|
sd.RegisterMethod("ICERestartWHIPResource", false, false, true, true)
|
|
|
|
rpcClient, err := client.NewRPCClient(sd, bus, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &ingressHandlerClient{
|
|
client: rpcClient,
|
|
}, nil
|
|
}
|
|
|
|
func (c *ingressHandlerClient) UpdateIngress(ctx context.Context, topic string, req *livekit3.UpdateIngressRequest, opts ...psrpc.RequestOption) (*livekit3.IngressState, error) {
|
|
return client.RequestSingle[*livekit3.IngressState](ctx, c.client, "UpdateIngress", []string{topic}, req, opts...)
|
|
}
|
|
|
|
func (c *ingressHandlerClient) DeleteIngress(ctx context.Context, topic string, req *livekit3.DeleteIngressRequest, opts ...psrpc.RequestOption) (*livekit3.IngressState, error) {
|
|
return client.RequestSingle[*livekit3.IngressState](ctx, c.client, "DeleteIngress", []string{topic}, req, opts...)
|
|
}
|
|
|
|
func (c *ingressHandlerClient) DeleteWHIPResource(ctx context.Context, topic string, req *DeleteWHIPResourceRequest, opts ...psrpc.RequestOption) (*google_protobuf.Empty, error) {
|
|
return client.RequestSingle[*google_protobuf.Empty](ctx, c.client, "DeleteWHIPResource", []string{topic}, req, opts...)
|
|
}
|
|
|
|
func (c *ingressHandlerClient) ICERestartWHIPResource(ctx context.Context, topic string, req *ICERestartWHIPResourceRequest, opts ...psrpc.RequestOption) (*ICERestartWHIPResourceResponse, error) {
|
|
return client.RequestSingle[*ICERestartWHIPResourceResponse](ctx, c.client, "ICERestartWHIPResource", []string{topic}, req, opts...)
|
|
}
|
|
|
|
// =====================
|
|
// IngressHandler Server
|
|
// =====================
|
|
|
|
type ingressHandlerServer struct {
|
|
svc IngressHandlerServerImpl
|
|
rpc *server.RPCServer
|
|
}
|
|
|
|
// NewIngressHandlerServer builds a RPCServer that will route requests
|
|
// to the corresponding method in the provided svc implementation.
|
|
func NewIngressHandlerServer(svc IngressHandlerServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (IngressHandlerServer, error) {
|
|
sd := &info.ServiceDefinition{
|
|
Name: "IngressHandler",
|
|
ID: rand.NewServerID(),
|
|
}
|
|
|
|
s := server.NewRPCServer(sd, bus, opts...)
|
|
|
|
sd.RegisterMethod("UpdateIngress", false, false, true, true)
|
|
sd.RegisterMethod("DeleteIngress", false, false, true, true)
|
|
sd.RegisterMethod("DeleteWHIPResource", false, false, true, true)
|
|
sd.RegisterMethod("ICERestartWHIPResource", false, false, true, true)
|
|
return &ingressHandlerServer{
|
|
svc: svc,
|
|
rpc: s,
|
|
}, nil
|
|
}
|
|
|
|
func (s *ingressHandlerServer) RegisterUpdateIngressTopic(topic string) error {
|
|
return server.RegisterHandler(s.rpc, "UpdateIngress", []string{topic}, s.svc.UpdateIngress, nil)
|
|
}
|
|
|
|
func (s *ingressHandlerServer) DeregisterUpdateIngressTopic(topic string) {
|
|
s.rpc.DeregisterHandler("UpdateIngress", []string{topic})
|
|
}
|
|
|
|
func (s *ingressHandlerServer) RegisterDeleteIngressTopic(topic string) error {
|
|
return server.RegisterHandler(s.rpc, "DeleteIngress", []string{topic}, s.svc.DeleteIngress, nil)
|
|
}
|
|
|
|
func (s *ingressHandlerServer) DeregisterDeleteIngressTopic(topic string) {
|
|
s.rpc.DeregisterHandler("DeleteIngress", []string{topic})
|
|
}
|
|
|
|
func (s *ingressHandlerServer) RegisterDeleteWHIPResourceTopic(topic string) error {
|
|
return server.RegisterHandler(s.rpc, "DeleteWHIPResource", []string{topic}, s.svc.DeleteWHIPResource, nil)
|
|
}
|
|
|
|
func (s *ingressHandlerServer) DeregisterDeleteWHIPResourceTopic(topic string) {
|
|
s.rpc.DeregisterHandler("DeleteWHIPResource", []string{topic})
|
|
}
|
|
|
|
func (s *ingressHandlerServer) RegisterICERestartWHIPResourceTopic(topic string) error {
|
|
return server.RegisterHandler(s.rpc, "ICERestartWHIPResource", []string{topic}, s.svc.ICERestartWHIPResource, nil)
|
|
}
|
|
|
|
func (s *ingressHandlerServer) DeregisterICERestartWHIPResourceTopic(topic string) {
|
|
s.rpc.DeregisterHandler("ICERestartWHIPResource", []string{topic})
|
|
}
|
|
|
|
func (s *ingressHandlerServer) Shutdown() {
|
|
s.rpc.Close(false)
|
|
}
|
|
|
|
func (s *ingressHandlerServer) Kill() {
|
|
s.rpc.Close(true)
|
|
}
|
|
|
|
var psrpcFileDescriptor2 = []byte{
|
|
// 637 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xcb, 0x4e, 0xdb, 0x40,
|
|
0x14, 0xd5, 0x24, 0x21, 0x82, 0x0b, 0xa1, 0x30, 0x3c, 0x64, 0x5c, 0xf1, 0xa8, 0xd9, 0x44, 0xaa,
|
|
0xe4, 0x54, 0xe9, 0xa6, 0xaa, 0xba, 0xa0, 0x0f, 0x10, 0x56, 0xa9, 0x84, 0x4c, 0x51, 0xa5, 0x56,
|
|
0xaa, 0x65, 0xec, 0x1b, 0x77, 0x14, 0xc7, 0xe3, 0xce, 0x8c, 0x41, 0xd9, 0x76, 0xc7, 0xef, 0xb0,
|
|
0xed, 0xa6, 0x7f, 0xd4, 0x5f, 0xa8, 0xec, 0x99, 0x00, 0x69, 0x12, 0xd4, 0x4d, 0x77, 0xbe, 0xe7,
|
|
0x9c, 0x39, 0xf7, 0x31, 0xbe, 0x03, 0xab, 0x22, 0x8f, 0x3a, 0x2c, 0x4b, 0x04, 0x4a, 0xe9, 0xe6,
|
|
0x82, 0x2b, 0x4e, 0xeb, 0x22, 0x8f, 0xec, 0x16, 0xcf, 0x15, 0xe3, 0x99, 0xc1, 0xec, 0x8d, 0x94,
|
|
0x5d, 0x62, 0x9f, 0xa9, 0x60, 0x4c, 0x6a, 0x3f, 0x4e, 0x38, 0x4f, 0x52, 0xec, 0x54, 0xd1, 0x45,
|
|
0xd1, 0xeb, 0xe0, 0x20, 0x57, 0x43, 0x4d, 0x3a, 0x36, 0x58, 0x27, 0x4c, 0xaa, 0xd7, 0x91, 0x62,
|
|
0x97, 0xe8, 0xe9, 0x73, 0x3e, 0x7e, 0x2f, 0x50, 0x2a, 0xe7, 0x15, 0x6c, 0x4d, 0xe1, 0x64, 0xce,
|
|
0x33, 0x89, 0x74, 0x17, 0x16, 0x4d, 0x9a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