Documentation ¶
Index ¶
- Constants
- Variables
- func Expires(t time.Time) zap.Field
- 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
- func (m *AgentPodInfo) Validate() error
- func (m *AgentPodInfo) ValidateAll() error
- type AgentPodInfoMultiError
- type AgentPodInfoValidationError
- func (e AgentPodInfoValidationError) Cause() error
- func (e AgentPodInfoValidationError) Error() string
- func (e AgentPodInfoValidationError) ErrorName() string
- func (e AgentPodInfoValidationError) Field() string
- func (e AgentPodInfoValidationError) Key() bool
- func (e AgentPodInfoValidationError) Reason() string
- type ConnectedAgentInfo
- func (*ConnectedAgentInfo) Descriptor() ([]byte, []int)deprecated
- func (x *ConnectedAgentInfo) GetAgentId() int64
- func (x *ConnectedAgentInfo) GetAgentMeta() *entity.AgentMeta
- func (x *ConnectedAgentInfo) GetConnectedAt() *timestamppb.Timestamp
- func (x *ConnectedAgentInfo) GetConnectionId() int64
- func (x *ConnectedAgentInfo) GetProjectId() int64
- func (*ConnectedAgentInfo) ProtoMessage()
- func (x *ConnectedAgentInfo) ProtoReflect() protoreflect.Message
- func (x *ConnectedAgentInfo) Reset()
- func (x *ConnectedAgentInfo) String() string
- func (m *ConnectedAgentInfo) Validate() error
- func (m *ConnectedAgentInfo) ValidateAll() error
- type ConnectedAgentInfoCallback
- type ConnectedAgentInfoCollector
- type ConnectedAgentInfoMultiError
- type ConnectedAgentInfoValidationError
- func (e ConnectedAgentInfoValidationError) Cause() error
- func (e ConnectedAgentInfoValidationError) Error() string
- func (e ConnectedAgentInfoValidationError) ErrorName() string
- func (e ConnectedAgentInfoValidationError) Field() string
- func (e ConnectedAgentInfoValidationError) Key() bool
- func (e ConnectedAgentInfoValidationError) Reason() string
- type DisconnectAgentInfo
- func (*DisconnectAgentInfo) Descriptor() ([]byte, []int)deprecated
- func (x *DisconnectAgentInfo) GetAgentId() int64
- func (x *DisconnectAgentInfo) GetAgentMeta() *entity.AgentMeta
- func (x *DisconnectAgentInfo) GetConnectionId() int64
- func (x *DisconnectAgentInfo) GetProjectId() int64
- func (*DisconnectAgentInfo) ProtoMessage()
- func (x *DisconnectAgentInfo) ProtoReflect() protoreflect.Message
- func (x *DisconnectAgentInfo) Reset()
- func (x *DisconnectAgentInfo) String() string
- func (m *DisconnectAgentInfo) Validate() error
- func (m *DisconnectAgentInfo) ValidateAll() error
- type DisconnectAgentInfoMultiError
- type DisconnectAgentInfoValidationError
- func (e DisconnectAgentInfoValidationError) Cause() error
- func (e DisconnectAgentInfoValidationError) Error() string
- func (e DisconnectAgentInfoValidationError) ErrorName() string
- func (e DisconnectAgentInfoValidationError) Field() string
- func (e DisconnectAgentInfoValidationError) Key() bool
- func (e DisconnectAgentInfoValidationError) Reason() 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, agentID int64, cb ConnectedAgentInfoCallback) error
- func (t *RedisTracker) GetConnectionsByProjectID(ctx context.Context, projectID int64, cb ConnectedAgentInfoCallback) error
- func (t *RedisTracker) RegisterExpiring(ctx context.Context, info *ConnectedAgentInfo) error
- func (t *RedisTracker) Run(ctx context.Context) error
- func (t *RedisTracker) Unregister(ctx context.Context, info *DisconnectAgentInfo) error
- type Tracker
Constants ¶
const (
ModuleName = "agent_tracker"
)
Variables ¶
var File_internal_module_agent_tracker_agent_tracker_proto protoreflect.FileDescriptor
Functions ¶
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
func (*AgentPodInfo) Validate ¶ added in v17.1.0
func (m *AgentPodInfo) Validate() error
Validate checks the field values on AgentPodInfo with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*AgentPodInfo) ValidateAll ¶ added in v17.1.0
func (m *AgentPodInfo) ValidateAll() error
ValidateAll checks the field values on AgentPodInfo with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in AgentPodInfoMultiError, or nil if none found.
type AgentPodInfoMultiError ¶ added in v17.1.0
type AgentPodInfoMultiError []error
AgentPodInfoMultiError is an error wrapping multiple validation errors returned by AgentPodInfo.ValidateAll() if the designated constraints aren't met.
func (AgentPodInfoMultiError) AllErrors ¶ added in v17.1.0
func (m AgentPodInfoMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (AgentPodInfoMultiError) Error ¶ added in v17.1.0
func (m AgentPodInfoMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type AgentPodInfoValidationError ¶ added in v17.1.0
type AgentPodInfoValidationError struct {
// contains filtered or unexported fields
}
AgentPodInfoValidationError is the validation error returned by AgentPodInfo.Validate if the designated constraints aren't met.
func (AgentPodInfoValidationError) Cause ¶ added in v17.1.0
func (e AgentPodInfoValidationError) Cause() error
Cause function returns cause value.
func (AgentPodInfoValidationError) Error ¶ added in v17.1.0
func (e AgentPodInfoValidationError) Error() string
Error satisfies the builtin error interface
func (AgentPodInfoValidationError) ErrorName ¶ added in v17.1.0
func (e AgentPodInfoValidationError) ErrorName() string
ErrorName returns error name.
func (AgentPodInfoValidationError) Field ¶ added in v17.1.0
func (e AgentPodInfoValidationError) Field() string
Field function returns field value.
func (AgentPodInfoValidationError) Key ¶ added in v17.1.0
func (e AgentPodInfoValidationError) Key() bool
Key function returns key value.
func (AgentPodInfoValidationError) Reason ¶ added in v17.1.0
func (e AgentPodInfoValidationError) Reason() string
Reason function returns reason value.
type ConnectedAgentInfo ¶
type ConnectedAgentInfo struct { AgentMeta *entity.AgentMeta `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 (*ConnectedAgentInfo) Descriptor
deprecated
func (*ConnectedAgentInfo) Descriptor() ([]byte, []int)
Deprecated: Use ConnectedAgentInfo.ProtoReflect.Descriptor instead.
func (*ConnectedAgentInfo) GetAgentId ¶
func (x *ConnectedAgentInfo) GetAgentId() int64
func (*ConnectedAgentInfo) GetAgentMeta ¶
func (x *ConnectedAgentInfo) GetAgentMeta() *entity.AgentMeta
func (*ConnectedAgentInfo) GetConnectedAt ¶
func (x *ConnectedAgentInfo) GetConnectedAt() *timestamppb.Timestamp
func (*ConnectedAgentInfo) GetConnectionId ¶
func (x *ConnectedAgentInfo) GetConnectionId() int64
func (*ConnectedAgentInfo) GetProjectId ¶
func (x *ConnectedAgentInfo) GetProjectId() int64
func (*ConnectedAgentInfo) ProtoMessage ¶
func (*ConnectedAgentInfo) ProtoMessage()
func (*ConnectedAgentInfo) ProtoReflect ¶
func (x *ConnectedAgentInfo) ProtoReflect() protoreflect.Message
func (*ConnectedAgentInfo) Reset ¶
func (x *ConnectedAgentInfo) Reset()
func (*ConnectedAgentInfo) String ¶
func (x *ConnectedAgentInfo) String() string
func (*ConnectedAgentInfo) Validate ¶ added in v17.1.0
func (m *ConnectedAgentInfo) Validate() error
Validate checks the field values on ConnectedAgentInfo with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*ConnectedAgentInfo) ValidateAll ¶ added in v17.1.0
func (m *ConnectedAgentInfo) ValidateAll() error
ValidateAll checks the field values on ConnectedAgentInfo with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ConnectedAgentInfoMultiError, or nil if none found.
type ConnectedAgentInfoCallback ¶
type ConnectedAgentInfoCallback func(*ConnectedAgentInfo) (done bool, err error)
type ConnectedAgentInfoCollector ¶
type ConnectedAgentInfoCollector []*ConnectedAgentInfo
func (*ConnectedAgentInfoCollector) Collect ¶
func (c *ConnectedAgentInfoCollector) Collect(info *ConnectedAgentInfo) (bool, error)
type ConnectedAgentInfoMultiError ¶ added in v17.1.0
type ConnectedAgentInfoMultiError []error
ConnectedAgentInfoMultiError is an error wrapping multiple validation errors returned by ConnectedAgentInfo.ValidateAll() if the designated constraints aren't met.
func (ConnectedAgentInfoMultiError) AllErrors ¶ added in v17.1.0
func (m ConnectedAgentInfoMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ConnectedAgentInfoMultiError) Error ¶ added in v17.1.0
func (m ConnectedAgentInfoMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ConnectedAgentInfoValidationError ¶ added in v17.1.0
type ConnectedAgentInfoValidationError struct {
// contains filtered or unexported fields
}
ConnectedAgentInfoValidationError is the validation error returned by ConnectedAgentInfo.Validate if the designated constraints aren't met.
func (ConnectedAgentInfoValidationError) Cause ¶ added in v17.1.0
func (e ConnectedAgentInfoValidationError) Cause() error
Cause function returns cause value.
func (ConnectedAgentInfoValidationError) Error ¶ added in v17.1.0
func (e ConnectedAgentInfoValidationError) Error() string
Error satisfies the builtin error interface
func (ConnectedAgentInfoValidationError) ErrorName ¶ added in v17.1.0
func (e ConnectedAgentInfoValidationError) ErrorName() string
ErrorName returns error name.
func (ConnectedAgentInfoValidationError) Field ¶ added in v17.1.0
func (e ConnectedAgentInfoValidationError) Field() string
Field function returns field value.
func (ConnectedAgentInfoValidationError) Key ¶ added in v17.1.0
func (e ConnectedAgentInfoValidationError) Key() bool
Key function returns key value.
func (ConnectedAgentInfoValidationError) Reason ¶ added in v17.1.0
func (e ConnectedAgentInfoValidationError) Reason() string
Reason function returns reason value.
type DisconnectAgentInfo ¶ added in v17.1.0
type DisconnectAgentInfo struct { AgentMeta *entity.AgentMeta `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 (*DisconnectAgentInfo) Descriptor
deprecated
added in
v17.1.0
func (*DisconnectAgentInfo) Descriptor() ([]byte, []int)
Deprecated: Use DisconnectAgentInfo.ProtoReflect.Descriptor instead.
func (*DisconnectAgentInfo) GetAgentId ¶ added in v17.1.0
func (x *DisconnectAgentInfo) GetAgentId() int64
func (*DisconnectAgentInfo) GetAgentMeta ¶ added in v17.1.0
func (x *DisconnectAgentInfo) GetAgentMeta() *entity.AgentMeta
func (*DisconnectAgentInfo) GetConnectionId ¶ added in v17.1.0
func (x *DisconnectAgentInfo) GetConnectionId() int64
func (*DisconnectAgentInfo) GetProjectId ¶ added in v17.1.0
func (x *DisconnectAgentInfo) GetProjectId() int64
func (*DisconnectAgentInfo) ProtoMessage ¶ added in v17.1.0
func (*DisconnectAgentInfo) ProtoMessage()
func (*DisconnectAgentInfo) ProtoReflect ¶ added in v17.1.0
func (x *DisconnectAgentInfo) ProtoReflect() protoreflect.Message
func (*DisconnectAgentInfo) Reset ¶ added in v17.1.0
func (x *DisconnectAgentInfo) Reset()
func (*DisconnectAgentInfo) String ¶ added in v17.1.0
func (x *DisconnectAgentInfo) String() string
func (*DisconnectAgentInfo) Validate ¶ added in v17.1.0
func (m *DisconnectAgentInfo) Validate() error
Validate checks the field values on DisconnectAgentInfo with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*DisconnectAgentInfo) ValidateAll ¶ added in v17.1.0
func (m *DisconnectAgentInfo) ValidateAll() error
ValidateAll checks the field values on DisconnectAgentInfo with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DisconnectAgentInfoMultiError, or nil if none found.
type DisconnectAgentInfoMultiError ¶ added in v17.1.0
type DisconnectAgentInfoMultiError []error
DisconnectAgentInfoMultiError is an error wrapping multiple validation errors returned by DisconnectAgentInfo.ValidateAll() if the designated constraints aren't met.
func (DisconnectAgentInfoMultiError) AllErrors ¶ added in v17.1.0
func (m DisconnectAgentInfoMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (DisconnectAgentInfoMultiError) Error ¶ added in v17.1.0
func (m DisconnectAgentInfoMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type DisconnectAgentInfoValidationError ¶ added in v17.1.0
type DisconnectAgentInfoValidationError struct {
// contains filtered or unexported fields
}
DisconnectAgentInfoValidationError is the validation error returned by DisconnectAgentInfo.Validate if the designated constraints aren't met.
func (DisconnectAgentInfoValidationError) Cause ¶ added in v17.1.0
func (e DisconnectAgentInfoValidationError) Cause() error
Cause function returns cause value.
func (DisconnectAgentInfoValidationError) Error ¶ added in v17.1.0
func (e DisconnectAgentInfoValidationError) Error() string
Error satisfies the builtin error interface
func (DisconnectAgentInfoValidationError) ErrorName ¶ added in v17.1.0
func (e DisconnectAgentInfoValidationError) ErrorName() string
ErrorName returns error name.
func (DisconnectAgentInfoValidationError) Field ¶ added in v17.1.0
func (e DisconnectAgentInfoValidationError) Field() string
Field function returns field value.
func (DisconnectAgentInfoValidationError) Key ¶ added in v17.1.0
func (e DisconnectAgentInfoValidationError) Key() bool
Key function returns key value.
func (DisconnectAgentInfoValidationError) Reason ¶ added in v17.1.0
func (e DisconnectAgentInfoValidationError) Reason() string
Reason function returns reason value.
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 *ConnectedAgentInfo) 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 *DisconnectAgentInfo) error }
type Querier ¶
type Querier interface { GetConnectionsByAgentID(ctx context.Context, agentID int64, cb ConnectedAgentInfoCallback) error GetConnectionsByProjectID(ctx context.Context, projectID int64, cb ConnectedAgentInfoCallback) 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 *zap.Logger, errRep errz.ErrReporter, 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, agentID int64, cb ConnectedAgentInfoCallback) error
func (*RedisTracker) GetConnectionsByProjectID ¶
func (t *RedisTracker) GetConnectionsByProjectID(ctx context.Context, projectID int64, cb ConnectedAgentInfoCallback) error
func (*RedisTracker) RegisterExpiring ¶
func (t *RedisTracker) RegisterExpiring(ctx context.Context, info *ConnectedAgentInfo) error
func (*RedisTracker) Unregister ¶ added in v17.1.0
func (t *RedisTracker) Unregister(ctx context.Context, info *DisconnectAgentInfo) error