update psrpc (#1312)

This commit is contained in:
David Colburn
2023-01-18 13:52:03 -08:00
committed by GitHub
parent edc39da0b1
commit e31b25300d
5 changed files with 88 additions and 82 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ require (
github.com/livekit/mageutil v0.0.0-20221221221243-f361fbe40290 github.com/livekit/mageutil v0.0.0-20221221221243-f361fbe40290
github.com/livekit/mediatransportutil v0.0.0-20230111071722-904079e94a7c github.com/livekit/mediatransportutil v0.0.0-20230111071722-904079e94a7c
github.com/livekit/protocol v1.3.2 github.com/livekit/protocol v1.3.2
github.com/livekit/psrpc v0.2.4-0.20230117222629-750daf611ec6 github.com/livekit/psrpc v0.2.4
github.com/livekit/rtcscore-go v0.0.0-20220815072451-20ee10ae1995 github.com/livekit/rtcscore-go v0.0.0-20220815072451-20ee10ae1995
github.com/mackerelio/go-osstat v0.2.3 github.com/mackerelio/go-osstat v0.2.3
github.com/magefile/mage v1.14.0 github.com/magefile/mage v1.14.0
+2 -2
View File
@@ -235,8 +235,8 @@ github.com/livekit/mediatransportutil v0.0.0-20230111071722-904079e94a7c h1:wdzw
github.com/livekit/mediatransportutil v0.0.0-20230111071722-904079e94a7c/go.mod h1:1Dlx20JPoIKGP45eo+yuj0HjeE25zmyeX/EWHiPCjFw= github.com/livekit/mediatransportutil v0.0.0-20230111071722-904079e94a7c/go.mod h1:1Dlx20JPoIKGP45eo+yuj0HjeE25zmyeX/EWHiPCjFw=
github.com/livekit/protocol v1.3.2 h1:3goGWbB5HFRb3tMjog8KP0nvZL1Fy6zut3W1psBzqE4= github.com/livekit/protocol v1.3.2 h1:3goGWbB5HFRb3tMjog8KP0nvZL1Fy6zut3W1psBzqE4=
github.com/livekit/protocol v1.3.2/go.mod h1:gwCG03nKlHlC9hTjL4pXQpn783ALhmbyhq65UZxqbb8= github.com/livekit/protocol v1.3.2/go.mod h1:gwCG03nKlHlC9hTjL4pXQpn783ALhmbyhq65UZxqbb8=
github.com/livekit/psrpc v0.2.4-0.20230117222629-750daf611ec6 h1:rQ2AYPTFxFO8GTN+sT2I3ELbjMEpudgKvkH5sFta5a8= github.com/livekit/psrpc v0.2.4 h1:Fdxq56uJAIpRHCTgJsvp7ozw51dKtUmD3nxSXq9pCLs=
github.com/livekit/psrpc v0.2.4-0.20230117222629-750daf611ec6/go.mod h1:+nJvbKx9DCZ6PSAsMHJPRAKjmRJ5WiyyhEmbKYqMKto= github.com/livekit/psrpc v0.2.4/go.mod h1:+nJvbKx9DCZ6PSAsMHJPRAKjmRJ5WiyyhEmbKYqMKto=
github.com/livekit/rtcscore-go v0.0.0-20220815072451-20ee10ae1995 h1:vOaY2qvfLihDyeZtnGGN1Law9wRrw8BMGCr1TygTvMw= github.com/livekit/rtcscore-go v0.0.0-20220815072451-20ee10ae1995 h1:vOaY2qvfLihDyeZtnGGN1Law9wRrw8BMGCr1TygTvMw=
github.com/livekit/rtcscore-go v0.0.0-20220815072451-20ee10ae1995/go.mod h1:116ych8UaEs9vfIE8n6iZCZ30iagUFTls0vRmC+Ix5U= github.com/livekit/rtcscore-go v0.0.0-20220815072451-20ee10ae1995/go.mod h1:116ych8UaEs9vfIE8n6iZCZ30iagUFTls0vRmC+Ix5U=
github.com/mackerelio/go-osstat v0.2.3 h1:jAMXD5erlDE39kdX2CU7YwCGRcxIO33u/p8+Fhe5dJw= github.com/mackerelio/go-osstat v0.2.3 h1:jAMXD5erlDE39kdX2CU7YwCGRcxIO33u/p8+Fhe5dJw=
+33 -31
View File
@@ -1,22 +1,24 @@
// Code generated by protoc-gen-psrpc v0.2.3, DO NOT EDIT. // Code generated by protoc-gen-psrpc v0.2.4, DO NOT EDIT.
// source: pkg/service/rpc/egress.proto // source: pkg/service/rpc/egress.proto
package rpc package rpc
import context "context" import context "context"
import psrpc "github.com/livekit/psrpc"
import psrpc1 "github.com/livekit/psrpc" import version "github.com/livekit/psrpc/version"
import livekit "github.com/livekit/protocol/livekit" import livekit "github.com/livekit/protocol/livekit"
import livekit3 "github.com/livekit/protocol/livekit" import livekit3 "github.com/livekit/protocol/livekit"
var _ = version.PsrpcVersion_0_2_4
// =============================== // ===============================
// EgressInternal Client Interface // EgressInternal Client Interface
// =============================== // ===============================
type EgressInternalClient interface { type EgressInternalClient interface {
StartEgress(context.Context, *livekit3.StartEgressRequest, ...psrpc1.RequestOption) (*livekit.EgressInfo, error) StartEgress(context.Context, *livekit3.StartEgressRequest, ...psrpc.RequestOption) (*livekit.EgressInfo, error)
ListActiveEgress(context.Context, *ListActiveEgressRequest, ...psrpc1.RequestOption) (<-chan *psrpc1.Response[*ListActiveEgressResponse], error) ListActiveEgress(context.Context, *ListActiveEgressRequest, ...psrpc.RequestOption) (<-chan *psrpc.Response[*ListActiveEgressResponse], error)
} }
// =================================== // ===================================
@@ -47,12 +49,12 @@ type EgressInternalServer interface {
// ===================== // =====================
type egressInternalClient struct { type egressInternalClient struct {
client *psrpc1.RPCClient client *psrpc.RPCClient
} }
// NewEgressInternalClient creates a psrpc client that implements the EgressInternalClient interface. // NewEgressInternalClient creates a psrpc client that implements the EgressInternalClient interface.
func NewEgressInternalClient(clientID string, bus psrpc1.MessageBus, opts ...psrpc1.ClientOption) (EgressInternalClient, error) { func NewEgressInternalClient(clientID string, bus psrpc.MessageBus, opts ...psrpc.ClientOption) (EgressInternalClient, error) {
rpcClient, err := psrpc1.NewRPCClient("EgressInternal", clientID, bus, opts...) rpcClient, err := psrpc.NewRPCClient("EgressInternal", clientID, bus, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -62,12 +64,12 @@ func NewEgressInternalClient(clientID string, bus psrpc1.MessageBus, opts ...psr
}, nil }, nil
} }
func (c *egressInternalClient) StartEgress(ctx context.Context, req *livekit3.StartEgressRequest, opts ...psrpc1.RequestOption) (*livekit.EgressInfo, error) { func (c *egressInternalClient) StartEgress(ctx context.Context, req *livekit3.StartEgressRequest, opts ...psrpc.RequestOption) (*livekit.EgressInfo, error) {
return psrpc1.RequestSingle[*livekit.EgressInfo](ctx, c.client, "StartEgress", "", req, opts...) return psrpc.RequestSingle[*livekit.EgressInfo](ctx, c.client, "StartEgress", "", req, opts...)
} }
func (c *egressInternalClient) ListActiveEgress(ctx context.Context, req *ListActiveEgressRequest, opts ...psrpc1.RequestOption) (<-chan *psrpc1.Response[*ListActiveEgressResponse], error) { func (c *egressInternalClient) ListActiveEgress(ctx context.Context, req *ListActiveEgressRequest, opts ...psrpc.RequestOption) (<-chan *psrpc.Response[*ListActiveEgressResponse], error) {
return psrpc1.RequestMulti[*ListActiveEgressResponse](ctx, c.client, "ListActiveEgress", "", req, opts...) return psrpc.RequestMulti[*ListActiveEgressResponse](ctx, c.client, "ListActiveEgress", "", req, opts...)
} }
// ===================== // =====================
@@ -76,22 +78,22 @@ func (c *egressInternalClient) ListActiveEgress(ctx context.Context, req *ListAc
type egressInternalServer struct { type egressInternalServer struct {
svc EgressInternalServerImpl svc EgressInternalServerImpl
rpc *psrpc1.RPCServer rpc *psrpc.RPCServer
} }
// NewEgressInternalServer builds a RPCServer that will route requests // NewEgressInternalServer builds a RPCServer that will route requests
// to the corresponding method in the provided svc implementation. // to the corresponding method in the provided svc implementation.
func NewEgressInternalServer(serverID string, svc EgressInternalServerImpl, bus psrpc1.MessageBus, opts ...psrpc1.ServerOption) (EgressInternalServer, error) { func NewEgressInternalServer(serverID string, svc EgressInternalServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (EgressInternalServer, error) {
s := psrpc1.NewRPCServer("EgressInternal", serverID, bus, opts...) s := psrpc.NewRPCServer("EgressInternal", serverID, bus, opts...)
var err error var err error
err = psrpc1.RegisterHandler(s, "StartEgress", "", svc.StartEgress, svc.StartEgressAffinity) err = psrpc.RegisterHandler(s, "StartEgress", "", svc.StartEgress, svc.StartEgressAffinity)
if err != nil { if err != nil {
s.Close(false) s.Close(false)
return nil, err return nil, err
} }
err = psrpc1.RegisterHandler(s, "ListActiveEgress", "", svc.ListActiveEgress, nil) err = psrpc.RegisterHandler(s, "ListActiveEgress", "", svc.ListActiveEgress, nil)
if err != nil { if err != nil {
s.Close(false) s.Close(false)
return nil, err return nil, err
@@ -116,9 +118,9 @@ func (s *egressInternalServer) Kill() {
// ============================== // ==============================
type EgressHandlerClient interface { type EgressHandlerClient interface {
UpdateStream(context.Context, string, *livekit.UpdateStreamRequest, ...psrpc1.RequestOption) (*livekit.EgressInfo, error) UpdateStream(context.Context, string, *livekit.UpdateStreamRequest, ...psrpc.RequestOption) (*livekit.EgressInfo, error)
StopEgress(context.Context, string, *livekit.StopEgressRequest, ...psrpc1.RequestOption) (*livekit.EgressInfo, error) StopEgress(context.Context, string, *livekit.StopEgressRequest, ...psrpc.RequestOption) (*livekit.EgressInfo, error)
} }
// ================================== // ==================================
@@ -154,12 +156,12 @@ type EgressHandlerServer interface {
// ==================== // ====================
type egressHandlerClient struct { type egressHandlerClient struct {
client *psrpc1.RPCClient client *psrpc.RPCClient
} }
// NewEgressHandlerClient creates a psrpc client that implements the EgressHandlerClient interface. // NewEgressHandlerClient creates a psrpc client that implements the EgressHandlerClient interface.
func NewEgressHandlerClient(clientID string, bus psrpc1.MessageBus, opts ...psrpc1.ClientOption) (EgressHandlerClient, error) { func NewEgressHandlerClient(clientID string, bus psrpc.MessageBus, opts ...psrpc.ClientOption) (EgressHandlerClient, error) {
rpcClient, err := psrpc1.NewRPCClient("EgressHandler", clientID, bus, opts...) rpcClient, err := psrpc.NewRPCClient("EgressHandler", clientID, bus, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -169,12 +171,12 @@ func NewEgressHandlerClient(clientID string, bus psrpc1.MessageBus, opts ...psrp
}, nil }, nil
} }
func (c *egressHandlerClient) UpdateStream(ctx context.Context, topic string, req *livekit.UpdateStreamRequest, opts ...psrpc1.RequestOption) (*livekit.EgressInfo, error) { func (c *egressHandlerClient) UpdateStream(ctx context.Context, topic string, req *livekit.UpdateStreamRequest, opts ...psrpc.RequestOption) (*livekit.EgressInfo, error) {
return psrpc1.RequestSingle[*livekit.EgressInfo](ctx, c.client, "UpdateStream", topic, req, opts...) 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 ...psrpc1.RequestOption) (*livekit.EgressInfo, error) { func (c *egressHandlerClient) StopEgress(ctx context.Context, topic string, req *livekit.StopEgressRequest, opts ...psrpc.RequestOption) (*livekit.EgressInfo, error) {
return psrpc1.RequestSingle[*livekit.EgressInfo](ctx, c.client, "StopEgress", topic, req, opts...) return psrpc.RequestSingle[*livekit.EgressInfo](ctx, c.client, "StopEgress", topic, req, opts...)
} }
// ==================== // ====================
@@ -183,13 +185,13 @@ func (c *egressHandlerClient) StopEgress(ctx context.Context, topic string, req
type egressHandlerServer struct { type egressHandlerServer struct {
svc EgressHandlerServerImpl svc EgressHandlerServerImpl
rpc *psrpc1.RPCServer rpc *psrpc.RPCServer
} }
// NewEgressHandlerServer builds a RPCServer that will route requests // NewEgressHandlerServer builds a RPCServer that will route requests
// to the corresponding method in the provided svc implementation. // to the corresponding method in the provided svc implementation.
func NewEgressHandlerServer(serverID string, svc EgressHandlerServerImpl, bus psrpc1.MessageBus, opts ...psrpc1.ServerOption) (EgressHandlerServer, error) { func NewEgressHandlerServer(serverID string, svc EgressHandlerServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (EgressHandlerServer, error) {
s := psrpc1.NewRPCServer("EgressHandler", serverID, bus, opts...) s := psrpc.NewRPCServer("EgressHandler", serverID, bus, opts...)
return &egressHandlerServer{ return &egressHandlerServer{
svc: svc, svc: svc,
@@ -198,7 +200,7 @@ func NewEgressHandlerServer(serverID string, svc EgressHandlerServerImpl, bus ps
} }
func (s *egressHandlerServer) RegisterUpdateStreamTopic(topic string) error { func (s *egressHandlerServer) RegisterUpdateStreamTopic(topic string) error {
return psrpc1.RegisterHandler(s.rpc, "UpdateStream", topic, s.svc.UpdateStream, nil) return psrpc.RegisterHandler(s.rpc, "UpdateStream", topic, s.svc.UpdateStream, nil)
} }
func (s *egressHandlerServer) DeregisterUpdateStreamTopic(topic string) { func (s *egressHandlerServer) DeregisterUpdateStreamTopic(topic string) {
@@ -206,7 +208,7 @@ func (s *egressHandlerServer) DeregisterUpdateStreamTopic(topic string) {
} }
func (s *egressHandlerServer) RegisterStopEgressTopic(topic string) error { func (s *egressHandlerServer) RegisterStopEgressTopic(topic string) error {
return psrpc1.RegisterHandler(s.rpc, "StopEgress", topic, s.svc.StopEgress, nil) return psrpc.RegisterHandler(s.rpc, "StopEgress", topic, s.svc.StopEgress, nil)
} }
func (s *egressHandlerServer) DeregisterStopEgressTopic(topic string) { func (s *egressHandlerServer) DeregisterStopEgressTopic(topic string) {
+29 -27
View File
@@ -1,19 +1,21 @@
// Code generated by protoc-gen-psrpc v0.2.3, DO NOT EDIT. // Code generated by protoc-gen-psrpc v0.2.4, DO NOT EDIT.
// source: pkg/service/rpc/ingress.proto // source: pkg/service/rpc/ingress.proto
package rpc package rpc
import context "context" import context "context"
import psrpc "github.com/livekit/psrpc"
import psrpc1 "github.com/livekit/psrpc" import version "github.com/livekit/psrpc/version"
import livekit2 "github.com/livekit/protocol/livekit" import livekit2 "github.com/livekit/protocol/livekit"
var _ = version.PsrpcVersion_0_2_4
// ================================ // ================================
// IngressInternal Client Interface // IngressInternal Client Interface
// ================================ // ================================
type IngressInternalClient interface { type IngressInternalClient interface {
ListActiveIngress(context.Context, *ListActiveIngressRequest, ...psrpc1.RequestOption) (<-chan *psrpc1.Response[*ListActiveIngressResponse], error) ListActiveIngress(context.Context, *ListActiveIngressRequest, ...psrpc.RequestOption) (<-chan *psrpc.Response[*ListActiveIngressResponse], error)
} }
// ==================================== // ====================================
@@ -41,12 +43,12 @@ type IngressInternalServer interface {
// ====================== // ======================
type ingressInternalClient struct { type ingressInternalClient struct {
client *psrpc1.RPCClient client *psrpc.RPCClient
} }
// NewIngressInternalClient creates a psrpc client that implements the IngressInternalClient interface. // NewIngressInternalClient creates a psrpc client that implements the IngressInternalClient interface.
func NewIngressInternalClient(clientID string, bus psrpc1.MessageBus, opts ...psrpc1.ClientOption) (IngressInternalClient, error) { func NewIngressInternalClient(clientID string, bus psrpc.MessageBus, opts ...psrpc.ClientOption) (IngressInternalClient, error) {
rpcClient, err := psrpc1.NewRPCClient("IngressInternal", clientID, bus, opts...) rpcClient, err := psrpc.NewRPCClient("IngressInternal", clientID, bus, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -56,8 +58,8 @@ func NewIngressInternalClient(clientID string, bus psrpc1.MessageBus, opts ...ps
}, nil }, nil
} }
func (c *ingressInternalClient) ListActiveIngress(ctx context.Context, req *ListActiveIngressRequest, opts ...psrpc1.RequestOption) (<-chan *psrpc1.Response[*ListActiveIngressResponse], error) { func (c *ingressInternalClient) ListActiveIngress(ctx context.Context, req *ListActiveIngressRequest, opts ...psrpc.RequestOption) (<-chan *psrpc.Response[*ListActiveIngressResponse], error) {
return psrpc1.RequestMulti[*ListActiveIngressResponse](ctx, c.client, "ListActiveIngress", "", req, opts...) return psrpc.RequestMulti[*ListActiveIngressResponse](ctx, c.client, "ListActiveIngress", "", req, opts...)
} }
// ====================== // ======================
@@ -66,16 +68,16 @@ func (c *ingressInternalClient) ListActiveIngress(ctx context.Context, req *List
type ingressInternalServer struct { type ingressInternalServer struct {
svc IngressInternalServerImpl svc IngressInternalServerImpl
rpc *psrpc1.RPCServer rpc *psrpc.RPCServer
} }
// NewIngressInternalServer builds a RPCServer that will route requests // NewIngressInternalServer builds a RPCServer that will route requests
// to the corresponding method in the provided svc implementation. // to the corresponding method in the provided svc implementation.
func NewIngressInternalServer(serverID string, svc IngressInternalServerImpl, bus psrpc1.MessageBus, opts ...psrpc1.ServerOption) (IngressInternalServer, error) { func NewIngressInternalServer(serverID string, svc IngressInternalServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (IngressInternalServer, error) {
s := psrpc1.NewRPCServer("IngressInternal", serverID, bus, opts...) s := psrpc.NewRPCServer("IngressInternal", serverID, bus, opts...)
var err error var err error
err = psrpc1.RegisterHandler(s, "ListActiveIngress", "", svc.ListActiveIngress, nil) err = psrpc.RegisterHandler(s, "ListActiveIngress", "", svc.ListActiveIngress, nil)
if err != nil { if err != nil {
s.Close(false) s.Close(false)
return nil, err return nil, err
@@ -100,9 +102,9 @@ func (s *ingressInternalServer) Kill() {
// =============================== // ===============================
type IngressHandlerClient interface { type IngressHandlerClient interface {
UpdateIngress(context.Context, string, *livekit2.UpdateIngressRequest, ...psrpc1.RequestOption) (*livekit2.IngressState, error) UpdateIngress(context.Context, string, *livekit2.UpdateIngressRequest, ...psrpc.RequestOption) (*livekit2.IngressState, error)
DeleteIngress(context.Context, string, *livekit2.DeleteIngressRequest, ...psrpc1.RequestOption) (*livekit2.IngressState, error) DeleteIngress(context.Context, string, *livekit2.DeleteIngressRequest, ...psrpc.RequestOption) (*livekit2.IngressState, error)
} }
// =================================== // ===================================
@@ -138,12 +140,12 @@ type IngressHandlerServer interface {
// ===================== // =====================
type ingressHandlerClient struct { type ingressHandlerClient struct {
client *psrpc1.RPCClient client *psrpc.RPCClient
} }
// NewIngressHandlerClient creates a psrpc client that implements the IngressHandlerClient interface. // NewIngressHandlerClient creates a psrpc client that implements the IngressHandlerClient interface.
func NewIngressHandlerClient(clientID string, bus psrpc1.MessageBus, opts ...psrpc1.ClientOption) (IngressHandlerClient, error) { func NewIngressHandlerClient(clientID string, bus psrpc.MessageBus, opts ...psrpc.ClientOption) (IngressHandlerClient, error) {
rpcClient, err := psrpc1.NewRPCClient("IngressHandler", clientID, bus, opts...) rpcClient, err := psrpc.NewRPCClient("IngressHandler", clientID, bus, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -153,12 +155,12 @@ func NewIngressHandlerClient(clientID string, bus psrpc1.MessageBus, opts ...psr
}, nil }, nil
} }
func (c *ingressHandlerClient) UpdateIngress(ctx context.Context, topic string, req *livekit2.UpdateIngressRequest, opts ...psrpc1.RequestOption) (*livekit2.IngressState, error) { func (c *ingressHandlerClient) UpdateIngress(ctx context.Context, topic string, req *livekit2.UpdateIngressRequest, opts ...psrpc.RequestOption) (*livekit2.IngressState, error) {
return psrpc1.RequestSingle[*livekit2.IngressState](ctx, c.client, "UpdateIngress", topic, req, opts...) return psrpc.RequestSingle[*livekit2.IngressState](ctx, c.client, "UpdateIngress", topic, req, opts...)
} }
func (c *ingressHandlerClient) DeleteIngress(ctx context.Context, topic string, req *livekit2.DeleteIngressRequest, opts ...psrpc1.RequestOption) (*livekit2.IngressState, error) { func (c *ingressHandlerClient) DeleteIngress(ctx context.Context, topic string, req *livekit2.DeleteIngressRequest, opts ...psrpc.RequestOption) (*livekit2.IngressState, error) {
return psrpc1.RequestSingle[*livekit2.IngressState](ctx, c.client, "DeleteIngress", topic, req, opts...) return psrpc.RequestSingle[*livekit2.IngressState](ctx, c.client, "DeleteIngress", topic, req, opts...)
} }
// ===================== // =====================
@@ -167,13 +169,13 @@ func (c *ingressHandlerClient) DeleteIngress(ctx context.Context, topic string,
type ingressHandlerServer struct { type ingressHandlerServer struct {
svc IngressHandlerServerImpl svc IngressHandlerServerImpl
rpc *psrpc1.RPCServer rpc *psrpc.RPCServer
} }
// NewIngressHandlerServer builds a RPCServer that will route requests // NewIngressHandlerServer builds a RPCServer that will route requests
// to the corresponding method in the provided svc implementation. // to the corresponding method in the provided svc implementation.
func NewIngressHandlerServer(serverID string, svc IngressHandlerServerImpl, bus psrpc1.MessageBus, opts ...psrpc1.ServerOption) (IngressHandlerServer, error) { func NewIngressHandlerServer(serverID string, svc IngressHandlerServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (IngressHandlerServer, error) {
s := psrpc1.NewRPCServer("IngressHandler", serverID, bus, opts...) s := psrpc.NewRPCServer("IngressHandler", serverID, bus, opts...)
return &ingressHandlerServer{ return &ingressHandlerServer{
svc: svc, svc: svc,
@@ -182,7 +184,7 @@ func NewIngressHandlerServer(serverID string, svc IngressHandlerServerImpl, bus
} }
func (s *ingressHandlerServer) RegisterUpdateIngressTopic(topic string) error { func (s *ingressHandlerServer) RegisterUpdateIngressTopic(topic string) error {
return psrpc1.RegisterHandler(s.rpc, "UpdateIngress", topic, s.svc.UpdateIngress, nil) return psrpc.RegisterHandler(s.rpc, "UpdateIngress", topic, s.svc.UpdateIngress, nil)
} }
func (s *ingressHandlerServer) DeregisterUpdateIngressTopic(topic string) { func (s *ingressHandlerServer) DeregisterUpdateIngressTopic(topic string) {
@@ -190,7 +192,7 @@ func (s *ingressHandlerServer) DeregisterUpdateIngressTopic(topic string) {
} }
func (s *ingressHandlerServer) RegisterDeleteIngressTopic(topic string) error { func (s *ingressHandlerServer) RegisterDeleteIngressTopic(topic string) error {
return psrpc1.RegisterHandler(s.rpc, "DeleteIngress", topic, s.svc.DeleteIngress, nil) return psrpc.RegisterHandler(s.rpc, "DeleteIngress", topic, s.svc.DeleteIngress, nil)
} }
func (s *ingressHandlerServer) DeregisterDeleteIngressTopic(topic string) { func (s *ingressHandlerServer) DeregisterDeleteIngressTopic(topic string) {
+23 -21
View File
@@ -1,25 +1,27 @@
// Code generated by protoc-gen-psrpc v0.2.3, DO NOT EDIT. // Code generated by protoc-gen-psrpc v0.2.4, DO NOT EDIT.
// source: pkg/service/rpc/io.proto // source: pkg/service/rpc/io.proto
package rpc package rpc
import context "context" import context "context"
import psrpc "github.com/livekit/psrpc"
import psrpc1 "github.com/livekit/psrpc" import version "github.com/livekit/psrpc/version"
import google_protobuf2 "google.golang.org/protobuf/types/known/emptypb" import google_protobuf2 "google.golang.org/protobuf/types/known/emptypb"
import livekit "github.com/livekit/protocol/livekit" import livekit "github.com/livekit/protocol/livekit"
import livekit3 "github.com/livekit/protocol/livekit" import livekit3 "github.com/livekit/protocol/livekit"
var _ = version.PsrpcVersion_0_2_4
// ======================= // =======================
// IOInfo Client Interface // IOInfo Client Interface
// ======================= // =======================
type IOInfoClient interface { type IOInfoClient interface {
UpdateEgressInfo(context.Context, *livekit.EgressInfo, ...psrpc1.RequestOption) (*google_protobuf2.Empty, error) UpdateEgressInfo(context.Context, *livekit.EgressInfo, ...psrpc.RequestOption) (*google_protobuf2.Empty, error)
GetIngressInfo(context.Context, *livekit3.GetIngressInfoRequest, ...psrpc1.RequestOption) (*livekit3.GetIngressInfoResponse, error) GetIngressInfo(context.Context, *livekit3.GetIngressInfoRequest, ...psrpc.RequestOption) (*livekit3.GetIngressInfoResponse, error)
UpdateIngressState(context.Context, *livekit3.UpdateIngressStateRequest, ...psrpc1.RequestOption) (*google_protobuf2.Empty, error) UpdateIngressState(context.Context, *livekit3.UpdateIngressStateRequest, ...psrpc.RequestOption) (*google_protobuf2.Empty, error)
} }
// =========================== // ===========================
@@ -51,12 +53,12 @@ type IOInfoServer interface {
// ============= // =============
type iOInfoClient struct { type iOInfoClient struct {
client *psrpc1.RPCClient client *psrpc.RPCClient
} }
// NewIOInfoClient creates a psrpc client that implements the IOInfoClient interface. // NewIOInfoClient creates a psrpc client that implements the IOInfoClient interface.
func NewIOInfoClient(clientID string, bus psrpc1.MessageBus, opts ...psrpc1.ClientOption) (IOInfoClient, error) { func NewIOInfoClient(clientID string, bus psrpc.MessageBus, opts ...psrpc.ClientOption) (IOInfoClient, error) {
rpcClient, err := psrpc1.NewRPCClient("IOInfo", clientID, bus, opts...) rpcClient, err := psrpc.NewRPCClient("IOInfo", clientID, bus, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -66,16 +68,16 @@ func NewIOInfoClient(clientID string, bus psrpc1.MessageBus, opts ...psrpc1.Clie
}, nil }, nil
} }
func (c *iOInfoClient) UpdateEgressInfo(ctx context.Context, req *livekit.EgressInfo, opts ...psrpc1.RequestOption) (*google_protobuf2.Empty, error) { func (c *iOInfoClient) UpdateEgressInfo(ctx context.Context, req *livekit.EgressInfo, opts ...psrpc.RequestOption) (*google_protobuf2.Empty, error) {
return psrpc1.RequestSingle[*google_protobuf2.Empty](ctx, c.client, "UpdateEgressInfo", "", req, opts...) return psrpc.RequestSingle[*google_protobuf2.Empty](ctx, c.client, "UpdateEgressInfo", "", req, opts...)
} }
func (c *iOInfoClient) GetIngressInfo(ctx context.Context, req *livekit3.GetIngressInfoRequest, opts ...psrpc1.RequestOption) (*livekit3.GetIngressInfoResponse, error) { func (c *iOInfoClient) GetIngressInfo(ctx context.Context, req *livekit3.GetIngressInfoRequest, opts ...psrpc.RequestOption) (*livekit3.GetIngressInfoResponse, error) {
return psrpc1.RequestSingle[*livekit3.GetIngressInfoResponse](ctx, c.client, "GetIngressInfo", "", req, opts...) return psrpc.RequestSingle[*livekit3.GetIngressInfoResponse](ctx, c.client, "GetIngressInfo", "", req, opts...)
} }
func (c *iOInfoClient) UpdateIngressState(ctx context.Context, req *livekit3.UpdateIngressStateRequest, opts ...psrpc1.RequestOption) (*google_protobuf2.Empty, error) { func (c *iOInfoClient) UpdateIngressState(ctx context.Context, req *livekit3.UpdateIngressStateRequest, opts ...psrpc.RequestOption) (*google_protobuf2.Empty, error) {
return psrpc1.RequestSingle[*google_protobuf2.Empty](ctx, c.client, "UpdateIngressState", "", req, opts...) return psrpc.RequestSingle[*google_protobuf2.Empty](ctx, c.client, "UpdateIngressState", "", req, opts...)
} }
// ============= // =============
@@ -84,28 +86,28 @@ func (c *iOInfoClient) UpdateIngressState(ctx context.Context, req *livekit3.Upd
type iOInfoServer struct { type iOInfoServer struct {
svc IOInfoServerImpl svc IOInfoServerImpl
rpc *psrpc1.RPCServer rpc *psrpc.RPCServer
} }
// NewIOInfoServer builds a RPCServer that will route requests // NewIOInfoServer builds a RPCServer that will route requests
// to the corresponding method in the provided svc implementation. // to the corresponding method in the provided svc implementation.
func NewIOInfoServer(serverID string, svc IOInfoServerImpl, bus psrpc1.MessageBus, opts ...psrpc1.ServerOption) (IOInfoServer, error) { func NewIOInfoServer(serverID string, svc IOInfoServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (IOInfoServer, error) {
s := psrpc1.NewRPCServer("IOInfo", serverID, bus, opts...) s := psrpc.NewRPCServer("IOInfo", serverID, bus, opts...)
var err error var err error
err = psrpc1.RegisterHandler(s, "UpdateEgressInfo", "", svc.UpdateEgressInfo, nil) err = psrpc.RegisterHandler(s, "UpdateEgressInfo", "", svc.UpdateEgressInfo, nil)
if err != nil { if err != nil {
s.Close(false) s.Close(false)
return nil, err return nil, err
} }
err = psrpc1.RegisterHandler(s, "GetIngressInfo", "", svc.GetIngressInfo, nil) err = psrpc.RegisterHandler(s, "GetIngressInfo", "", svc.GetIngressInfo, nil)
if err != nil { if err != nil {
s.Close(false) s.Close(false)
return nil, err return nil, err
} }
err = psrpc1.RegisterHandler(s, "UpdateIngressState", "", svc.UpdateIngressState, nil) err = psrpc.RegisterHandler(s, "UpdateIngressState", "", svc.UpdateIngressState, nil)
if err != nil { if err != nil {
s.Close(false) s.Close(false)
return nil, err return nil, err