Documentation ¶
Index ¶
- Constants
- Variables
- type ConnectedAgentInfo
- func (*ConnectedAgentInfo) Descriptor() ([]byte, []int)deprecated
- func (x *ConnectedAgentInfo) GetAgentId() int64
- func (x *ConnectedAgentInfo) GetAgentMeta() *modshared.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
- type ConnectedAgentInfoCallback
- type ConnectedAgentInfoCollector
- type Querier
- type RedisTracker
- 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) RegisterConnection(ctx context.Context, info *ConnectedAgentInfo) bool
- func (t *RedisTracker) Run(ctx context.Context) error
- func (t *RedisTracker) UnregisterConnection(ctx context.Context, info *ConnectedAgentInfo) bool
- type Registerer
- 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 ConnectedAgentInfo ¶
type ConnectedAgentInfo struct { AgentMeta *modshared.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() *modshared.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
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 Querier ¶
type Querier interface { GetConnectionsByAgentId(ctx context.Context, agentId int64, cb ConnectedAgentInfoCallback) error GetConnectionsByProjectId(ctx context.Context, projectId int64, cb ConnectedAgentInfoCallback) error }
type RedisTracker ¶
type RedisTracker struct {
// contains filtered or unexported fields
}
func NewRedisTracker ¶
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) RegisterConnection ¶
func (t *RedisTracker) RegisterConnection(ctx context.Context, info *ConnectedAgentInfo) bool
func (*RedisTracker) UnregisterConnection ¶
func (t *RedisTracker) UnregisterConnection(ctx context.Context, info *ConnectedAgentInfo) bool
type Registerer ¶
type Registerer interface { // RegisterConnection schedules the connection to be registered with the tracker. // Returns true on success and false if ctx signaled done. RegisterConnection(ctx context.Context, info *ConnectedAgentInfo) bool // UnregisterConnection schedules the connection to be unregistered with the tracker. // Returns true on success and false if ctx signaled done. UnregisterConnection(ctx context.Context, info *ConnectedAgentInfo) bool }
Click to show internal directories.
Click to hide internal directories.