postgres

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

func Open

func Open(ctx context.Context, databaseURL string) (*Store, error)

func (*Store) ApproveAgentEnrollment

func (s *Store) ApproveAgentEnrollment(ctx context.Context, tokenHash string, input model.ApproveAgentEnrollmentRequest) (model.AgentEnrollment, error)

func (*Store) ApproveAgentEnrollmentByID

func (s *Store) ApproveAgentEnrollmentByID(ctx context.Context, enrollmentID string, input model.ApproveAgentEnrollmentRequest) (model.AgentEnrollment, error)

func (*Store) AuthenticateAgentCredential

func (s *Store) AuthenticateAgentCredential(ctx context.Context, credentialID, credentialHash string) (string, error)

func (*Store) ClaimAgentEnrollment

func (s *Store) ClaimAgentEnrollment(ctx context.Context, tokenHash, credentialID, credentialHash, osName, architecture, version string) (model.AgentEnrollment, error)

func (*Store) ClaimDueBlacklistRecheck

func (s *Store) ClaimDueBlacklistRecheck(ctx context.Context, now, leaseUntil time.Time) (*model.BlacklistRecheckSettings, error)

func (*Store) ClaimDueScanSchedules

func (s *Store) ClaimDueScanSchedules(ctx context.Context, now, leaseUntil time.Time, limit int) ([]model.ScanSchedule, error)

func (*Store) ClaimDueSourceSyncSchedules

func (s *Store) ClaimDueSourceSyncSchedules(ctx context.Context, now, leaseUntil time.Time, limit int) ([]model.SourceSyncSchedule, error)

func (*Store) ClaimTasks

func (s *Store) ClaimTasks(ctx context.Context, agentID string, limit int) (*model.TaskBatch, error)

func (*Store) Close

func (s *Store) Close()

func (*Store) CreateASNSource

func (s *Store) CreateASNSource(ctx context.Context, input model.CreateASNSourceRequest) (model.ASNSource, error)

func (*Store) CreateAgentEnrollment

func (s *Store) CreateAgentEnrollment(ctx context.Context, input model.CreateAgentEnrollment) (model.AgentEnrollment, error)

func (*Store) CreateAuthSession

func (s *Store) CreateAuthSession(ctx context.Context, tokenHash, userID string, expiresAt time.Time) error

func (*Store) CreateBlacklistRechecks

func (s *Store) CreateBlacklistRechecks(ctx context.Context, settings model.BlacklistRecheckSettings) (model.BlacklistRecheckResult, error)

func (*Store) CreateScanJob

func (s *Store) CreateScanJob(ctx context.Context, input model.CreateScanJobRequest, targets []string) (model.ScanJob, error)

func (*Store) CreateScanSchedule

func (s *Store) CreateScanSchedule(ctx context.Context, input model.UpsertScanScheduleRequest, nextRun time.Time) (model.ScanSchedule, error)

func (*Store) CreateUser

func (s *Store) CreateUser(ctx context.Context, input model.CreateUserRequest, passwordHash string) (model.User, error)

func (*Store) DeleteASNSource

func (s *Store) DeleteASNSource(ctx context.Context, asn int64) error

func (*Store) DeleteAuthSession

func (s *Store) DeleteAuthSession(ctx context.Context, tokenHash string) error

func (*Store) DeleteScanSchedule

func (s *Store) DeleteScanSchedule(ctx context.Context, id string) error

func (*Store) DeleteUser

func (s *Store) DeleteUser(ctx context.Context, userID string) error

func (*Store) EnsureBootstrapAdmin

func (s *Store) EnsureBootstrapAdmin(ctx context.Context, username, displayName, passwordHash string) error

func (*Store) FindUserByUsername

func (s *Store) FindUserByUsername(ctx context.Context, username string) (model.UserCredential, error)

func (*Store) FinishAutomationRun

func (s *Store) FinishAutomationRun(ctx context.Context, id, status string, summary json.RawMessage, runErr error) error

func (*Store) GetAgentEnrollment

func (s *Store) GetAgentEnrollment(ctx context.Context, tokenHash string) (model.AgentEnrollment, error)

func (*Store) GetAgentEnrollmentByID

func (s *Store) GetAgentEnrollmentByID(ctx context.Context, enrollmentID string) (model.AgentEnrollment, error)

func (*Store) GetBlacklistRecheckSettings

func (s *Store) GetBlacklistRecheckSettings(ctx context.Context) (model.BlacklistRecheckSettings, error)

func (*Store) GetScanJob

func (s *Store) GetScanJob(ctx context.Context, id string) (model.ScanJob, error)

func (*Store) GetScanSchedule

func (s *Store) GetScanSchedule(ctx context.Context, id string) (model.ScanSchedule, error)

func (*Store) GetSourceSyncSchedule

func (s *Store) GetSourceSyncSchedule(ctx context.Context, source string) (model.SourceSyncSchedule, error)

func (*Store) GetUserBySession

func (s *Store) GetUserBySession(ctx context.Context, tokenHash string) (model.User, error)

func (*Store) Heartbeat

func (s *Store) Heartbeat(ctx context.Context, agentID string) error

func (*Store) ListASNSources

func (s *Store) ListASNSources(ctx context.Context, enabledOnly bool) ([]model.ASNSource, error)

func (*Store) ListActivePrefixes

func (s *Store) ListActivePrefixes(ctx context.Context, includeIPv6 bool) ([]model.Prefix, error)

