Documentation
¶
Index ¶
- Constants
- Variables
- type AgentPodInfo
- func (*AgentPodInfo) Descriptor() ([]byte, []int)deprecated
- func (x *AgentPodInfo) GetAgentId() int64
- func (x *AgentPodInfo) GetPodId() int64
- func (*AgentPodInfo) ProtoMessage()
- func (x *AgentPodInfo) ProtoReflect() protoreflect.Message
- func (x *AgentPodInfo) Reset()
- func (x *AgentPodInfo) String() string
- type ConnectedAgentkInfo
- func (*ConnectedAgentkInfo) Descriptor() ([]byte, []int)deprecated
- func (x *ConnectedAgentkInfo) GetAgentId() int64
- func (x *ConnectedAgentkInfo) GetAgentMeta() *entity.AgentkMeta
- func (x *ConnectedAgentkInfo) GetConnectedAt() *timestamppb.Timestamp
- func (x *ConnectedAgentkInfo) GetConnectionId() int64
- func (x *ConnectedAgentkInfo) GetProjectId() int64
- func (*ConnectedAgentkInfo) ProtoMessage()
- func (x *ConnectedAgentkInfo) ProtoReflect() protoreflect.Message
- func (x *ConnectedAgentkInfo) Reset()
- func (x *ConnectedAgentkInfo) String() string
- type ConnectedAgentkInfoCallback
- type ConnectedAgentkInfoCollector
- type DisconnectAgentkInfo
- func (*DisconnectAgentkInfo) Descriptor() ([]byte, []int)deprecated
- func (x *DisconnectAgentkInfo) GetAgentId() int64
- func (x *DisconnectAgentkInfo) GetAgentMeta() *entity.AgentkMeta
- func (x *DisconnectAgentkInfo) GetConnectionId() int64
- func (x *DisconnectAgentkInfo) GetProjectId() int64
- func (*DisconnectAgentkInfo) ProtoMessage()
- func (x *DisconnectAgentkInfo) ProtoReflect() protoreflect.Message
- func (x *DisconnectAgentkInfo) Reset()
- func (x *DisconnectAgentkInfo) String() string
- type ExpiringRegisterer
- type Querier
- type RedisTracker
- func (t *RedisTracker) CountAgentsByAgentVersions(ctx context.Context) (map[string]int64, error)
- func (t *RedisTracker) GetConnectedAgentsCount(ctx context.Context) (int64, error)
- func (t *RedisTracker) GetConnectionsByAgentID(ctx context.Context, agentKey api.AgentKey, cb ConnectedAgentkInfoCallback) error
- func (t *RedisTracker) GetConnectionsByProjectID(ctx context.Context, projectID int64, cb ConnectedAgentkInfoCallback) error
- func (t *RedisTracker) RegisterExpiring(ctx context.Context, info *ConnectedAgentkInfo) error
- func (t *RedisTracker) Run(ctx context.Context) error
- func (t *RedisTracker) Unregister(ctx context.Context, info *DisconnectAgentkInfo) error
- type Tracker
Constants ¶
View Source
const (
ModuleName = "agent_tracker"
)
Variables ¶
View Source
var File_internal_module_agent_tracker_agent_tracker_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type AgentPodInfo ¶
type AgentPodInfo struct { AgentId int64 `protobuf:"varint,1,opt,name=agent_id,proto3" json:"agent_id,omitempty"` PodId int64 `protobuf:"varint,2,opt,name=pod_id,proto3" json:"pod_id,omitempty"` // contains filtered or unexported fields }
func (*AgentPodInfo) Descriptor
deprecated
func (*AgentPodInfo) Descriptor() ([]byte, []int)
Deprecated: Use AgentPodInfo.ProtoReflect.Descriptor instead.
func (*AgentPodInfo) GetAgentId ¶
func (x *AgentPodInfo) GetAgentId() int64
func (*AgentPodInfo) GetPodId ¶
func (x *AgentPodInfo) GetPodId() int64
func (*AgentPodInfo) ProtoMessage ¶
func (*AgentPodInfo) ProtoMessage()
func (*AgentPodInfo) ProtoReflect ¶
func (x *AgentPodInfo) ProtoReflect() protoreflect.Message
func (*AgentPodInfo) Reset ¶
func (x *AgentPodInfo) Reset()
func (*AgentPodInfo) String ¶
func (x *AgentPodInfo) String() string
type ConnectedAgentkInfo ¶ added in v18.1.0
type ConnectedAgentkInfo struct { AgentMeta *entity.AgentkMeta `protobuf:"bytes,1,opt,name=agent_meta,proto3" json:"agent_meta,omitempty"` ConnectedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=connected_at,proto3" json:"connected_at,omitempty"` ConnectionId int64 `protobuf:"varint,3,opt,name=connection_id,proto3" json:"connection_id,omitempty"` AgentId int64 `protobuf:"varint,4,opt,name=agent_id,proto3" json:"agent_id,omitempty"` ProjectId int64 `protobuf:"varint,5,opt,name=project_id,proto3" json:"project_id,omitempty"` // contains filtered or unexported fields }
func (*ConnectedAgentkInfo) Descriptor
deprecated
added in
v18.1.0
func (*ConnectedAgentkInfo) Descriptor() ([]byte, []int)
Deprecated: Use ConnectedAgentkInfo.ProtoReflect.Descriptor instead.
func (*ConnectedAgentkInfo) GetAgentId ¶ added in v18.1.0
func (x *ConnectedAgentkInfo) GetAgentId() int64
func (*ConnectedAgentkInfo) GetAgentMeta ¶ added in v18.1.0
func (x *ConnectedAgentkInfo) GetAgentMeta() *entity.AgentkMeta
func (*ConnectedAgentkInfo) GetConnectedAt ¶ added in v18.1.0
func (x *ConnectedAgentkInfo) GetConnectedAt() *timestamppb.Timestamp
func (*ConnectedAgentkInfo) GetConnectionId ¶ added in v18.1.0
func (x *ConnectedAgentkInfo) GetConnectionId() int64
func (*ConnectedAgentkInfo) GetProjectId ¶ added in v18.1.0
func (x *ConnectedAgentkInfo) GetProjectId() int64
func (*ConnectedAgentkInfo) ProtoMessage ¶ added in v18.1.0
func (*ConnectedAgentkInfo) ProtoMessage()
func (*ConnectedAgentkInfo) ProtoReflect ¶ added in v18.1.0
func (x *ConnectedAgentkInfo) ProtoReflect() protoreflect.Message
func (*ConnectedAgentkInfo) Reset ¶ added in v18.1.0
func (x *ConnectedAgentkInfo) Reset()
func (*ConnectedAgentkInfo) String ¶ added in v18.1.0
func (x *ConnectedAgentkInfo) String() string
type ConnectedAgentkInfoCallback ¶ added in v18.1.0
type ConnectedAgentkInfoCallback func(*ConnectedAgentkInfo) (done bool, err error)
type ConnectedAgentkInfoCollector ¶ added in v18.1.0
type ConnectedAgentkInfoCollector []*ConnectedAgentkInfo
func (*ConnectedAgentkInfoCollector) Collect ¶ added in v18.1.0
func (c *ConnectedAgentkInfoCollector) Collect(info *ConnectedAgentkInfo) (bool, error)
type DisconnectAgentkInfo ¶ added in v18.1.0
type DisconnectAgentkInfo struct { AgentMeta *entity.AgentkMeta `protobuf:"bytes,1,opt,name=agent_meta,proto3" json:"agent_meta,omitempty"` ConnectionId int64 `protobuf:"varint,2,opt,name=connection_id,proto3" json:"connection_id,omitempty"` AgentId int64 `protobuf:"varint,3,opt,name=agent_id,proto3" json:"agent_id,omitempty"` ProjectId int64 `protobuf:"varint,4,opt,name=project_id,proto3" json:"project_id,omitempty"` // contains filtered or unexported fields }
func (*DisconnectAgentkInfo) Descriptor
deprecated
added in
v18.1.0
func (*DisconnectAgentkInfo) Descriptor() ([]byte, []int)
Deprecated: Use DisconnectAgentkInfo.ProtoReflect.Descriptor instead.
func (*DisconnectAgentkInfo) GetAgentId ¶ added in v18.1.0
func (x *DisconnectAgentkInfo) GetAgentId() int64
func (*DisconnectAgentkInfo) GetAgentMeta ¶ added in v18.1.0
func (x *DisconnectAgentkInfo) GetAgentMeta() *entity.AgentkMeta
func (*DisconnectAgentkInfo) GetConnectionId ¶ added in v18.1.0
func (x *DisconnectAgentkInfo) GetConnectionId() int64
func (*DisconnectAgentkInfo) GetProjectId ¶ added in v18.1.0
func (x *DisconnectAgentkInfo) GetProjectId() int64
func (*DisconnectAgentkInfo) ProtoMessage ¶ added in v18.1.0
func (*DisconnectAgentkInfo) ProtoMessage()
func (*DisconnectAgentkInfo) ProtoReflect ¶ added in v18.1.0
func (x *DisconnectAgentkInfo) ProtoReflect() protoreflect.Message
func (*DisconnectAgentkInfo) Reset ¶ added in v18.1.0
func (x *DisconnectAgentkInfo) Reset()
func (*DisconnectAgentkInfo) String ¶ added in v18.1.0
func (x *DisconnectAgentkInfo) String() string
type ExpiringRegisterer ¶
type ExpiringRegisterer interface { // RegisterExpiring registers connection with the tracker. // Registration will expire if not refreshed using this method. RegisterExpiring(ctx context.Context, info *ConnectedAgentkInfo) error // Unregister unregisters connection with the tracker. // This may be called to intentionally unregister the agent, // even though it may eventually expire. Unregister(ctx context.Context, info *DisconnectAgentkInfo) error }
type Querier ¶
type Querier interface { GetConnectionsByAgentID(ctx context.Context, agentKey api.AgentKey, cb ConnectedAgentkInfoCallback) error GetConnectionsByProjectID(ctx context.Context, projectID int64, cb ConnectedAgentkInfoCallback) error GetConnectedAgentsCount(ctx context.Context) (int64, error) CountAgentsByAgentVersions(ctx context.Context) (map[string]int64, error) }
type RedisTracker ¶
type RedisTracker struct {
// contains filtered or unexported fields
}
func NewRedisTracker ¶
func NewRedisTracker(log *slog.Logger, errRep errz.ErrReporter, v protovalidate.Validator, client rueidis.Client, agentKeyPrefix string, ttl, gcPeriod time.Duration, m otelmetric.Meter) (*RedisTracker, error)
func (*RedisTracker) CountAgentsByAgentVersions ¶
func (*RedisTracker) GetConnectedAgentsCount ¶
func (t *RedisTracker) GetConnectedAgentsCount(ctx context.Context) (int64, error)
func (*RedisTracker) GetConnectionsByAgentID ¶
func (t *RedisTracker) GetConnectionsByAgentID(ctx context.Context, agentKey api.AgentKey, cb ConnectedAgentkInfoCallback) error
func (*RedisTracker) GetConnectionsByProjectID ¶
func (t *RedisTracker) GetConnectionsByProjectID(ctx context.Context, projectID int64, cb ConnectedAgentkInfoCallback) error
func (*RedisTracker) RegisterExpiring ¶
func (t *RedisTracker) RegisterExpiring(ctx context.Context, info *ConnectedAgentkInfo) error
func (*RedisTracker) Unregister ¶
func (t *RedisTracker) Unregister(ctx context.Context, info *DisconnectAgentkInfo) error
Click to show internal directories.
Click to hide internal directories.