{"id":19621248,"url":"https://github.com/jkstack/example-agent","last_synced_at":"2025-10-29T05:48:53.075Z","repository":{"id":64476043,"uuid":"523667258","full_name":"jkstack/example-agent","owner":"jkstack","description":"agent示例","archived":false,"fork":false,"pushed_at":"2023-02-08T04:00:30.000Z","size":310,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-09T11:35:33.785Z","etag":null,"topics":["agent","example","go"],"latest_commit_sha":null,"homepage":"https://jkstack.github.io/docs/agents/example-agent/","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/jkstack.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-08-11T09:46:23.000Z","updated_at":"2022-11-16T09:52:16.000Z","dependencies_parsed_at":"2023-02-17T02:46:12.640Z","dependency_job_id":null,"html_url":"https://github.com/jkstack/example-agent","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkstack%2Fexample-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkstack%2Fexample-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkstack%2Fexample-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkstack%2Fexample-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkstack","download_url":"https://codeload.github.com/jkstack/example-agent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240914937,"owners_count":19878066,"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":["agent","example","go"],"created_at":"2024-11-11T11:22:05.797Z","updated_at":"2025-10-29T05:48:53.002Z","avatar_url":"https://github.com/jkstack.png","language":"Go","readme":"# example-agent\n\n[![version](https://img.shields.io/github/v/release/jkstack/example-agent)](https://github.com/jkstack/example-agent/releases/latest)\n[![Go Report Card](https://goreportcard.com/badge/github.com/jkstack/example-agent)](https://goreportcard.com/report/github.com/jkstack/example-agent)\n[![go-mod](https://img.shields.io/github/go-mod/go-version/jkstack/example-agent)](https://github.com/jkstack/example-agent)\n[![license](https://img.shields.io/github/license/jkstack/example-agent)](https://opensource.org/licenses/MIT)\n![downloads](https://img.shields.io/github/downloads/jkstack/example-agent/total)\n\n这是一个agent的示例，用于展示agent开发\n\n## agent开发\n\n1. 创建项目并导入[libagent](github.com/jkstack/libagent)库\n\n    ```\n    go get github.com/jkstack/libagent\n    ```\n2. 定义一个结构体并实现[App](https://pkg.go.dev/github.com/jkstack/libagent#App)接口\n3. 在main函数中添加RegisterService、UnregisterService和Run等libagent库中的接口调用\n\n    ```go\n    switch *act {\n    case \"install\":\n        agent.RegisterService(app)\n    case \"uninstall\":\n        agent.UnregisterService(app)\n    default:\n        agent.Run(app)\n    }\n    ```\n\n## 更多示例\n\n1. [metrics-agent](https://github.com/jkstack/metrics-agent): 监控数据采集\n2. [exec-agent](https://github.com/jkstack/exec-agent): 远程执行脚本，文件分发\n\n## 开源社区\n\n文档知识库：https://jkstack.github.io/\n\n\u003cimg src=\"docs/wechat_QR.jpg\" height=200px width=200px /\u003e","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkstack%2Fexample-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkstack%2Fexample-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkstack%2Fexample-agent/lists"}