* add ingress psrpc codegen * use psrpc for ingress * merge entity/info update psrpc services * split update/delete ingress methods * add race helper test * add race context cancel test * sync race result with mutex
128 lines
4.3 KiB
Go
128 lines
4.3 KiB
Go
// Code generated by protoc-gen-psrpc v0.2.2, DO NOT EDIT.
|
|
// source: pkg/service/rpc/io.proto
|
|
|
|
package rpc
|
|
|
|
import context "context"
|
|
|
|
import psrpc1 "github.com/livekit/psrpc"
|
|
import livekit3 "github.com/livekit/protocol/livekit"
|
|
|
|
// =======================
|
|
// IOInfo Client Interface
|
|
// =======================
|
|
|
|
type IOInfoClient interface {
|
|
GetIngressInfo(context.Context, *livekit3.GetIngressInfoRequest, ...psrpc1.RequestOption) (*livekit3.GetIngressInfoResponse, error)
|
|
|
|
UpdateIngressState(context.Context, *livekit3.UpdateIngressStateRequest, ...psrpc1.RequestOption) (*Ignored, error)
|
|
}
|
|
|
|
// ===========================
|
|
// IOInfo ServerImpl Interface
|
|
// ===========================
|
|
|
|
type IOInfoServerImpl interface {
|
|
GetIngressInfo(context.Context, *livekit3.GetIngressInfoRequest) (*livekit3.GetIngressInfoResponse, error)
|
|
|
|
UpdateIngressState(context.Context, *livekit3.UpdateIngressStateRequest) (*Ignored, error)
|
|
}
|
|
|
|
// =======================
|
|
// IOInfo Server Interface
|
|
// =======================
|
|
|
|
type IOInfoServer interface {
|
|
// Close and wait for pending RPCs to complete
|
|
Shutdown()
|
|
|
|
// Close immediately, without waiting for pending RPCs
|
|
Kill()
|
|
}
|
|
|
|
// =============
|
|
// IOInfo Client
|
|
// =============
|
|
|
|
type iOInfoClient struct {
|
|
client *psrpc1.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...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &iOInfoClient{
|
|
client: rpcClient,
|
|
}, nil
|
|
}
|
|
|
|
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) UpdateIngressState(ctx context.Context, req *livekit3.UpdateIngressStateRequest, opts ...psrpc1.RequestOption) (*Ignored, error) {
|
|
return psrpc1.RequestSingle[*Ignored](ctx, c.client, "UpdateIngressState", "", req, opts...)
|
|
}
|
|
|
|
// =============
|
|
// IOInfo Server
|
|
// =============
|
|
|
|
type iOInfoServer struct {
|
|
svc IOInfoServerImpl
|
|
rpc *psrpc1.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...)
|
|
|
|
var err error
|
|
err = psrpc1.RegisterHandler(s, "GetIngressInfo", "", svc.GetIngressInfo, nil)
|
|
if err != nil {
|
|
s.Close(false)
|
|
return nil, err
|
|
}
|
|
|
|
err = psrpc1.RegisterHandler(s, "UpdateIngressState", "", svc.UpdateIngressState, nil)
|
|
if err != nil {
|
|
s.Close(false)
|
|
return nil, err
|
|
}
|
|
|
|
return &iOInfoServer{
|
|
svc: svc,
|
|
rpc: s,
|
|
}, nil
|
|
}
|
|
|
|
func (s *iOInfoServer) Shutdown() {
|
|
s.rpc.Close(false)
|
|
}
|
|
|
|
func (s *iOInfoServer) Kill() {
|
|
s.rpc.Close(true)
|
|
}
|
|
|
|
var psrpcFileDescriptor2 = []byte{
|
|
// 201 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0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