Documentation
¶
Index ¶
- func WriteArchive(w io.Writer, data ExportData, files map[string][]byte) error
- type AnswerSummary
- type ApplicationService
- type ApplicationSummary
- type AuditSummary
- type BlobStore
- type DocumentService
- type DocumentSummary
- type EventSummary
- type ExportData
- type IdentityService
- type ItemService
- type KeyManager
- type MatchSummary
- type MatchingService
- type PasskeySummary
- type PortalSummary
- type ProfileService
- type Service
- type SessionSummary
- type SettingsSummary
- type TextSummary
- type UserSummary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteArchive ¶
WriteArchive builds a standard ZIP archive containing formatted JSON files and decrypted documents.
Types ¶
type AnswerSummary ¶
AnswerSummary is one entry in the answer bank.
type ApplicationService ¶
type ApplicationService interface {
UserApplications(ctx context.Context, userID uuid.UUID) ([]application.ApplicationSummary, error)
UserScreenshots(ctx context.Context, userID uuid.UUID) ([]string, error)
Settings(ctx context.Context, userID uuid.UUID) (application.Settings, error)
PurgeExpiredScreenshots(ctx context.Context, blobs application.ScreenshotDeleter) (int, error)
}
ApplicationService supplies application history and screenshot keys.
type ApplicationSummary ¶
type ApplicationSummary struct {
ID uuid.UUID `json:"id"`
JobID int64 `json:"job_id"`
State string `json:"state"`
Company string `json:"company"`
Title string `json:"title"`
Location string `json:"location"`
URL string `json:"url,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Events []EventSummary `json:"events,omitempty"`
}
ApplicationSummary holds application history.
type AuditSummary ¶
type AuditSummary struct {
Actor string `json:"actor"`
Code string `json:"code"`
Params map[string]any `json:"params,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
AuditSummary holds audit log entries for the user.
type DocumentService ¶
type DocumentService interface {
List(ctx context.Context, userID uuid.UUID) ([]profile.Document, error)
Read(ctx context.Context, userID, id uuid.UUID) (profile.Document, []byte, error)
}
DocumentService manages the user's uploaded files.
type DocumentSummary ¶
type DocumentSummary struct {
ID uuid.UUID `json:"id"`
Kind string `json:"kind"`
Name string `json:"name"`
Mime string `json:"mime"`
Size int `json:"size"`
CreatedAt time.Time `json:"created_at"`
}
DocumentSummary holds document metadata.
type EventSummary ¶
type EventSummary struct {
Event string `json:"event"`
From string `json:"from"`
To string `json:"to"`
Actor string `json:"actor"`
At time.Time `json:"at"`
Data map[string]any `json:"data,omitempty"`
}
EventSummary is one timeline event of an application.
type ExportData ¶
type ExportData struct {
ExportedAt time.Time `json:"exported_at"`
User UserSummary `json:"user"`
Passkeys []PasskeySummary `json:"passkeys,omitempty"`
Sessions []SessionSummary `json:"sessions,omitempty"`
Profile any `json:"profile,omitempty"`
Preferences any `json:"preferences,omitempty"`
Answers []AnswerSummary `json:"answers,omitempty"`
Texts []TextSummary `json:"texts,omitempty"`
Documents []DocumentSummary `json:"documents,omitempty"`
Matches []MatchSummary `json:"matches,omitempty"`
Applications []ApplicationSummary `json:"applications,omitempty"`
Settings SettingsSummary `json:"settings,omitempty"`
AuditEvents []AuditSummary `json:"audit_events,omitempty"`
}
ExportData is the complete portable data dump of a user.
type IdentityService ¶
type IdentityService interface {
UserByID(ctx context.Context, id uuid.UUID) (identity.User, error)
Passkeys(ctx context.Context, userID uuid.UUID) ([]identity.PasskeyInfo, error)
Sessions(ctx context.Context, userID uuid.UUID, currentToken string) ([]identity.SessionInfo, error)
AuditEvents(ctx context.Context, userID uuid.UUID) ([]identity.AuditEvent, error)
DeleteUser(ctx context.Context, userID uuid.UUID) error
Cleanup(ctx context.Context) error
}
IdentityService supplies identity data and handles user lifecycle.
type ItemService ¶
type ItemService interface {
Answers(ctx context.Context, userID uuid.UUID) ([]profile.Answer, error)
TextBlocks(ctx context.Context, userID uuid.UUID) ([]profile.TextBlock, error)
}
ItemService supplies answer bank and text blocks.
type KeyManager ¶
KeyManager handles cryptographic shredding of per-user keys.
type MatchSummary ¶
type MatchSummary struct {
JobID int64 `json:"job_id"`
Title string `json:"title"`
Company string `json:"company"`
Location string `json:"location"`
Workplace string `json:"workplace"`
Score int `json:"score"`
Decision string `json:"decision"`
Reasons any `json:"reasons,omitempty"`
ComputedAt time.Time `json:"computed_at"`
}
MatchSummary holds matched job postings.
type MatchingService ¶
type MatchingService interface {
UserMatches(ctx context.Context, userID uuid.UUID) ([]matching.MatchSummary, error)
}
MatchingService supplies matched postings.
type PasskeySummary ¶
type PasskeySummary struct {
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
LastUsedAt time.Time `json:"last_used_at,omitempty"`
}
PasskeySummary holds passkey metadata without secret credentials.
type PortalSummary ¶
type PortalSummary struct {
Portal string `json:"portal"`
Status string `json:"status"`
LastUsedAt time.Time `json:"last_used_at,omitempty"`
}
PortalSummary holds portal session metadata.
type ProfileService ¶
type ProfileService interface {
Get(ctx context.Context, userID uuid.UUID) (profile.Snapshot, error)
}
ProfileService supplies the personal applicant profile.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service coordinates data export, account erasure with cryptographic shredding, and retention cleanup.
func NewService ¶
func NewService( identity IdentityService, profile ProfileService, items ItemService, docs DocumentService, apps ApplicationService, matching MatchingService, keys KeyManager, blobs BlobStore, ) *Service
NewService returns a new privacy service.
func (*Service) Cleanup ¶
Cleanup performs periodic data retention tasks: expired auth tokens/challenges, unaccepted invitations, and run screenshots past 90 days retention.
func (*Service) DeleteAccount ¶
DeleteAccount permanently deletes the user's data from PostgreSQL, deletes all documents and screenshots from the blob store, and cryptographically shreds the per-user data key.
type SessionSummary ¶
type SessionSummary struct {
Method string `json:"method"`
CreatedAt time.Time `json:"created_at"`
LastSeenAt time.Time `json:"last_seen_at"`
}
SessionSummary holds session metadata.
type SettingsSummary ¶
type SettingsSummary struct {
AutonomyLevel string `json:"autonomy_level,omitempty"`
DailyLimit int `json:"daily_limit,omitempty"`
RunnerChoice string `json:"runner_choice,omitempty"`
EasyApplyEnabled bool `json:"easy_apply_enabled,omitempty"`
Portals []PortalSummary `json:"portals,omitempty"`
}
SettingsSummary holds user configuration.
type TextSummary ¶
type TextSummary struct {
Name string `json:"name"`
Language string `json:"language,omitempty"`
Body string `json:"body"`
}
TextSummary is one reusable text block.