Documentation ¶
Index ¶
- Constants
- type AgentInfo
- type Config
- type HandlerRegistry
- func (r *HandlerRegistry) GetHandshakeHandler() HandshakeHandler
- func (r *HandlerRegistry) GetOneway(bizType int32) OnewayHandler
- func (r *HandlerRegistry) GetRpc(bizType int32) RpcHandler
- func (r *HandlerRegistry) RegisterHandshake(h HandshakeHandler)
- func (r *HandlerRegistry) RegisterOneway(bizType int32, h OnewayHandler)
- func (r *HandlerRegistry) RegisterRpc(bizType int32, h RpcHandler)
- type HandshakeHandler
- type OnewayHandler
- type ReconnectListener
- type RpcHandler
- type Service
- func (s *Service) BiStream(ctx context.Context) (pb2.RegistryServiceForAgent_BiStreamsClient, error)
- func (s *Service) GetCollectTasks(ctx context.Context, agentId string, buckets map[string]string) (*pb2.GetCollectTasksResponse, error)
- func (s *Service) GetControlConfigs(ctx context.Context, agentId string) (*pb2.GetControlConfigsResponse, error)
- func (s *Service) GetLastControlConfigs() *pb2.GetControlConfigsResponse
- func (s *Service) ListenReconnect(listener ReconnectListener)
- func (s *Service) MetaDeltaSync(request *pb2.MetaSync_DeltaSyncRequest) error
- func (s *Service) MetaFullSync(request *pb2.MetaSync_FullSyncRequest) error
- func (s *Service) Ping(ctx context.Context) error
- func (s *Service) RegisterAgent(ctx context.Context, agentInfo AgentInfo) (*pb2.RegisterAgentResponse, error)
- func (s *Service) RemoveReconnect(listener ReconnectListener)
- func (s *Service) ReportEventAsync(events ...*pb2.ReportEventRequest_Event)
- func (s *Service) ReportRunEvents(ctx context.Context, agentId string, events []*eventcollector.Event) (*pb2.RunEventsResponse, error)
- func (s *Service) ReportRunStats(ctx context.Context, agentId string, ts int64, agentRunStats map[string]uint64, ...) (*pb2.RunStatsResponse, error)
- func (s *Service) SendHeartBeat(ctx context.Context, agentId string) (*pb2.SendAgentHeartbeatResponse, error)
- func (s *Service) Stop()
Constants ¶
View Source
const (
CodeOk int32 = 0
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // grpc 的 ip:port Addr string // 是否启动ssl Secure bool // ca证书 CaCert string CaCertBase64 string ServerName string Apikey string CompressionEnabled bool AgentId string Workspace string }
registry 相关的配置
type HandlerRegistry ¶
type HandlerRegistry struct {
// contains filtered or unexported fields
}
func NewHandlerRegistry ¶
func NewHandlerRegistry() *HandlerRegistry
func (*HandlerRegistry) GetHandshakeHandler ¶
func (r *HandlerRegistry) GetHandshakeHandler() HandshakeHandler
func (*HandlerRegistry) GetOneway ¶
func (r *HandlerRegistry) GetOneway(bizType int32) OnewayHandler
func (*HandlerRegistry) GetRpc ¶
func (r *HandlerRegistry) GetRpc(bizType int32) RpcHandler
func (*HandlerRegistry) RegisterHandshake ¶
func (r *HandlerRegistry) RegisterHandshake(h HandshakeHandler)
func (*HandlerRegistry) RegisterOneway ¶
func (r *HandlerRegistry) RegisterOneway(bizType int32, h OnewayHandler)
func (*HandlerRegistry) RegisterRpc ¶
func (r *HandlerRegistry) RegisterRpc(bizType int32, h RpcHandler)
type HandshakeHandler ¶
type OnewayHandler ¶
type ReconnectListener ¶
type ReconnectListener interface {
OnReconnect()
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
registry 服务
func (*Service) BiStream ¶
func (s *Service) BiStream(ctx context.Context) (pb2.RegistryServiceForAgent_BiStreamsClient, error)
BiStream 双向流
func (*Service) GetCollectTasks ¶
func (s *Service) GetCollectTasks(ctx context.Context, agentId string, buckets map[string]string) (*pb2.GetCollectTasksResponse, error)
GetCollectTasks 查询所有的采集配置
func (*Service) GetControlConfigs ¶
func (s *Service) GetControlConfigs(ctx context.Context, agentId string) (*pb2.GetControlConfigsResponse, error)
GetControlConfigs 查控制参数 TODO 我们要定义控制参数的模型, 转换后返回给用户, 而不是直接返回pb的结果给用户(虽然这样方便一点)
func (*Service) GetLastControlConfigs ¶
func (s *Service) GetLastControlConfigs() *pb2.GetControlConfigsResponse
func (*Service) ListenReconnect ¶
func (s *Service) ListenReconnect(listener ReconnectListener)
func (*Service) MetaDeltaSync ¶
func (s *Service) MetaDeltaSync(request *pb2.MetaSync_DeltaSyncRequest) error
func (*Service) MetaFullSync ¶
func (s *Service) MetaFullSync(request *pb2.MetaSync_FullSyncRequest) error
func (*Service) RegisterAgent ¶
func (s *Service) RegisterAgent(ctx context.Context, agentInfo AgentInfo) (*pb2.RegisterAgentResponse, error)
RegisterAgent 注册agent
func (*Service) RemoveReconnect ¶
func (s *Service) RemoveReconnect(listener ReconnectListener)
func (*Service) ReportEventAsync ¶
func (s *Service) ReportEventAsync(events ...*pb2.ReportEventRequest_Event)
func (*Service) ReportRunEvents ¶
func (s *Service) ReportRunEvents(ctx context.Context, agentId string, events []*eventcollector.Event) (*pb2.RunEventsResponse, error)
func (*Service) ReportRunStats ¶
func (s *Service) ReportRunStats(ctx context.Context, agentId string, ts int64, agentRunStats map[string]uint64, collectConfigRunStats []*pb2.CollectConfigRunStats) (*pb2.RunStatsResponse, error)
上报运行状况统计
func (*Service) SendHeartBeat ¶
func (s *Service) SendHeartBeat(ctx context.Context, agentId string) (*pb2.SendAgentHeartbeatResponse, error)
SendHeartBeat 发送心跳
Click to show internal directories.
Click to hide internal directories.