egress

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestExpiration = time.Second * 2
)

Variables

View Source
var (
	ErrNoResponse     = errors.New("no response from egress service")
	ErrEgressTimedOut = errors.New("egress timed out")
)

Functions

func BuildEgressToken

func BuildEgressToken(egressID, apiKey, secret, roomName string) (string, error)

Types

type RPCClient

type RPCClient interface {
	// GetUpdateChannel returns a subscription for egress info updates
	GetUpdateChannel(ctx context.Context) (utils.PubSub, error)
	// SendRequest sends a request to all available instances
	SendRequest(ctx context.Context, req proto.Message) (*livekit.EgressInfo, error)
}

RPCClient is used by LiveKit Server

func NewRedisRPCClient

func NewRedisRPCClient(nodeID livekit.NodeID, rc *redis.Client) RPCClient

type RPCServer

type RPCServer interface {
	// GetRequestChannel returns a subscription for egress requests
	GetRequestChannel(ctx context.Context) (utils.PubSub, error)
	// ClaimRequest is used to take ownership of a request
	ClaimRequest(ctx context.Context, request *livekit.StartEgressRequest) (bool, error)
	// EgressSubscription subscribes to requests for a specific egress ID
	EgressSubscription(ctx context.Context, egressID string) (utils.PubSub, error)
	// SendResponse returns an RPC response
	SendResponse(ctx context.Context, request proto.Message, info *livekit.EgressInfo, err error) error
	// SendUpdate sends an egress info update
	SendUpdate(ctx context.Context, info *livekit.EgressInfo) error
}

RPCServer is used by Egress

func NewRedisRPCServer

func NewRedisRPCServer(rc *redis.Client) RPCServer

type RedisRPC

type RedisRPC struct {
	// contains filtered or unexported fields
}

func (*RedisRPC) ClaimRequest

func (r *RedisRPC) ClaimRequest(ctx context.Context, req *livekit.StartEgressRequest) (bool, error)

func (*RedisRPC) EgressSubscription

func (r *RedisRPC) EgressSubscription(ctx context.Context, egressID string) (utils.PubSub, error)

func (*RedisRPC) GetRequestChannel

func (r *RedisRPC) GetRequestChannel(ctx context.Context) (utils.PubSub, error)

func (*RedisRPC) GetUpdateChannel

func (r *RedisRPC) GetUpdateChannel(ctx context.Context) (utils.PubSub, error)

func (*RedisRPC) SendRequest

func (r *RedisRPC) SendRequest(ctx context.Context, request proto.Message) (*livekit.EgressInfo, error)

func (*RedisRPC) SendResponse

func (r *RedisRPC) SendResponse(ctx context.Context, request proto.Message, info *livekit.EgressInfo, err error) error

func (*RedisRPC) SendUpdate

func (r *RedisRPC) SendUpdate(ctx context.Context, info *livekit.EgressInfo) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL