agent_tracker

package
v19.0.0-rc42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

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" json:"agent_id,omitempty"`
	PodId   int64 `protobuf:"varint,2,opt,name=pod_id" 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

type ConnectedAgentkInfo struct {
	AgentMeta    *agentk.Meta           `protobuf:"bytes,1,opt,name=agent_meta" json:"agent_meta,omitempty"`
	ConnectedAt  *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=connected_at" json:"connected_at,omitempty"`
	ConnectionId int64                  `protobuf:"varint,3,opt,name=connection_id" json:"connection_id,omitempty"`
	AgentId      int64                  `protobuf:"varint,4,opt,name=agent_id" json:"agent_id,omitempty"`
	ProjectId    int64                  `protobuf:"varint,5,opt,name=project_id" json:"project_id,omitempty"`
	// contains filtered or unexported fields
}

func (*ConnectedAgentkInfo) Descriptor deprecated

func (*ConnectedAgentkInfo) Descriptor() ([]byte, []int)

Deprecated: Use ConnectedAgentkInfo.ProtoReflect.Descriptor instead.

func (*ConnectedAgentkInfo) GetAgentId

func (x *ConnectedAgentkInfo) GetAgentId() int64

func (*ConnectedAgentkInfo) GetAgentMeta

func (x *ConnectedAgentkInfo) GetAgentMeta() *agentk.Meta

func (*ConnectedAgentkInfo) GetConnectedAt

func (x *ConnectedAgentkInfo) GetConnectedAt() *timestamppb.Timestamp

func (*ConnectedAgentkInfo) GetConnectionId

func (x *ConnectedAgentkInfo) GetConnectionId() int64

func (*ConnectedAgentkInfo) GetProjectId

func (x *ConnectedAgentkInfo) GetProjectId() int64

func (*ConnectedAgentkInfo) ProtoMessage

func (*ConnectedAgentkInfo) ProtoMessage()

func (*ConnectedAgentkInfo) ProtoReflect

func (x *ConnectedAgentkInfo) ProtoReflect() protoreflect.Message

func (*ConnectedAgentkInfo) Reset

func (x *ConnectedAgentkInfo) Reset()

func (*ConnectedAgentkInfo) String

func (x *ConnectedAgentkInfo) String() string

type ConnectedAgentwInfo

type ConnectedAgentwInfo struct {
	AgentMeta    *agentw.Meta           `protobuf:"bytes,1,opt,name=agent_meta" json:"agent_meta,omitempty"`
	ConnectedAt  *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=connected_at" json:"connected_at,omitempty"`
	ConnectionId int64                  `protobuf:"varint,3,opt,name=connection_id" json:"connection_id,omitempty"`
	WorkspaceId  int64                  `protobuf:"varint,4,opt,name=workspace_id" json:"workspace_id,omitempty"`
	// contains filtered or unexported fields
}

func (*ConnectedAgentwInfo) Descriptor deprecated

func (*ConnectedAgentwInfo) Descriptor() ([]byte, []int)

Deprecated: Use ConnectedAgentwInfo.ProtoReflect.Descriptor instead.

func (*ConnectedAgentwInfo) GetAgentMeta

func (x *ConnectedAgentwInfo) GetAgentMeta() *agentw.Meta

func (*ConnectedAgentwInfo) GetConnectedAt

func (x *ConnectedAgentwInfo) GetConnectedAt() *timestamppb.Timestamp

func (*ConnectedAgentwInfo) GetConnectionId

func (x *ConnectedAgentwInfo) GetConnectionId() int64

func (*ConnectedAgentwInfo) GetWorkspaceId

func (x *ConnectedAgentwInfo) GetWorkspaceId() int64

func (*ConnectedAgentwInfo) ProtoMessage

func (*ConnectedAgentwInfo) ProtoMessage()

func (*ConnectedAgentwInfo) ProtoReflect

func (x *ConnectedAgentwInfo) ProtoReflect() protoreflect.Message

func (*ConnectedAgentwInfo) Reset

func (x *ConnectedAgentwInfo) Reset()

func (*ConnectedAgentwInfo) String

func (x *ConnectedAgentwInfo) String() string

type ConnectedRunnerControllerInfo

type ConnectedRunnerControllerInfo struct {
	AgentMeta    *runnerc.Meta          `protobuf:"bytes,1,opt,name=agent_meta" json:"agent_meta,omitempty"`
	ConnectedAt  *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=connected_at" json:"connected_at,omitempty"`
	ConnectionId int64                  `protobuf:"varint,3,opt,name=connection_id" json:"connection_id,omitempty"`
	AgentId      int64                  `protobuf:"varint,4,opt,name=agent_id" json:"agent_id,omitempty"`
	// contains filtered or unexported fields
}

func (*ConnectedRunnerControllerInfo) Descriptor deprecated

func (*ConnectedRunnerControllerInfo) Descriptor() ([]byte, []int)

Deprecated: Use ConnectedRunnerControllerInfo.ProtoReflect.Descriptor instead.

func (*ConnectedRunnerControllerInfo) GetAgentId

