{"id":16251231,"url":"https://github.com/zggsong/message","last_synced_at":"2025-04-08T12:28:09.074Z","repository":{"id":65898218,"uuid":"601885359","full_name":"ZGGSONG/message","owner":"ZGGSONG","description":"Send notification messages (bark, mail), and support real-time monitoring of configuration file changes","archived":false,"fork":false,"pushed_at":"2023-02-15T04:10:35.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T08:34:02.348Z","etag":null,"topics":["bark","golang","mail"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/zggsong/message","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZGGSONG.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":"2023-02-15T03:01:38.000Z","updated_at":"2023-03-31T04:11:07.000Z","dependencies_parsed_at":"2023-02-27T12:15:20.507Z","dependency_job_id":null,"html_url":"https://github.com/ZGGSONG/message","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZGGSONG%2Fmessage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZGGSONG%2Fmessage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZGGSONG%2Fmessage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZGGSONG%2Fmessage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZGGSONG","download_url":"https://codeload.github.com/ZGGSONG/message/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247841332,"owners_count":21005082,"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","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":["bark","golang","mail"],"created_at":"2024-10-10T15:09:28.124Z","updated_at":"2025-04-08T12:28:09.050Z","avatar_url":"https://github.com/ZGGSONG.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![Go Report Card](https://goreportcard.com/badge/github.com/zggsong/message?style=flat-square)](https://goreportcard.com/report/github.com/zggsong/message)\n![Go Version](https://img.shields.io/badge/go%20version-%3E=1.16-61CFDD.svg?style=flat-square)\n[![PkgGoDev](https://pkg.go.dev/badge/mod/github.com/zggsong/message)](https://pkg.go.dev/mod/github.com/zggsong/message)\n\n\nSend notification messages (bark, mail), and support real-time monitoring of configuration file changes\n\n## Install\n\n```shell\ngo get github.com/zggsong/message\n```\n\n## Usage\n\n```shell\ntouch config.yml\n```\n\nwrite the following contents to the file\n\n```yml\nmessage:\n  enabled: true #是否开启发送信息\n  type: \"bark\"  #选择发送信息方式\n  bark:\n    url: \"\"\n    key: \"\"\n  mail:\n    host: \"\"    #例:smtp.qq.com\n    protocol:   #Optional\n    port:       #例:587\n    username: \"\"\n    password: \"\"\n    from_name: \"\" #\"zgg \u003czgg@mail.com\u003e\"\n    to: \"\"      #分号内空格分开\n```\n\n\u003e [Bark is an iOS App which allows you to push custom notifications to your iPhone](https://github.com/Finb/Bark)\n\n```go\nfunc main() {\n\t/*配置初始化*/\n\tconf, err := message.InitConfig()\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to initialize config: %v\", err)\n\t}\n\tmessage.GLO_CONF = conf\n\n\t/*测试发送*/\n\tvar s = message.Service{Body: message.Body{\n\t\tTitle:   \"test title\",\n\t\tContent: \"this is content, time is \" + time.Now().Format(\"2006-01-02 15:04:05\"),\n\t}}\n\tif err = s.Run(); err != nil {\n\t\tlog.Fatalf(\"failed to send message: %v\", err)\n\t} else {\n\t\tlog.Printf(\"send message successfully...\")\n\t}\n\n\t/*监听配置*/\n\tfor {\n\t\t_conf := \u003c-message.GLO_CONF_CH\n\t\tlog.Printf(\"config changed: %v\", _conf)\n\t\tmessage.GLO_CONF = _conf\n\t}\n}\n```\n\n## License\n\nMessage © [zggsong](https://github.com/zggsong), Follow [MIT](https://github.com/zggsong/message/blob/master/LICENSE) certificate.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzggsong%2Fmessage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzggsong%2Fmessage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzggsong%2Fmessage/lists"}