https://github.com/jkstack/libagent
agent封装类库,用于快速开发agent
https://github.com/jkstack/libagent
agent go
Last synced: 11 months ago
JSON representation
agent封装类库,用于快速开发agent
- Host: GitHub
- URL: https://github.com/jkstack/libagent
- Owner: jkstack
- License: mit
- Created: 2022-08-01T07:55:50.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-03-14T05:53:03.000Z (about 2 years ago)
- Last Synced: 2025-04-05T06:05:53.738Z (12 months ago)
- Topics: agent, go
- Language: Go
- Homepage: https://jkstack.github.io/docs/libagent/
- Size: 112 KB
- Stars: 5
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libagent
[](https://github.com/jkstack/libagent/actions/workflows/build.yml)
[](https://opensource.org/licenses/MIT)
[](https://goreportcard.com/report/github.com/jkstack/libagent)
[](https://github.com/jkstack/libagent)
agent封装类库,用于快速开发agent
## 开发方式
请查看[example-agent](https://github.com/jkstack/example-agent#agent%E5%BC%80%E5%8F%91)
## 已支持功能
1. 与agent-server创建websocket连接并进行握手分配agent id
2. 标准化日志输出
- 支持stdout和日志文件双目标输出
- 支持DEBUG、WARNING、INFO、ERROR级别的标准格式日志输出
- 支持日志文件的滚动存储
3. 支持json、yaml或kv格式的配置文件,以下是一个kv格式配置文件示例
id = example-01
server = 127.0.0.1:13081
# log
log.target = stdout
#log.target = stdout,file
#log.dir = ./logs
#log.size = 10M
#log.rotate = 7
# monitor
monitor.enabled = true
monitor.interval = 10s
# limit
limit.cpu_quota = 100
limit.memory_limit = 1G
limit.disk_limit = [{"dev":"8:0","read_bytes":"1M","write_bytes":"1M","read_iops":4000,"write_iops":4000}]
4. 支持通过[cgroups](https://github.com/containerd/cgroups)或[runtime](https://pkg.go.dev/runtime)库进行agent的资源限制,可通过配置文件中的limit相关选项进行配置
5. 支持agent的自监控数据上报,可通过配置文件中的monitor相关选项进行配置
6. 支持断线重连功能
7. 支持系统服务注册