{"id":19416384,"url":"https://github.com/scriptllh/go-disconf-client","last_synced_at":"2025-07-28T12:17:36.546Z","repository":{"id":144203004,"uuid":"120432905","full_name":"scriptllh/go-disconf-client","owner":"scriptllh","description":"go disconf 客户端","archived":false,"fork":false,"pushed_at":"2018-10-08T08:18:33.000Z","size":1136,"stargazers_count":24,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T13:40:42.179Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scriptllh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-06T09:38:22.000Z","updated_at":"2021-06-04T07:52:06.000Z","dependencies_parsed_at":"2023-06-25T23:49:27.733Z","dependency_job_id":null,"html_url":"https://github.com/scriptllh/go-disconf-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scriptllh/go-disconf-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptllh%2Fgo-disconf-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptllh%2Fgo-disconf-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptllh%2Fgo-disconf-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptllh%2Fgo-disconf-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scriptllh","download_url":"https://codeload.github.com/scriptllh/go-disconf-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptllh%2Fgo-disconf-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267514962,"owners_count":24100030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T12:47:19.673Z","updated_at":"2025-07-28T12:17:36.509Z","avatar_url":"https://github.com/scriptllh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### go disconf 客户端\n***\n1.使用说明\n   \n \n  * 传一个结构体的指针,支持数据类型(支持int、int64、string、bool、float32、float64)\n \n  * 支持两种tag:conf、auto\n  \n  * 支持默认参数（WithRetryTimes(3)、WithRetrySleepSeconds(5)、WithDownloadDir(./disconf/download/)、WithIgnore）\n  * tag conf 是属性文件中的名称，如果加了auto:\"true\"表示该属性在disconf服务端更新之后，客户端会自动加载\n  * example\n  \n```\n  type Conf struct {\n\tUserName string `conf:\"mysql.username\"`\n\tPassword string `conf:\"mysql.password\" auto:\"true\"`\n\tA        int    `conf:\"a\" auto:\"true\"`\n\tTextGBK  string `conf:\"textGBK\" auto:\"true\"`\n}\n```\n\n```\nconf := \u0026Conf{UserName: \"root\", Password: \"dsdhjhj\"}\n\tif err := NewConf(\n\t\t\"127.0.0.1\",\n\t\t\"disconf_demo\",\n\t\t\"222\",\n\t\t\"dev\",\n\t\ttrue,\n\t\tfalse,\n\t\tconf,\n\t\tWithDownloadDir(\"./disconf/download/\")); err != nil {\n\t\tt.Fatalf(\"new conf [err:%v]\", err)\n\t}\n\tfor {\n\t       fmt.Println(\"a\", conf.Password)\n\t       time.Sleep(5 * time.Second)\n\t\t}\n```\n\n\n***\n\n###### 整体架构\n\n   ![avatar](https://github.com/scriptllh/go-disconf-client/blob/dev/docs/flow.svg)\n\n  \n***\n  \n###### 特性\n\n    1.  支持自定义配置文件下载路径\n\n    2.  支持配置文件和配置项\n\n    3.  支持可配置的只加载本地配置\n\n    4.  不需要重启更改配置文件或配置项\n\n    5.  应用程序无感知\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriptllh%2Fgo-disconf-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscriptllh%2Fgo-disconf-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriptllh%2Fgo-disconf-client/lists"}