class Obsctl::Config::Config

Overview

Parsed obsctl configuration with canonical top-level server and reconnect sections.

Defined in:

obsctl/config/config.cr

Constant Summary

ALLOWED_TOP_LEVEL_KEYS = Set {"version", "server", "connection", "reconnect", "ui", "scenes", "audio", "keymap"}

Constructors

Instance Method Summary

Constructor Detail

def self.default : self #

Returns the built-in default configuration used by obsctl init.


[View source]
def self.from_yaml(yaml : String) : self #

Parses YAML into the typed config model and rejects unsupported top-level keys so writes cannot silently discard user data.


[View source]
def self.new(version : Int32 = 1, server : ServerConfig = ServerConfig.new, connection : ConnectionConfig = ConnectionConfig.new, reconnect : ReconnectConfig = ReconnectConfig.new, ui : UiConfig = UiConfig.new, scenes : Array(SceneConfig) = [] of SceneConfig, audio : AudioConfig = AudioConfig.new, keymap : KeymapConfig = KeymapConfig.new) #

Builds a config object, migrating legacy connection.reconnect into the canonical top-level #reconnect field when present.


[View source]

Instance Method Detail

def audio : AudioConfig #

[View source]
def audio=(audio : AudioConfig) #

[View source]
def connection : ConnectionConfig #

[View source]
def connection=(connection : ConnectionConfig) #

[View source]
def keymap : KeymapConfig #

[View source]
def keymap=(keymap : KeymapConfig) #

[View source]
def reconnect : ReconnectConfig #

[View source]
def reconnect=(reconnect : ReconnectConfig) #

[View source]
def scenes : Array(SceneConfig) #

[View source]
def scenes=(scenes : Array(SceneConfig)) #

[View source]
def server : ServerConfig #

[View source]
def server=(server : ServerConfig) #

[View source]
def to_yaml(io : IO) : Nil #

Writes the config in the canonical schema, including top-level #server and #reconnect sections.


[View source]
def to_yaml : String #

Serializes the config to canonical YAML.


[View source]
def ui : UiConfig #

[View source]
def ui=(ui : UiConfig) #

[View source]
def version : Int32 #

[View source]
def version=(version : Int32) #

[View source]