func (x *ConnectedRunnerControllerInfo) GetAgentId() int64

func (*ConnectedRunnerControllerInfo) GetAgentMeta

func (x *ConnectedRunnerControllerInfo) GetAgentMeta() *runnerc.Meta

func (*ConnectedRunnerControllerInfo) GetConnectedAt

func (*ConnectedRunnerControllerInfo) GetConnectionId

func (x *ConnectedRunnerControllerInfo) GetConnectionId() int64

func (*ConnectedRunnerControllerInfo) ProtoMessage

func (*ConnectedRunnerControllerInfo) ProtoMessage()

func (*ConnectedRunnerControllerInfo) ProtoReflect

func (*ConnectedRunnerControllerInfo) Reset

func (x *ConnectedRunnerControllerInfo) Reset()

func (*ConnectedRunnerControllerInfo) String

type DisconnectAgentkInfo

type DisconnectAgentkInfo struct {
	AgentMeta    *agentk.Meta `protobuf:"bytes,1,opt,name=agent_meta" json:"agent_meta,omitempty"`
	ConnectionId int64        `protobuf:"varint,2,opt,name=connection_id" json:"connection_id,omitempty"`
	AgentId      int64        `protobuf:"varint,3,opt,name=agent_id" json:"agent_id,omitempty"`
	ProjectId    int64        `protobuf:"varint,4,opt,name=project_id" json:"project_id,omitempty"`
	// contains filtered or unexported fields
}

func (*DisconnectAgentkInfo) Descriptor deprecated

func (*DisconnectAgentkInfo) Descriptor() ([]byte, []int)

Deprecated: Use DisconnectAgentkInfo.ProtoReflect.Descriptor instead.

func (*DisconnectAgentkInfo) GetAgentId

func (x *DisconnectAgentkInfo) GetAgentId() int64

func (*DisconnectAgentkInfo) GetAgentMeta

func (x *DisconnectAgentkInfo) GetAgentMeta() *agentk.Meta

func (*DisconnectAgentkInfo) GetConnectionId

func (x *DisconnectAgentkInfo) GetConnectionId() int64

func (*DisconnectAgentkInfo) GetProjectId

func (x *DisconnectAgentkInfo) GetProjectId() int64

func (*DisconnectAgentkInfo) ProtoMessage

func (*DisconnectAgentkInfo) ProtoMessage()

func (*DisconnectAgentkInfo) ProtoReflect

func (x *DisconnectAgentkInfo) ProtoReflect() protoreflect.Message

func (*DisconnectAgentkInfo) Reset

func (x *DisconnectAgentkInfo) Reset()

func (*DisconnectAgentkInfo) String

func (x *DisconnectAgentkInfo) String() string

type DisconnectAgentwInfo

type DisconnectAgentwInfo struct {
	AgentMeta    *agentw.Meta `protobuf:"bytes,1,opt,name=agent_meta" json:"agent_meta,omitempty"`
	ConnectionId int64        `protobuf:"varint,2,opt,name=connection_id" json:"connection_id,omitempty"`
	WorkspaceId  int64        `protobuf:"varint,3,opt,name=workspace_id" json:"workspace_id,omitempty"`
	// contains filtered or unexported fields
}

func (*DisconnectAgentwInfo) Descriptor deprecated

func (*DisconnectAgentwInfo) Descriptor() ([]byte, []int)

Deprecated: Use DisconnectAgentwInfo.ProtoReflect.Descriptor instead.

func (*DisconnectAgentwInfo) GetAgentMeta

func (x *DisconnectAgentwInfo) GetAgentMeta() *agentw.Meta

func (*DisconnectAgentwInfo) GetConnectionId

func (x *DisconnectAgentwInfo) GetConnectionId() int64

func (*DisconnectAgentwInfo) GetWorkspaceId

func (x *DisconnectAgentwInfo) GetWorkspaceId() int64

func (*DisconnectAgentwInfo) ProtoMessage

func (*DisconnectAgentwInfo) ProtoMessage()

func (*DisconnectAgentwInfo) ProtoReflect

func (x *DisconnectAgentwInfo) ProtoReflect() protoreflect.Message

func (*DisconnectAgentwInfo) Reset

func (x *DisconnectAgentwInfo) Reset()

func (*DisconnectAgentwInfo) String

func (x *DisconnectAgentwInfo) String() string

type DisconnectRunnerControllerInfo

type DisconnectRunnerControllerInfo struct {
	AgentMeta    *runnerc.Meta `protobuf:"bytes,1,opt,name=agent_meta" json:"agent_meta,omitempty"`
	ConnectionId int64         `protobuf:"varint,2,opt,name=connection_id" json:"connection_id,omitempty"`
	AgentId      int64         `protobuf:"varint,3,opt,name=agent_id" json:"agent_id,omitempty"`
	// contains filtered or unexported fields
}

func (*DisconnectRunnerControllerInfo) Descriptor deprecated

func (*DisconnectRunnerControllerInfo) Descriptor() ([]byte, []int)

Deprecated: Use DisconnectRunnerControllerInfo.ProtoReflect.Descriptor instead.

