Documentation
¶
Overview ¶
Package postgres bulk insert helpers (P3-PERF-01a).
These methods implement the Put*Bulk / Append*Bulk additions on the Store interface. Each one builds a chunked multi-row `INSERT ... VALUES (...),(...) ON CONFLICT ...` statement so the control-plane batch writer can flush a full buffer in a single round-trip instead of N individual INSERTs.
pgx.CopyFrom is not used here because the project talks to Postgres through database/sql + pgx/v5/stdlib, not through pgxpool, and CopyFrom requires a native pgx connection. Multi-row INSERT is the next-best option and still delivers an order-of-magnitude speedup over per-row Exec.
Chunking: Postgres allows up to 65535 bind parameters per query. We chunk at 250 rows — the widest row (server_load, 27 columns) uses 250 * 27 = 6750 params, well under the 65535 cap. 250 was picked after the P3-PERF-01b chunk-size sweep: per-row throughput peaks around 100-250 rows and regresses at 500+ because the generated SQL and argument slice both grow super-linearly with chunk size. Every bulk method runs inside a single transaction so partial failure rolls the whole batch back.
Package postgres hosts the PostgreSQL-backed storage.Store implementation. This file owns schema management — it delegates entirely to goose, which discovers versioned .sql migrations from an embedded FS and records applied versions in the goose_db_version table. Historically this package contained a hand-rolled Migrate() with a single big initialSchema string plus a handful of idempotent ALTERs; that approach left no audit trail of which migrations had run (see DF-20 / M-F8 in the security review).
Index ¶
- Variables
- func Migrate(db *sql.DB) error
- func MigrateContext(ctx context.Context, db *sql.DB) error
- func Status(ctx context.Context, db *sql.DB) error
- type Store
- func (s *Store) AppendAuditEvent(ctx context.Context, event storage.AuditEventRecord) error
- func (s *Store) AppendDCHealthPoint(ctx context.Context, record storage.DCHealthPointRecord) error
- func (s *Store) AppendDCHealthPointsBulk(ctx context.Context, records []storage.DCHealthPointRecord) error
- func (s *Store) AppendMetricSnapshot(ctx context.Context, snapshot storage.MetricSnapshotRecord) error
- func (s *Store) AppendMetricSnapshotsBulk(ctx context.Context, snapshots []storage.MetricSnapshotRecord) error
- func (s *Store) AppendServerLoadPoint(ctx context.Context, record storage.ServerLoadPointRecord) error
- func (s *Store) AppendServerLoadPointsBulk(ctx context.Context, records []storage.ServerLoadPointRecord) error
- func (s *Store) AppendTelemetryRuntimeEvents(ctx context.Context, agentID string, ...) error
- func (s *Store) Close() error
- func (s *Store) ConsumeEnrollmentToken(ctx context.Context, value string, consumedAt time.Time) (storage.EnrollmentTokenRecord, error)
- func (s *Store) CountFleetGroupMembers(ctx context.Context, fleetGroupID string) (storage.ReassignCounts, error)
- func (s *Store) CountUniqueClientIPs(ctx context.Context, clientID string) (int, error)
- func (s *Store) CreateFleetGroup(ctx context.Context, group storage.FleetGroupRecord) error
- func (s *Store) CreateFleetGroupIntegration(ctx context.Context, i storage.FleetGroupIntegrationRecord) error
- func (s *Store) CreateIntegrationProvider(ctx context.Context, p storage.IntegrationProviderRecord) error
- func (s *Store) DeleteAgent(ctx context.Context, agentID string) error
- func (s *Store) DeleteClientAssignments(ctx context.Context, clientID string) error
- func (s *Store) DeleteClientUsageByClient(ctx context.Context, clientID string) error
- func (s *Store) DeleteDiscoveredClient(ctx context.Context, id string) error
- func (s *Store) DeleteExpiredAgentRevocations(ctx context.Context, before time.Time) (int64, error)
- func (s *Store) DeleteExpiredLoginLockouts(ctx context.Context, before time.Time) (int64, error)
- func (s *Store) DeleteExpiredSessions(ctx context.Context, before time.Time) error
- func (s *Store) DeleteFleetGroup(ctx context.Context, id string) error
- func (s *Store) DeleteFleetGroupIntegration(ctx context.Context, id string) error
- func (s *Store) DeleteInstancesByAgent(ctx context.Context, agentID string) error
- func (s *Store) DeleteIntegrationProvider(ctx context.Context, id string) error
- func (s *Store) DeleteLoginLockout(ctx context.Context, username string) error
- func (s *Store) DeleteSession(ctx context.Context, sessionID string) error
- func (s *Store) DeleteTelemetryDetailBoost(ctx context.Context, agentID string) error
- func (s *Store) DeleteUser(ctx context.Context, userID string) error
- func (s *Store) GetAgentCertificateRecoveryGrant(ctx context.Context, agentID string) (storage.AgentCertificateRecoveryGrantRecord, error)
- func (s *Store) GetCertificateAuthority(ctx context.Context) (storage.CertificateAuthorityRecord, error)
- func (s *Store) GetClientByID(ctx context.Context, clientID string) (storage.ClientRecord, error)
- func (s *Store) GetDiscoveredClient(ctx context.Context, id string) (storage.DiscoveredClientRecord, error)
- func (s *Store) GetDiscoveredClientByAgentAndName(ctx context.Context, agentID string, clientName string) (storage.DiscoveredClientRecord, error)
- func (s *Store) GetEnrollmentToken(ctx context.Context, value string) (storage.EnrollmentTokenRecord, error)
- func (s *Store) GetFleetGroup(ctx context.Context, id string) (storage.FleetGroupRecord, error)
- func (s *Store) GetFleetGroupByName(ctx context.Context, name string) (storage.FleetGroupRecord, error)
- func (s *Store) GetFleetGroupIntegration(ctx context.Context, id string) (storage.FleetGroupIntegrationRecord, error)
- func (s *Store) GetIntegrationProvider(ctx context.Context, id string) (storage.IntegrationProviderRecord, error)
- func (s *Store) GetJobByIdempotencyKey(ctx context.Context, idempotencyKey string) (storage.JobRecord, error)
- func (s *Store) GetLoginLockout(ctx context.Context, username string) (storage.LoginLockoutRecord, error)
- func (s *Store) GetPanelSettings(ctx context.Context) (storage.PanelSettingsRecord, error)
- func (s *Store) GetRetentionSettings(ctx context.Context) (storage.RetentionSettings, error)
- func (s *Store) GetSession(ctx context.Context, sessionID string) (storage.SessionRecord, error)
- func (s *Store) GetTelemetryDiagnosticsCurrent(ctx context.Context, agentID string) (storage.TelemetryDiagnosticsCurrentRecord, error)
- func (s *Store) GetTelemetryRuntimeCurrent(ctx context.Context, agentID string) (storage.TelemetryRuntimeCurrentRecord, error)
- func (s *Store) GetTelemetrySecurityInventoryCurrent(ctx context.Context, agentID string) (storage.TelemetrySecurityInventoryCurrentRecord, error)
- func (s *Store) GetUpdateSettings(ctx context.Context) (json.RawMessage, error)
- func (s *Store) GetUpdateState(ctx context.Context) (json.RawMessage, error)
- func (s *Store) GetUserAppearance(ctx context.Context, userID string) (storage.UserAppearanceRecord, error)
- func (s *Store) GetUserByID(ctx context.Context, userID string) (storage.UserRecord, error)
- func (s *Store) GetUserByUsername(ctx context.Context, username string) (storage.UserRecord, error)
- func (s *Store) ListAgentCertificateRecoveryGrants(ctx context.Context) ([]storage.AgentCertificateRecoveryGrantRecord, error)
- func (s *Store) ListAgentRevocations(ctx context.Context) ([]storage.AgentRevocationRecord, error)
- func (s *Store) ListAgents(ctx context.Context) ([]storage.AgentRecord, error)
- func (s *Store) ListAuditEvents(ctx context.Context, limit int) ([]storage.AuditEventRecord, error)
- func (s *Store) ListClientAssignments(ctx context.Context, clientID string) ([]storage.ClientAssignmentRecord, error)
- func (s *Store) ListClientDeployments(ctx context.Context, clientID string) ([]storage.ClientDeploymentRecord, error)
- func (s *Store) ListClientIPHistory(ctx context.Context, clientID string, from time.Time, to time.Time) ([]storage.ClientIPHistoryRecord, error)
- func (s *Store) ListClientUsage(ctx context.Context) ([]storage.ClientUsageRecord, error)
- func (s *Store) ListClients(ctx context.Context) ([]storage.ClientRecord, error)
- func (s *Store) ListDCHealthPoints(ctx context.Context, agentID string, from time.Time, to time.Time) ([]storage.DCHealthPointRecord, error)
- func (s *Store) ListDiscoveredClients(ctx context.Context) ([]storage.DiscoveredClientRecord, error)
- func (s *Store) ListDiscoveredClientsByAgent(ctx context.Context, agentID string) ([]storage.DiscoveredClientRecord, error)
- func (s *Store) ListEnrollmentTokens(ctx context.Context) ([]storage.EnrollmentTokenRecord, error)
- func (s *Store) ListFleetGroupIntegrations(ctx context.Context, fleetGroupID string) ([]storage.FleetGroupIntegrationRecord, error)
- func (s *Store) ListFleetGroups(ctx context.Context) ([]storage.FleetGroupRecord, error)
- func (s *Store) ListInstances(ctx context.Context) ([]storage.InstanceRecord, error)
- func (s *Store) ListIntegrationProviders(ctx context.Context) ([]storage.IntegrationProviderRecord, error)
- func (s *Store) ListIntegrationProvidersByKind(ctx context.Context, kind string) ([]storage.IntegrationProviderRecord, error)
- func (s *Store) ListJobTargets(ctx context.Context, jobID string) ([]storage.JobTargetRecord, error)
- func (s *Store) ListJobs(ctx context.Context) ([]storage.JobRecord, error)
- func (s *Store) ListLoginLockouts(ctx context.Context) ([]storage.LoginLockoutRecord, error)
- func (s *Store) ListMetricSnapshots(ctx context.Context) ([]storage.MetricSnapshotRecord, error)
- func (s *Store) ListServerLoadHourly(ctx context.Context, agentID string, from time.Time, to time.Time) ([]storage.ServerLoadHourlyRecord, error)
- func (s *Store) ListServerLoadPoints(ctx context.Context, agentID string, from time.Time, to time.Time) ([]storage.ServerLoadPointRecord, error)
- func (s *Store) ListSessions(ctx context.Context) ([]storage.SessionRecord, error)
- func (s *Store) ListTelemetryDetailBoosts(ctx context.Context) ([]storage.TelemetryDetailBoostRecord, error)
- func (s *Store) ListTelemetryRuntimeCurrent(ctx context.Context) ([]storage.TelemetryRuntimeCurrentRecord, error)
- func (s *Store) ListTelemetryRuntimeDCs(ctx context.Context, agentID string) ([]storage.TelemetryRuntimeDCRecord, error)
- func (s *Store) ListTelemetryRuntimeEvents(ctx context.Context, agentID string, limit int) ([]storage.TelemetryRuntimeEventRecord, error)
- func (s *Store) ListTelemetryRuntimeUpstreams(ctx context.Context, agentID string) ([]storage.TelemetryRuntimeUpstreamRecord, error)
- func (s *Store) ListUserAppearances(ctx context.Context) ([]storage.UserAppearanceRecord, error)
- func (s *Store) ListUsers(ctx context.Context) ([]storage.UserRecord, error)
- func (s *Store) Ping(ctx context.Context) error
- func (s *Store) PruneAuditEvents(ctx context.Context, before time.Time) (int64, error)
- func (s *Store) PruneClientIPHistory(ctx context.Context, olderThan time.Time) (int64, error)
- func (s *Store) PruneDCHealthPoints(ctx context.Context, olderThan time.Time) (int64, error)
- func (s *Store) PruneMetricSnapshots(ctx context.Context, before time.Time) (int64, error)
- func (s *Store) PruneServerLoadHourly(ctx context.Context, olderThan time.Time) (int64, error)
- func (s *Store) PruneServerLoadPoints(ctx context.Context, olderThan time.Time) (int64, error)
- func (s *Store) PruneTelemetryRuntimeEvents(ctx context.Context, olderThan time.Time) (int64, error)
- func (s *Store) PutAgent(ctx context.Context, agent storage.AgentRecord) error
- func (s *Store) PutAgentCertificateRecoveryGrant(ctx context.Context, grant storage.AgentCertificateRecoveryGrantRecord) error
- func (s *Store) PutAgentRevocation(ctx context.Context, r storage.AgentRevocationRecord) error
- func (s *Store) PutAgentsBulk(ctx context.Context, agents []storage.AgentRecord) error
- func (s *Store) PutCertificateAuthority(ctx context.Context, authority storage.CertificateAuthorityRecord) error
- func (s *Store) PutClient(ctx context.Context, client storage.ClientRecord) error
- func (s *Store) PutClientAssignment(ctx context.Context, assignment storage.ClientAssignmentRecord) error
- func (s *Store) PutClientDeployment(ctx context.Context, deployment storage.ClientDeploymentRecord) error
- func (s *Store) PutDiscoveredClient(ctx context.Context, record storage.DiscoveredClientRecord) error
- func (s *Store) PutEnrollmentToken(ctx context.Context, token storage.EnrollmentTokenRecord) error
- func (s *Store) PutFleetGroup(ctx context.Context, group storage.FleetGroupRecord) error
- func (s *Store) PutInstance(ctx context.Context, instance storage.InstanceRecord) error
- func (s *Store) PutInstancesBulk(ctx context.Context, instances []storage.InstanceRecord) error
- func (s *Store) PutJob(ctx context.Context, job storage.JobRecord) error
- func (s *Store) PutJobTarget(ctx context.Context, target storage.JobTargetRecord) error
- func (s *Store) PutPanelSettings(ctx context.Context, settings storage.PanelSettingsRecord) error
- func (s *Store) PutRetentionSettings(ctx context.Context, settings storage.RetentionSettings) error
- func (s *Store) PutSession(ctx context.Context, session storage.SessionRecord) error
- func (s *Store) PutTelemetryDetailBoost(ctx context.Context, record storage.TelemetryDetailBoostRecord) error
- func (s *Store) PutTelemetryDiagnosticsCurrent(ctx context.Context, record storage.TelemetryDiagnosticsCurrentRecord) error
- func (s *Store) PutTelemetryRuntimeCurrent(ctx context.Context, record storage.TelemetryRuntimeCurrentRecord) error
- func (s *Store) PutTelemetrySecurityInventoryCurrent(ctx context.Context, record storage.TelemetrySecurityInventoryCurrentRecord) error
- func (s *Store) PutUpdateSettings(ctx context.Context, data json.RawMessage) error
- func (s *Store) PutUpdateState(ctx context.Context, data json.RawMessage) error
- func (s *Store) PutUser(ctx context.Context, user storage.UserRecord) error
- func (s *Store) PutUserAppearance(ctx context.Context, appearance storage.UserAppearanceRecord) error
- func (s *Store) ReassignFleetGroupMembers(ctx context.Context, fromID, toID string) (storage.ReassignCounts, error)
- func (s *Store) ReplaceTelemetryRuntimeDCs(ctx context.Context, agentID string, ...) error
- func (s *Store) ReplaceTelemetryRuntimeUpstreams(ctx context.Context, agentID string, ...) error
- func (s *Store) RevokeAgentCertificateRecoveryGrant(ctx context.Context, agentID string, revokedAt time.Time) (storage.AgentCertificateRecoveryGrantRecord, error)
- func (s *Store) RevokeEnrollmentToken(ctx context.Context, value string, revokedAt time.Time) (storage.EnrollmentTokenRecord, error)
- func (s *Store) RollupServerLoadHourly(ctx context.Context, bucketHour time.Time) error
- func (s *Store) Transact(ctx context.Context, fn storage.TxFn) error
- func (s *Store) UpdateAgentNodeName(ctx context.Context, agentID string, nodeName string) error
- func (s *Store) UpdateDiscoveredClientStatus(ctx context.Context, id string, status string, updatedAt time.Time) error
- func (s *Store) UpdateFleetGroup(ctx context.Context, group storage.FleetGroupRecord) error
- func (s *Store) UpdateFleetGroupIntegration(ctx context.Context, i storage.FleetGroupIntegrationRecord) error
- func (s *Store) UpdateIntegrationProvider(ctx context.Context, p storage.IntegrationProviderRecord) error
- func (s *Store) UpsertClientIPHistory(ctx context.Context, record storage.ClientIPHistoryRecord) error
- func (s *Store) UpsertClientIPHistoryBulk(ctx context.Context, records []storage.ClientIPHistoryRecord) error
- func (s *Store) UpsertClientUsage(ctx context.Context, r storage.ClientUsageRecord) error
- func (s *Store) UpsertLoginLockout(ctx context.Context, record storage.LoginLockoutRecord) error
- func (s *Store) UseAgentCertificateRecoveryGrant(ctx context.Context, agentID string, usedAt time.Time) (storage.AgentCertificateRecoveryGrantRecord, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrDSNRequired reports a missing PostgreSQL connection string. ErrDSNRequired = errors.New("postgres dsn is required") )
Functions ¶
func Migrate ¶
Migrate brings the database schema up to the latest embedded migration. Safe to call repeatedly: goose skips versions already recorded in goose_db_version.
func MigrateContext ¶
MigrateContext is the context-aware variant of Migrate.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store persists control-plane records in a PostgreSQL database.
Store methods reference s.db via the dbExecutor interface so the same method bodies can run against a *sql.DB (outside Transact) or a *sql.Tx (inside Transact). s.sqlDB is the pool handle used for lifecycle (Ping, Close, BeginTx); it is nil on transaction-bound Stores to prevent accidental escape from the transaction boundary.
func (*Store) AppendAuditEvent ¶
func (*Store) AppendDCHealthPoint ¶
func (*Store) AppendDCHealthPointsBulk ¶
func (s *Store) AppendDCHealthPointsBulk(ctx context.Context, records []storage.DCHealthPointRecord) error
AppendDCHealthPointsBulk inserts a batch of DC-health points. Same ON CONFLICT DO NOTHING semantics as the single-row variant.
func (*Store) AppendMetricSnapshot ¶
func (*Store) AppendMetricSnapshotsBulk ¶
func (s *Store) AppendMetricSnapshotsBulk(ctx context.Context, snapshots []storage.MetricSnapshotRecord) error
AppendMetricSnapshotsBulk inserts a batch of metric snapshots. Rows have a synthetic ID primary key so no ON CONFLICT clause is needed — same as the single-row AppendMetricSnapshot.
func (*Store) AppendServerLoadPoint ¶
func (*Store) AppendServerLoadPointsBulk ¶
func (s *Store) AppendServerLoadPointsBulk(ctx context.Context, records []storage.ServerLoadPointRecord) error
AppendServerLoadPointsBulk inserts a batch of server-load points. Matches the single-row INSERT ... ON CONFLICT (agent_id, captured_at) DO NOTHING semantics so duplicate (agent,capture) pairs do not error.
func (*Store) AppendTelemetryRuntimeEvents ¶
func (*Store) ConsumeEnrollmentToken ¶
func (*Store) CountFleetGroupMembers ¶
func (*Store) CountUniqueClientIPs ¶
func (*Store) CreateFleetGroup ¶
func (*Store) CreateFleetGroupIntegration ¶
func (*Store) CreateIntegrationProvider ¶
func (*Store) DeleteClientAssignments ¶
func (*Store) DeleteClientUsageByClient ¶
func (*Store) DeleteDiscoveredClient ¶
func (*Store) DeleteExpiredAgentRevocations ¶
DeleteExpiredAgentRevocations removes entries whose cert has already expired — once the cert can no longer authenticate, the revocation entry is no longer useful and can shrink the table.
func (*Store) DeleteExpiredLoginLockouts ¶
func (*Store) DeleteExpiredSessions ¶
func (*Store) DeleteFleetGroup ¶
func (*Store) DeleteFleetGroupIntegration ¶
func (*Store) DeleteInstancesByAgent ¶
func (*Store) DeleteIntegrationProvider ¶
func (*Store) DeleteLoginLockout ¶
func (*Store) DeleteSession ¶
func (*Store) DeleteTelemetryDetailBoost ¶
func (*Store) GetAgentCertificateRecoveryGrant ¶
func (*Store) GetCertificateAuthority ¶
func (*Store) GetClientByID ¶
func (*Store) GetDiscoveredClient ¶
func (*Store) GetDiscoveredClientByAgentAndName ¶
func (*Store) GetEnrollmentToken ¶
func (*Store) GetFleetGroup ¶
func (*Store) GetFleetGroupByName ¶
func (*Store) GetFleetGroupIntegration ¶
func (*Store) GetIntegrationProvider ¶
func (*Store) GetJobByIdempotencyKey ¶
func (*Store) GetLoginLockout ¶
func (*Store) GetPanelSettings ¶
func (*Store) GetRetentionSettings ¶
func (*Store) GetSession ¶
func (*Store) GetTelemetryDiagnosticsCurrent ¶
func (*Store) GetTelemetryRuntimeCurrent ¶
func (*Store) GetTelemetrySecurityInventoryCurrent ¶
func (*Store) GetUpdateSettings ¶
func (*Store) GetUpdateState ¶
func (*Store) GetUserAppearance ¶
func (*Store) GetUserByID ¶
func (*Store) GetUserByUsername ¶
func (*Store) ListAgentCertificateRecoveryGrants ¶
func (*Store) ListAgentRevocations ¶
func (*Store) ListAgents ¶
func (*Store) ListAuditEvents ¶
func (*Store) ListClientAssignments ¶
func (*Store) ListClientDeployments ¶
func (*Store) ListClientIPHistory ¶
func (*Store) ListClientUsage ¶
func (*Store) ListClients ¶
func (*Store) ListDCHealthPoints ¶
func (*Store) ListDiscoveredClients ¶
func (*Store) ListDiscoveredClientsByAgent ¶
func (*Store) ListEnrollmentTokens ¶
func (*Store) ListFleetGroupIntegrations ¶
func (*Store) ListFleetGroups ¶
func (*Store) ListInstances ¶
func (*Store) ListIntegrationProviders ¶
func (*Store) ListIntegrationProvidersByKind ¶
func (*Store) ListJobTargets ¶
func (*Store) ListLoginLockouts ¶
func (*Store) ListMetricSnapshots ¶
func (*Store) ListServerLoadHourly ¶
func (*Store) ListServerLoadPoints ¶
func (*Store) ListSessions ¶
func (*Store) ListTelemetryDetailBoosts ¶
func (*Store) ListTelemetryRuntimeCurrent ¶
func (*Store) ListTelemetryRuntimeDCs ¶
func (*Store) ListTelemetryRuntimeEvents ¶
func (*Store) ListTelemetryRuntimeUpstreams ¶
func (*Store) ListUserAppearances ¶
func (*Store) PruneAuditEvents ¶
PruneAuditEvents deletes audit_events rows with created_at strictly before the cutoff and returns the RowsAffected count (P2-REL-04 / finding M-R2). Relies on idx_audit_events_created_at (added in P2-DB-02) for efficiency.
func (*Store) PruneClientIPHistory ¶
func (*Store) PruneDCHealthPoints ¶
func (*Store) PruneMetricSnapshots ¶
PruneMetricSnapshots deletes metric_snapshots rows with captured_at strictly before the cutoff and returns the RowsAffected count (P2-REL-05). Relies on idx_metric_snapshots_captured_at (added in P2-DB-02) for efficiency.
func (*Store) PruneServerLoadHourly ¶
func (*Store) PruneServerLoadPoints ¶
func (*Store) PruneTelemetryRuntimeEvents ¶
func (*Store) PutAgentCertificateRecoveryGrant ¶
func (*Store) PutAgentRevocation ¶
PutAgentRevocation upserts a revocation so repeated deregistrations are idempotent and cert_expires_at is kept fresh if the caller knows a newer cert existed.
func (*Store) PutAgentsBulk ¶
PutAgentsBulk upserts a batch of agents in a single transaction using chunked multi-row INSERT. See Store.PutAgentsBulk in storage/store.go for the full contract.
func (*Store) PutCertificateAuthority ¶
func (*Store) PutClientAssignment ¶
func (*Store) PutClientDeployment ¶
func (*Store) PutDiscoveredClient ¶
func (*Store) PutEnrollmentToken ¶
func (*Store) PutFleetGroup ¶
func (*Store) PutInstance ¶
func (*Store) PutInstancesBulk ¶
PutInstancesBulk upserts a batch of Telemt instances. See Store.PutInstancesBulk.
func (*Store) PutJobTarget ¶
func (*Store) PutPanelSettings ¶
func (*Store) PutRetentionSettings ¶
func (*Store) PutSession ¶
func (*Store) PutTelemetryDetailBoost ¶
func (*Store) PutTelemetryDiagnosticsCurrent ¶
func (*Store) PutTelemetryRuntimeCurrent ¶
func (*Store) PutTelemetrySecurityInventoryCurrent ¶
func (*Store) PutUpdateSettings ¶
func (*Store) PutUpdateState ¶
func (*Store) PutUserAppearance ¶
func (*Store) ReassignFleetGroupMembers ¶
func (s *Store) ReassignFleetGroupMembers(ctx context.Context, fromID, toID string) (storage.ReassignCounts, error)
ReassignFleetGroupMembers is NOT atomic on its own — callers must wrap the full delete flow in Store.Transact. See fleet.Service.Delete.
func (*Store) ReplaceTelemetryRuntimeDCs ¶
func (*Store) ReplaceTelemetryRuntimeUpstreams ¶
func (*Store) RevokeAgentCertificateRecoveryGrant ¶
func (*Store) RevokeEnrollmentToken ¶
func (*Store) RollupServerLoadHourly ¶
func (*Store) Transact ¶
Transact runs fn inside a single database transaction with read-committed isolation. On serialization failures it retries up to maxTransactRetries times. See storage.Store.Transact for the full contract.
func (*Store) UpdateAgentNodeName ¶
func (*Store) UpdateDiscoveredClientStatus ¶
func (*Store) UpdateFleetGroup ¶
UpdateFleetGroup mutates editable fields only; `name` is the immutable slug and is not in the SET list.
func (*Store) UpdateFleetGroupIntegration ¶
func (*Store) UpdateIntegrationProvider ¶
func (*Store) UpsertClientIPHistory ¶
func (*Store) UpsertClientIPHistoryBulk ¶
func (s *Store) UpsertClientIPHistoryBulk(ctx context.Context, records []storage.ClientIPHistoryRecord) error
UpsertClientIPHistoryBulk upserts a batch of client-ip history rows. Same ON CONFLICT (agent_id, client_id, ip_address) DO UPDATE SET last_seen as the single-row variant; when the same (agent, client, ip) key appears twice in one batch, the last row's last_seen wins.