Files
libagent/agent_test.go
2023-08-07 10:56:49 +08:00

56 lines
775 B
Go

package agent
import (
"context"
"testing"
"github.com/jkstack/anet"
"github.com/jkstack/libagent/conf"
)
type agent struct{}
func (a *agent) AgentName() string {
return "example-agent"
}
func (a *agent) Version() string {
return "0.0.0"
}
func (a *agent) ConfDir() string {
return "./conf"
}
func (a *agent) Configure() *conf.Configure {
return &conf.Configure{}
}
func (a *agent) OnRewriteConfigure() error {
return nil
}
func (a *agent) OnConnect() {
}
func (a *agent) OnDisconnect() {
}
func (a *agent) OnReportMonitor() {
}
func (a *agent) OnMessage(*anet.Msg) error {
return nil
}
func (a *agent) LoopWrite(context.Context, chan *anet.Msg) error {
select {}
}
func (a *agent) OnStop() {
}
func TestRestart(t *testing.T) {
Restart(&agent{})
}