Add support for ingress ParticipantMetadata (#2461)

This commit is contained in:
Benjamin Pracht
2024-02-08 13:59:26 -08:00
committed by GitHub
parent d20811d1c2
commit b659fef8ed
4 changed files with 17 additions and 9 deletions
+10 -6
View File
@@ -33,8 +33,10 @@ import (
"github.com/livekit/protocol/rpc"
)
type CongestionControlProbeMode string
type StreamTrackerType string
type (
CongestionControlProbeMode string
StreamTrackerType string
)
const (
generatedCLIFlagUsage = "generated"
@@ -294,8 +296,7 @@ type IngressConfig struct {
WHIPBaseURL string `yaml:"whip_base_url,omitempty"`
}
type SIPConfig struct {
}
type SIPConfig struct{}
type APIConfig struct {
// amount of time to wait for API to execute, default 2s
@@ -639,10 +640,10 @@ func (conf *Config) ToCLIFlagNames(existingFlags []cli.Flag) map[string]reflect.
func (conf *Config) ValidateKeys() error {
// prefer keyfile if set
if conf.KeyFile != "" {
var otherFilter os.FileMode = 0007
var otherFilter os.FileMode = 0o007
if st, err := os.Stat(conf.KeyFile); err != nil {
return err
} else if st.Mode().Perm()&otherFilter != 0000 {
} else if st.Mode().Perm()&otherFilter != 0o000 {
return ErrKeyFileIncorrectPermission
}
f, err := os.Open(conf.KeyFile)
@@ -747,6 +748,9 @@ func GenerateCLIFlags(existingFlags []cli.Flag, hidden bool) ([]cli.Flag, error)
case reflect.Map:
// TODO
continue
case reflect.Struct:
// TODO
continue
default:
return flags, fmt.Errorf("cli flag generation unsupported for config type: %s is a %s", name, kind.String())
}
+4
View File
@@ -156,6 +156,7 @@ func (s *IngressService) CreateIngressWithUrl(ctx context.Context, urlStr string
RoomName: req.RoomName,
ParticipantIdentity: req.ParticipantIdentity,
ParticipantName: req.ParticipantName,
ParticipantMetadata: req.ParticipantMetadata,
State: &livekit.IngressState{},
}
@@ -224,6 +225,9 @@ func updateInfoUsingRequest(req *livekit.UpdateIngressRequest, info *livekit.Ing
if req.BypassTranscoding != nil {
info.BypassTranscoding = *req.BypassTranscoding
}
if req.ParticipantMetadata != "" {
info.ParticipantMetadata = req.ParticipantMetadata
}
if req.Audio != nil {
info.Audio = req.Audio
}