config

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiConfig added in v1.0.4

type ApiConfig struct {
	Enabled bool   `yaml:"enabled"`
	URI     string `yaml:"uri"`
}

type Config

type Config struct {
	ICEConfig map[string]ICEConfig `yaml:"ice_servers"`
	Logging   LoggingConfig        `yaml:"logging"`

	WebRTCConfig webrtc.Configuration
	// TODO the following should be different for answerer and offerer sides
	OnICECandidate          func(*webrtc.ICECandidate)
	OnConnectionStateChange func(s webrtc.PeerConnectionState)

	// internal
	ServiceName string `yaml:"-"`
	NodeID      string // Do not provide, will be overwritten
	Logger      *slog.Logger
	Registry    *prometheus.Registry
}

func NewConfig

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

type ICEConfig

type ICEConfig struct {
	Username     string           `yaml:"username,omitempty"`
	Password     string           `yaml:"password,omitempty"`
	ApiKey       string           `yaml:"api_key,omitempty"`
	AccountSid   string           `yaml:"account_sid,omitempty"`
	RequestUrl   string           `yaml:"request_url,omitempty"`
	HttpUsername string           `yaml:"http_username"`
	HttpPassword string           `yaml:"http_password"`
	Enabled      bool             `yaml:"enabled"`
	StunHost     string           `yaml:"stun_host,omitempty"`
	TurnHost     string           `yaml:"turn_host,omitempty"`
	TurnPorts    map[string][]int `yaml:"turn_ports,omitempty"`
	StunPorts    map[string][]int `yaml:"stun_ports,omitempty"`
	StunEnabled  bool             `yaml:"stun_enabled"`
	TurnEnabled  bool             `yaml:"turn_enabled"`
}

type LoggingConfig

type LoggingConfig struct {
	Level      string     `yaml:"level"`
	API        ApiConfig  `yaml:"api"`
	Loki       LokiConfig `yaml:"loki"`
	Prometheus PromConfig `yaml:"prometheus"`
}

type LokiConfig

type LokiConfig struct {
	Enabled        bool              `yaml:"enabled"`
	UseBasicAuth   bool              `yaml:"use_basic_auth"`
	UseHeadersAuth bool              `yaml:"use_headers_auth"`
	Username       string            `yaml:"username,omitempty"`
	Password       string            `yaml:"password,omitempty"`
	URL            string            `yaml:"url"`
	AuthHeaders    map[string]string `yaml:"auth_headers,omitempty"`
}

type PromConfig added in v1.0.4

type PromConfig struct {
	Enabled     bool              `yaml:"enabled"`
	URL         string            `yaml:"url"`
	AuthHeaders map[string]string `yaml:"auth_headers,omitempty"`
}

Jump to

Keyboard shortcuts

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