2024-08-19 10:10:27 +08:00
|
|
|
|
import{_ as o,o as t,c as a,b as e,d as i,e as s}from"./app-CKfb26EU.js";const d={},n=e("h3",{id:"def-flat-config-config-dict-str-any-dict-str-any",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#def-flat-config-config-dict-str-any-dict-str-any"},[e("span",null,[e("em",null,[e("strong",null,"def")]),i(),e("code",null,"flat_config(config: dict[str, Any]) -> dict[str, Any]")])])],-1),l=e("p",null,"扁平化配置文件",-1),r=e("p",{"a.b.c:1":""},"{a:{b:{c:1}}} ->",-1),c=s(`<p>Args:</p><pre><code>config: 配置项目
|
|
|
|
|
</code></pre><h3 id="def-load-from-yaml-file-str-dict-str-any" tabindex="-1"><a class="header-anchor" href="#def-load-from-yaml-file-str-dict-str-any"><span><em><strong>def</strong></em> <code>load_from_yaml(file: str) -> dict[str, Any]</code></span></a></h3><p>Load config from yaml file</p><h3 id="def-load-from-json-file-str-dict-str-any" tabindex="-1"><a class="header-anchor" href="#def-load-from-json-file-str-dict-str-any"><span><em><strong>def</strong></em> <code>load_from_json(file: str) -> dict[str, Any]</code></span></a></h3><p>Load config from json file</p><h3 id="def-load-from-toml-file-str-dict-str-any" tabindex="-1"><a class="header-anchor" href="#def-load-from-toml-file-str-dict-str-any"><span><em><strong>def</strong></em> <code>load_from_toml(file: str) -> dict[str, Any]</code></span></a></h3><p>Load config from toml file</p><h3 id="def-load-from-files-dict-str-any" tabindex="-1"><a class="header-anchor" href="#def-load-from-files-dict-str-any"><span><em><strong>def</strong></em> <code>load_from_files() -> dict[str, Any]</code></span></a></h3><p>从指定文件加载配置项,会自动识别文件格式</p><p>默认执行扁平化选项</p><h3 id="def-load-configs-from-dirs-dict-str-any" tabindex="-1"><a class="header-anchor" href="#def-load-configs-from-dirs-dict-str-any"><span><em><strong>def</strong></em> <code>load_configs_from_dirs() -> dict[str, Any]</code></span></a></h3><p>从目录下加载配置文件,不递归</p><p>按照读取文件的优先级反向覆盖</p><p>默认执行扁平化选项</p><h3 id="def-load-config-in-default-no-waring-bool-dict-str-any" tabindex="-1"><a class="header-anchor" href="#def-load-config-in-default-no-waring-bool-dict-str-any"><span><em><strong>def</strong></em> <code>load_config_in_default(no_waring: bool) -> dict[str, Any]</code></span></a></h3><p>从一个标准的轻雪项目加载配置文件</p><p>项目目录下的config.*和config目录下的所有配置文件</p><p>项目目录下的配置文件优先</p><h3 id="class-satorinodeconfig-basemodel" tabindex="-1"><a class="header-anchor" href="#class-satorinodeconfig-basemodel"><span><em><strong>class</strong></em> <code>SatoriNodeConfig(BaseModel)</code></span></a></h3><h3 id="class-satoriconfig-basemodel" tabindex="-1"><a class="header-anchor" href="#class-satoriconfig-basemodel"><span><em><strong>class</strong></em> <code>SatoriConfig(BaseModel)</code></span></a></h3><h3 id="class-basicconfig-basemodel" tabindex="-1"><a class="header-anchor" href="#class-basicconfig-basemodel"><span><em><strong>class</strong></em> <code>BasicConfig(BaseModel)</code></span></a></h3>`,24),f=[n,l,r,c];function m(g,p){return t(),a("div",null,f)}const h=o(d,[["render",m],["__file","config.html.vue"]]),_=JSON.parse('{"path":"/dev/api/config.html","title":"liteyuki.config","lang":"zh-CN","frontmatter":{"title":"liteyuki.config","order":1,"icon":"laptop-code","category":"API","description":"def flat_config(config: dict[str, Any]) -> dict[str, Any] 扁平化配置文件 {a:{b:{c:1}}} -> Args: Returns: def load_from_yaml(file: str) -> dict[str, Any] Load config from yaml file def ...","head":[["meta",{"property":"og:url","content":"https://vuepress-theme-hope-docs-demo.netlify.app/dev/api/config.html"}],["meta",{"property":"og:site_name","content":"LiteyukiBot 轻雪机器人"}],["meta",{"property":"og:title","content":"liteyuki.config"}],["meta",{"property":"og:description","content":"def flat_config(config: dict[str, Any]) -> dict[str, Any] 扁平化配置文件 {a:{b:{c:1}}} -> Args: Returns: def load_from_yaml(file: str) -> dict[str, Any] Load config from yaml file def ..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-08-19T01:55:47.000Z"}],["meta",{"property":"article:modified_time","content":"2024-08-19T01:55:47.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"liteyuki.config\\",\\"image\\":[\\"\\"],\\"dateMod
|