config

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultRTMPPort      = 1935
	DefaultWHIPPort      = 8080
	DefaultHTTPRelayPort = 9090
)

Variables

View Source
var (
	DefaultICEPortRange = []uint16{2000, 4000}
)

Functions

This section is empty.

Types

type CPUCostConfig

type CPUCostConfig struct {
	RTMPCpuCost                  float64 `yaml:"rtmp_cpu_cost"`
	WHIPCpuCost                  float64 `yaml:"whip_cpu_cost"`
	WHIPBypassTranscodingCpuCost float64 `yaml:"whip_bypass_transcoding_cpu_cost"`
	URLCpuCost                   float64 `yaml:"url_cpu_cost"`
	MinIdleRatio                 float64 `yaml:"min_idle_ratio"` // Target idle cpu ratio when deciding availability for new requests
}

type Config

type Config struct {
	*ServiceConfig  `yaml:",inline"`
	*InternalConfig `yaml:",inline"`
}

func NewConfig

func NewConfig(confString string) (*Config, error)

func (*Config) GetLoggerFields added in v0.9.0

func (c *Config) GetLoggerFields() logrus.Fields

GetLoggerFields - to use with logrus

func (*Config) Init added in v1.0.0

func (c *Config) Init() error

func (*Config) InitLogger

func (c *Config) InitLogger(values ...interface{}) error

type InternalConfig added in v1.2.2

type InternalConfig struct {
	// internal
	ServiceName string `yaml:"service_name"`
	NodeID      string `yaml:"node_id"` // Do not provide, will be overwritten
}

type ServiceConfig added in v1.2.2

type ServiceConfig struct {
	Redis     *redis.RedisConfig `yaml:"redis"`      // required
	ApiKey    string             `yaml:"api_key"`    // required (env LIVEKIT_API_KEY)
	ApiSecret string             `yaml:"api_secret"` // required (env LIVEKIT_API_SECRET)
	WsUrl     string             `yaml:"ws_url"`     // required (env LIVEKIT_WS_URL)

	HealthPort       int             `yaml:"health_port"`
	DebugHandlerPort int             `yaml:"debug_handler_port"`
	PrometheusPort   int             `yaml:"prometheus_port"`
	RTMPPort         int             `yaml:"rtmp_port"` // -1 to disable RTMP
	WHIPPort         int             `yaml:"whip_port"` // -1 to disable WHIP
	HTTPRelayPort    int             `yaml:"http_relay_port"`
	Logging          logger.Config   `yaml:"logging"`
	Development      bool            `yaml:"development"`
	PSRPCSkipClaim   bool            `yaml:"psrpc_skip_claim,omitempty"` // Lets psrpc servers skip the claim handshake on queue rpcs
	PSRPC            rpc.PSRPCConfig `yaml:"psrpc,omitempty"`
	// Allow URL pull ingresses to pull from udp:// urls. Disabled by default, and should only be
	// enabled on deployments where both the API callers and the network the handlers run on are trusted.
	// Unlike the http and srt sources, udpsrc doesn't connect out to the url host: it binds a local
	// socket on the address and port taken from the caller provided url, and joins the multicast group
	// if one is given. This has a few consequences:
	//   - The caller controls which local port the handler binds, and can collide with other services
	//     running on the host.
	//   - UDP is connectionless and unauthenticated, so any host able to reach that port can inject
	//     media into the session, or spoof the sender address to disrupt a legitimate feed.
	//   - The caller can make the handler join arbitrary multicast groups and republish whatever
	//     traffic it receives into a LiveKit room, turning the ingress into a relay for streams on
	//     the handler's local network that the caller couldn't otherwise reach.
	EnableUDPURLPull bool `yaml:"enable_udp_url_pull,omitempty"`
	// Network interface to join multicast groups on for UDP url pull. Empty means let the OS decide.
	MulticastInterface string `yaml:"multicast_interface,omitempty"`

	// Used for WHIP transport
	RTCConfig rtcconfig.RTCConfig `yaml:"rtc_config"`

	// CPU costs for various ingress types
	CPUCost CPUCostConfig `yaml:"cpu_cost"`

	// Experimental config
	// Reduces ingest e2e latency by dropping excess preroll buffers
	EnableStreamLatencyReduction bool `yaml:"enable_stream_latency_reduction"`

	// LoggerTee duplicates the log stream InitLogger builds. Set it before
	// Init; the zero value is a no-op.
	LoggerTee zaputil.Tee `yaml:"-"`
}

func (*ServiceConfig) InitDefaults added in v1.2.2

func (c *ServiceConfig) InitDefaults() error

func (*ServiceConfig) InitWhipConf added in v1.2.2

func (c *ServiceConfig) InitWhipConf() error

func (*ServiceConfig) SkipClaimEnabled added in v1.6.0

func (c *ServiceConfig) SkipClaimEnabled() bool

SkipClaimEnabled gates psrpc.WithServerSkipClaim on the ingress rpc servers.

Jump to

Keyboard shortcuts

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