config

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 9 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   `json:"enabled" yaml:"enabled"`
	URI     string `json:"uri" yaml:"uri"`
	ApiKey  string `json:"apiKey,omitempty" yaml:"api_key,omitempty"`
}

type Config

type Config struct {
	NodeID    string               `json:"nodeId" yaml:"node_id"`
	ICEConfig map[string]ICEConfig `json:"iceServers" yaml:"ice_servers"`
	Logging   LoggingConfig        `json:"logging" yaml:"logging"`
	Timer     TimerConfig          `json:"timer" yaml:"timer"`
	Api       ApiConfig            `json:"api" yaml:"api"`

	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:"-"`
	Logger      *slog.Logger
	Registry    *prometheus.Registry
}

func NewConfig

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

func (*Config) UpdateConfigFromApi added in v1.1.0

func (c *Config) UpdateConfigFromApi() error

type ICEConfig

type ICEConfig struct {
	Username          string           `yaml:"username,omitempty"`
	Password          string           `yaml:"password,omitempty"`
	ApiKey            string           `json:"apiKey,omitempty" yaml:"api_key,omitempty"`
	AccountSid        string           `yaml:"account_sid,omitempty"`
	RequestUrl        string           `json:"requestUrl,omitempty" yaml:"request_url,omitempty"`
	HttpUsername      string           `yaml:"http_username"`
	HttpPassword      string           `yaml:"http_password"`
	Enabled           bool             `yaml:"enabled"`
	StunUseRFC7094URI bool             `yaml:"stun_use_rfc7094_uri"`
	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"`
	DoThroughput      bool             `yaml:"do_throughput"`
}

type LoggingConfig

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

type LokiConfig

type LokiConfig struct {
	Enabled        bool              `json:"enabled" 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            `json:"url" 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"`
}

type TimerConfig added in v1.0.7

type TimerConfig struct {
	Enabled  bool `json:"enabled" yaml:"enabled"`
	Interval int  `json:"interval" yaml:"interval"`
}

Jump to

Keyboard shortcuts

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