Versions in this module Expand all Collapse all v0 v0.117.1 Sep 11, 2026 v0.117.0 Sep 9, 2026 Changes in this version + const SourceSignup + var ErrConsentExists = errors.New("a consent record already exists for this user") + var ErrInvalidGrant = errors.New("invalid consent grant") + var ErrMissingDocuments = errors.New("missing consent document ids") + var ErrUnknownDocuments = errors.New("unknown consent document ids") + type AuditRecordRepository interface + Create func(ctx context.Context, auditRecord models.AuditRecord) (models.AuditRecord, error) + type Config struct + Documents map[string]DocumentConfig + Enabled bool + func (c Config) Validate() error + type Consent struct + AuthStrategy string + ConsentedAt time.Time + CreatedAt time.Time + Documents []Document + ID string + IPAddress string + Source string + UserEmail string + UserID string + type Document struct + ID string + Title string + URL string + Version string + type DocumentConfig struct + Title string + URL string + Version string + type GrantRequest struct + AuthStrategy string + ConsentedAt time.Time + Documents []Document + IPAddress string + Source string + UserEmail string + UserID string + type Service struct + func NewService(logger *slog.Logger, config Config, ...) *Service + func (s Service) Documents() []Document + func (s Service) Enabled() bool + func (s Service) PrepareGrant(req GrantRequest) (Consent, error) + func (s Service) RecordGranted(ctx context.Context, granted Consent) + func (s Service) Resolve(ids []string) ([]Document, error) + func (s Service) ResolveAll(ids []string) ([]Document, error)