func (*DisconnectRunnerControllerInfo) GetAgentId

func (x *DisconnectRunnerControllerInfo) GetAgentId() int64

func (*DisconnectRunnerControllerInfo) GetAgentMeta

func (x *DisconnectRunnerControllerInfo) GetAgentMeta() *runnerc.Meta

func (*DisconnectRunnerControllerInfo) GetConnectionId

func (x *DisconnectRunnerControllerInfo) GetConnectionId() int64

func (*DisconnectRunnerControllerInfo) ProtoMessage

func (*DisconnectRunnerControllerInfo) ProtoMessage()

func (*DisconnectRunnerControllerInfo) ProtoReflect

func (*DisconnectRunnerControllerInfo) Reset

func (x *DisconnectRunnerControllerInfo) Reset()

func (*DisconnectRunnerControllerInfo) String

type ExpiringRegisterer

type ExpiringRegisterer interface {
	// RegisterAgentkExpiring registers agentk connection with the tracker.
	// Registration will expire if not refreshed using this method.
	RegisterAgentkExpiring(ctx context.Context, info *ConnectedAgentkInfo) error
	// RegisterAgentwExpiring registers agentw connection with the tracker.
	// Registration will expire if not refreshed using this method.
	RegisterAgentwExpiring(ctx context.Context, info *ConnectedAgentwInfo) error
	// RegisterRunnerControllerExpiring registers runnerc connection with the tracker.
	// Registration will expire if not refreshed using this method.
	RegisterRunnerControllerExpiring(ctx context.Context, info *ConnectedRunnerControllerInfo) error
	// UnregisterAgentk unregisters agentk connection with the tracker.
	// This may be called to intentionally unregister the agentk,
	// even though it may eventually expire.
	UnregisterAgentk(ctx context.Context, info *DisconnectAgentkInfo) error
	// UnregisterAgentw unregisters agentw connection with the tracker.
	// This may be called to intentionally unregister the agentw,
	// even though it may eventually expire.
	UnregisterAgentw(ctx context.Context, info *DisconnectAgentwInfo) error
	// UnregisterRunnerController unregisters runnerc connection with the tracker.
	// This may be called to intentionally unregister the runnerc,
	// even though it may eventually expire.
	UnregisterRunnerController(ctx context.Context, info *DisconnectRunnerControllerInfo) error
}

type Querier

type Querier interface {
	GetAgentkConnectionsByID(ctx context.Context, agentID int64) iter.Seq[*ConnectedAgentkInfo]
	GetAgentwConnectionsByID(ctx context.Context, agentID int64) iter.Seq[*ConnectedAgentwInfo]
	GetRunnerControllerConnectionsByID(ctx context.Context, agentID int64) iter.Seq[*ConnectedRunnerControllerInfo]
	GetConnectedAgentsCount(ctx context.Context) (int64, error)
	CountAgentksByAgentVersions(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) CountAgentksByAgentVersions

func (t *RedisTracker) CountAgentksByAgentVersions(ctx context.Context) (map[string]int64, error)

func (*RedisTracker) GetAgentkConnectionsByID

func (t *RedisTracker) GetAgentkConnectionsByID(ctx context.Context, agentID int64) iter.Seq[*ConnectedAgentkInfo]

func (*RedisTracker) GetAgentwConnectionsByID

func (t *RedisTracker) GetAgentwConnectionsByID(ctx context.Context, agentID int64) iter.Seq[*ConnectedAgentwInfo]

func (*RedisTracker) GetConnectedAgentsCount

func (t *RedisTracker) GetConnectedAgentsCount(ctx context.Context) (int64, error)

func (*RedisTracker) GetRunnerControllerConnectionsByID

func (t *RedisTracker) GetRunnerControllerConnectionsByID(ctx context.Context, agentID int64) iter.Seq[*ConnectedRunnerControllerInfo]

func (*RedisTracker) RegisterAgentkExpiring

func (t *RedisTracker) RegisterAgentkExpiring(ctx context.Context, info *ConnectedAgentkInfo) error

func (*RedisTracker) RegisterAgentwExpiring

func (t *RedisTracker) RegisterAgentwExpiring(ctx context.Context, info *ConnectedAgentwInfo) error

func (*RedisTracker) RegisterRunnerControllerExpiring

func (t *RedisTracker) RegisterRunnerControllerExpiring(ctx context.Context, info *ConnectedRunnerControllerInfo) error

func (*RedisTracker) Run

func (t *RedisTracker) Run(ctx context.Context) error

func (*RedisTracker) UnregisterAgentk

func (t *RedisTracker) UnregisterAgentk(ctx context.Context, info *DisconnectAgentkInfo) error

func (*RedisTracker) UnregisterAgentw

func (t *RedisTracker) UnregisterAgentw(ctx context.Context, info *DisconnectAgentwInfo) error

func (*RedisTracker) UnregisterRunnerController

func (t *RedisTracker) UnregisterRunnerController(ctx context.Context, info *DisconnectRunnerControllerInfo) error

type Tracker

type Tracker interface {
	ExpiringRegisterer
	Querier
	Run(ctx context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL