Skip to content

Commit

Permalink
add CreateEgress to test server
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 committed Oct 18, 2023
1 parent 5fd61d4 commit 5c0beef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pkg/service/ioclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ func NewIOClient(nodeID string, bus psrpc.MessageBus) (rpc.IOInfoClient, error)
}, nil
}

func (c *IOClient) CreateEgress(ctx context.Context, info *livekit.EgressInfo, opts ...psrpc.RequestOption) (*emptypb.Empty, error) {
// TODO: add retries, log errors
return c.IOInfoClient.CreateEgress(ctx, info, opts...)
}

func (c *IOClient) UpdateEgress(ctx context.Context, info *livekit.EgressInfo, opts ...psrpc.RequestOption) (*emptypb.Empty, error) {
requestType, outputType := egress.GetTypes(info.Request)
switch info.Status {
Expand All @@ -52,5 +57,5 @@ func (c *IOClient) UpdateEgress(ctx context.Context, info *livekit.EgressInfo, o
}

// TODO: add retries, log errors
return c.IOInfoClient.UpdateEgress(ctx, info)
return c.IOInfoClient.UpdateEgress(ctx, info, opts...)
}
6 changes: 5 additions & 1 deletion test/ioserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ func newIOTestServer(bus psrpc.MessageBus, updates chan *livekit.EgressInfo) (*i
return s, nil
}

func (s *ioTestServer) UpdateEgressInfo(_ context.Context, info *livekit.EgressInfo) (*emptypb.Empty, error) {
func (s *ioTestServer) CreateEgress(_ context.Context, info *livekit.EgressInfo) (*emptypb.Empty, error) {
return &emptypb.Empty{}, nil
}

func (s *ioTestServer) UpdateEgress(_ context.Context, info *livekit.EgressInfo) (*emptypb.Empty, error) {
s.updates <- info
return &emptypb.Empty{}, nil
}

0 comments on commit 5c0beef

Please sign in to comment.