config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: Apache-2.0 Imports: 10 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      int = 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"`
}

type Config

type Config 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"`
	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"`

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

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

	// internal
	ServiceName string `yaml:"-"`
	NodeID      string `yaml:"-"`
}

func NewConfig

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

func (*Config) GetLoggerFields added in v0.9.0

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

To use with logrus

func (*Config) GetLoggerValues added in v0.9.0

func (c *Config) GetLoggerValues() []interface{}

To use with zap logger

func (*Config) Init added in v1.0.0

func (conf *Config) Init() error

func (*Config) InitLogger

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

func (*Config) InitWhipConf added in v1.0.0

func (c *Config) InitWhipConf() error

Jump to

Keyboard shortcuts

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