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
+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
package rpc
import context "context"
import psrpc1 "github.com/livekit/psrpc"
import psrpc "github.com/livekit/psrpc"
import version "github.com/livekit/psrpc/version"
import google_protobuf2 "google.golang.org/protobuf/types/known/emptypb"
import livekit "github.com/livekit/protocol/livekit"
import livekit3 "github.com/livekit/protocol/livekit"
var _ = version.PsrpcVersion_0_2_4
// =======================
// IOInfo Client 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 {
client *psrpc1.RPCClient
client *psrpc.RPCClient
}
// NewIOInfoClient creates a psrpc client that implements the IOInfoClient interface.
func NewIOInfoClient(clientID string, bus psrpc1.MessageBus, opts ...psrpc1.ClientOption) (IOInfoClient, error) {
rpcClient, err := psrpc1.NewRPCClient("IOInfo", clientID, bus, opts...)
func NewIOInfoClient(clientID string, bus psrpc.MessageBus, opts ...psrpc.ClientOption) (IOInfoClient, error) {
rpcClient, err := psrpc.NewRPCClient("IOInfo", clientID, bus, opts...)
if err != nil {
return nil, err
}
@@ -66,16 +68,16 @@ func NewIOInfoClient(clientID string, bus psrpc1.MessageBus, opts ...psrpc1.Clie
}, nil
}
func (c *iOInfoClient) UpdateEgressInfo(ctx context.Context, req *livekit.EgressInfo, opts ...psrpc1.RequestOption) (*google_protobuf2.Empty, error) {
return psrpc1.RequestSingle[*google_protobuf2.Empty](ctx, c.client, "UpdateEgressInfo", "", req, opts...)
func (c *iOInfoClient) UpdateEgressInfo(ctx context.Context, req *livekit.EgressInfo, opts ...psrpc.RequestOption) (*google_protobuf2.Empty, error) {
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) {
return psrpc1.RequestSingle[*livekit3.GetIngressInfoResponse](ctx, c.client, "GetIngressInfo", "", req, opts...)
func (c *iOInfoClient) GetIngressInfo(ctx context.Context, req *livekit3.GetIngressInfoRequest, opts ...psrpc.RequestOption) (*livekit3.GetIngressInfoResponse, error) {
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) {
return psrpc1.RequestSingle[*google_protobuf2.Empty](ctx, c.client, "UpdateIngressState", "", req, opts...)
func (c *iOInfoClient) UpdateIngressState(ctx context.Context, req *livekit3.UpdateIngressStateRequest, opts ...psrpc.RequestOption) (*google_protobuf2.Empty, error) {
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 {
svc IOInfoServerImpl
rpc *psrpc1.RPCServer
rpc *psrpc.RPCServer
}
// NewIOInfoServer builds a RPCServer that will route requests
// to the corresponding method in the provided svc implementation.
func NewIOInfoServer(serverID string, svc IOInfoServerImpl, bus psrpc1.MessageBus, opts ...psrpc1.ServerOption) (IOInfoServer, error) {
s := psrpc1.NewRPCServer("IOInfo", serverID, bus, opts...)
func NewIOInfoServer(serverID string, svc IOInfoServerImpl, bus psrpc.MessageBus, opts ...psrpc.ServerOption) (IOInfoServer, error) {
s := psrpc.NewRPCServer("IOInfo", serverID, bus, opts...)
var err error
err = psrpc1.RegisterHandler(s, "UpdateEgressInfo", "", svc.UpdateEgressInfo, nil)
err = psrpc.RegisterHandler(s, "UpdateEgressInfo", "", svc.UpdateEgressInfo, nil)
if err != nil {
s.Close(false)
return nil, err
}
err = psrpc1.RegisterHandler(s, "GetIngressInfo", "", svc.GetIngressInfo, nil)
err = psrpc.RegisterHandler(s, "GetIngressInfo", "", svc.GetIngressInfo, nil)
if err != nil {
s.Close(false)
return nil, err
}
err = psrpc1.RegisterHandler(s, "UpdateIngressState", "", svc.UpdateIngressState, nil)
err = psrpc.RegisterHandler(s, "UpdateIngressState", "", svc.UpdateIngressState, nil)
if err != nil {
s.Close(false)
return nil, err