func (*Store) ListAgentEnrollments

func (s *Store) ListAgentEnrollments(ctx context.Context) ([]model.AgentEnrollment, error)

func (*Store) ListAgents

func (s *Store) ListAgents(ctx context.Context) ([]model.Agent, error)

func (*Store) ListAutomationRuns

func (s *Store) ListAutomationRuns(ctx context.Context, limit int) ([]model.AutomationRun, error)

func (*Store) ListBlacklist

func (s *Store) ListBlacklist(ctx context.Context, limit int) ([]model.BlacklistEntry, error)

func (*Store) ListColoLocations

func (s *Store) ListColoLocations(ctx context.Context) ([]model.ColoLocation, error)

func (*Store) ListResultColoFacets

func (s *Store) ListResultColoFacets(ctx context.Context, filter model.ResultFilter) ([]model.ResultColoFacet, error)

func (*Store) ListResultJobFacets

func (s *Store) ListResultJobFacets(ctx context.Context, filter model.ResultFilter) ([]model.ResultJobFacet, error)

func (*Store) ListResults

func (s *Store) ListResults(ctx context.Context, filter model.ResultFilter) (model.ResultPage, error)

func (*Store) ListScanJobs

func (s *Store) ListScanJobs(ctx context.Context, limit int) ([]model.ScanJob, error)

func (*Store) ListScanSchedules

func (s *Store) ListScanSchedules(ctx context.Context) ([]model.ScanSchedule, error)

func (*Store) ListSourceSyncSchedules

func (s *Store) ListSourceSyncSchedules(ctx context.Context) ([]model.SourceSyncSchedule, error)

func (*Store) ListUsers

func (s *Store) ListUsers(ctx context.Context) ([]model.User, error)

func (*Store) Migrate

func (s *Store) Migrate(ctx context.Context) error

func (*Store) Overview

func (s *Store) Overview(ctx context.Context) (model.Overview, error)

func (*Store) RecordASNError

func (s *Store) RecordASNError(ctx context.Context, asn int64, syncErr error) error

func (*Store) RecordBlacklistRecheckRun

func (s *Store) RecordBlacklistRecheckRun(ctx context.Context, nextRun *time.Time, runErr error) error

func (*Store) RecordScanScheduleRun

func (s *Store) RecordScanScheduleRun(ctx context.Context, id string, nextRun *time.Time, jobID *string, runErr error) error

func (*Store) RecordSourceError

func (s *Store) RecordSourceError(ctx context.Context, source string, syncErr error) error

func (*Store) RecordSourceSyncRun

func (s *Store) RecordSourceSyncRun(ctx context.Context, source string, nextRun *time.Time, runErr error) error

func (*Store) RejectAgentEnrollment

func (s *Store) RejectAgentEnrollment(ctx context.Context, tokenHash string) (model.AgentEnrollment, error)

func (*Store) RejectAgentEnrollmentByID

func (s *Store) RejectAgentEnrollmentByID(ctx context.Context, enrollmentID string) (model.AgentEnrollment, error)

func (*Store) ReplaceASNPrefixes

func (s *Store) ReplaceASNPrefixes(ctx context.Context, asn int64, prefixes []model.Prefix) (model.ASNSource, error)

func (*Store) ReplaceCloudflarePrefixes

func (s *Store) ReplaceCloudflarePrefixes(ctx context.Context, prefixes []model.Prefix) (model.SourceStatus, error)

func (*Store) ReplaceColoLocations

func (s *Store) ReplaceColoLocations(ctx context.Context, locations []model.ColoLocation) (model.ColoSyncSummary, error)

func (*Store) ResetUserPassword

func (s *Store) ResetUserPassword(ctx context.Context, userID, passwordHash string) error

func (*Store) SourceStatus

func (s *Store) SourceStatus(ctx context.Context, source string) (model.SourceStatus, error)

func (*Store) StartAutomationRun

func (s *Store) StartAutomationRun(ctx context.Context, input model.StartAutomationRunRequest) (model.AutomationRun, error)

func (*Store) StopScanJob

func (s *Store) StopScanJob(ctx context.Context, id string) (model.ScanJob, error)

func (*Store) SubmitResults

func (s *Store) SubmitResults(ctx context.Context, batch model.ResultBatch) error

func (*Store) UpdateASNSource

func (s *Store) UpdateASNSource(ctx context.Context, asn int64, input model.UpdateASNSourceRequest) (model.ASNSource, error)

func (*Store) UpdateBlacklistRecheckSettings

func (s *Store) UpdateBlacklistRecheckSettings(ctx context.Context, input model.UpdateBlacklistRecheckSettingsRequest, nextRun time.Time) (model.BlacklistRecheckSettings, error)

func (*Store) UpdateScanSchedule

func (s *Store) UpdateScanSchedule(ctx context.Context, id string, input model.UpsertScanScheduleRequest, nextRun time.Time) (model.ScanSchedule, error)

func (*Store) UpdateSourceSyncSchedule

func (s *Store) UpdateSourceSyncSchedule(ctx context.Context, source string, input model.UpdateSourceSyncScheduleRequest, nextRun time.Time) (model.SourceSyncSchedule, error)

func (*Store) UpdateUser

func (s *Store) UpdateUser(ctx context.Context, userID string, input model.UpdateUserRequest) (model.User, error)

Jump to

Keyboard shortcuts

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