(config: dict)
return config
Set the default configuration options on a loaded config dictionary
Set the default configuration options on a loaded config dictionary
Set the default configuration options on a loaded config dictionary
def set_default_config(config: dict) -> dict:
    """Set the default configuration options on a loaded config dictionary"""
    env_service_name = os.environ.get("LIGHTBUS_SERVICE_NAME")
    if env_service_name:
        config.setdefault("service_name", env_service_name)

    env_process_name = os.environ.get("LIGHTBUS_PROCESS_NAME")
    if env_process_name:
        config.setdefault("process_name", env_process_name)

    config.setdefault("apis", {})
    config.setdefault("bus", {})
    config["apis"].setdefault("default", {})
    config["bus"].setdefault("schema", {})

    config["apis"]["default"].setdefault("rpc_transport", {"redis": {}})
    config["apis"]["default"].setdefault("result_transport", {"redis": {}})
    config["apis"]["default"].setdefault("event_transport", {"redis": {}})
    config["bus"]["schema"].setdefault("transport", {"redis": {}})
    return config
def set_default_config ( config : dict ) -> dict : env_service_name = os . environ . get ( "LIGHTBUS_SERVICE_NAME" ) if env_service_name : config . setdefault ( "service_name" , env_service_name ) env_process_name = os . environ . get ( "LIGHTBUS_PROCESS_NAME" ) if env_process_name : config . setdefault ( "process_name" , env_process_name ) config . setdefault ( "apis" , { } ) config . setdefault ( "bus" , { } ) config [ "apis" ] . setdefault ( "default" , { } ) config [ "bus" ] . setdefault ( "schema" , { } ) config [ "apis" ] [ "default" ] . setdefault ( "rpc_transport" , { "redis" : { } } ) config [ "apis" ] [ "default" ] . setdefault ( "result_transport" , { "redis" : { } } ) config [ "apis" ] [ "default" ] . setdefault ( "event_transport" , { "redis" : { } } ) config [ "bus" ] [ "schema" ] . setdefault ( "transport" , { "redis" : { } } ) return config