ingress

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 (
	ErrIngressOutOfDate = errors.New("trying to ovewrite an ingress with an older version")
	ErrIngressTimedOut  = errors.New("ingress timed out")
	ErrNoResponse       = errors.New("no response from ingress service")
)

Functions

func BuildIngressToken

func BuildIngressToken(apiKey, secret, roomName, participantIdentity, participantName string) (string, error)

Types

type RPC

type RPC interface {
	RPCClient
	RPCServer
}

func NewRedisRPC

func NewRedisRPC(nodeID livekit.NodeID, rc *redis.Client) RPC

type RPCClient

type RPCClient interface {
	// GetUpdateChannel returns a subscription for ingress info updates
	GetUpdateChannel(ctx context.Context) (utils.PubSub, error)
	// GetEntityChannel returns a subscription for entity requests
	GetEntityChannel(ctx context.Context) (utils.PubSub, error)
	// SendRequest sends a request to all available instances
	SendRequest(ctx context.Context, req *livekit.IngressRequest) (*livekit.IngressInfo, error)
	// SendResponse returns a GetIngressInfo response
	SendGetIngressInfoResponse(ctx context.Context, req *livekit.GetIngressInfoRequest, resp *livekit.GetIngressInfoResponse, err error) error
}

RPCClient is used by LiveKit Server

type RPCServer

type RPCServer interface {
	// IngressSubscription subscribes to requests for a specific ingress ID
	IngressSubscription(ctx context.Context, ingressID string) (utils.PubSub, error)
	// SendResponse returns an RPC response
	SendResponse(ctx context.Context, request *livekit.IngressRequest, info *livekit.IngressInfo, err error) error
	// SendUpdate sends an ingress info update
	SendUpdate(ctx context.Context, info *livekit.IngressInfo) error
	// SendGetIngressInfoRequest sends a request to all available instances
	SendGetIngressInfoRequest(ctx context.Context, req *livekit.GetIngressInfoRequest) (*livekit.GetIngressInfoResponse, error)
}

RPCServer is used by Ingress

type RedisRPC

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

func (*RedisRPC) GetEntityChannel

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

func (*RedisRPC) GetUpdateChannel

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

func (*RedisRPC) IngressSubscription

func (r *RedisRPC) IngressSubscription(ctx context.Context, ingressID string) (utils.PubSub, error)

func (*RedisRPC) SendGetIngressInfoRequest

func (r *RedisRPC) SendGetIngressInfoRequest(ctx context.Context, req *livekit.GetIngressInfoRequest) (*livekit.GetIngressInfoResponse, error)

func (*RedisRPC) SendGetIngressInfoResponse

func (r *RedisRPC) SendGetIngressInfoResponse(ctx context.Context, req *livekit.GetIngressInfoRequest, resp *livekit.GetIngressInfoResponse, err error) error

func (*RedisRPC) SendRequest

func (r *RedisRPC) SendRequest(ctx context.Context, req *livekit.IngressRequest) (*livekit.IngressInfo, error)

func (*RedisRPC) SendResponse

func (r *RedisRPC) SendResponse(ctx context.Context, req *livekit.IngressRequest, info *livekit.IngressInfo, err error) error

func (*RedisRPC) SendUpdate

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

Jump to

Keyboard shortcuts

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