Versions in this module Expand all Collapse all v0 v0.1.0 Nov 10, 2026 Changes in this version + const OutboxChannel + var ErrCapacity = errors.New("resources_capacity_exceeded") + var ErrConflict = errors.New("resources_conflict") + var ErrDenied = errors.New("resources_permission_denied") + var ErrInput = errors.New("resources_invalid_input") + var ErrNotFound = errors.New("resources_not_found") + var ErrRateLimited = errors.New("rate_limited") + var ErrUnauthenticated = errors.New("resources_authentication_required") + var ErrUnavailable = errors.New("resources_unavailable") + func ValidateAttributes(c Category, values map[string]Value, filter bool) error + func ValidateCategory(c CategoryWrite) error + type AccessFailure struct + Missing []string + Reason string + RuleVersion string + Unavailable []string + func (e *AccessFailure) Error() string + func (e *AccessFailure) Unwrap() error + type Associations struct + CourseID string + OfferingID string + SchoolID string + TeacherID string + TermID string + type Authority interface + Check func(context.Context, Principal, string, string) error + type Capabilities struct + AllowedTypes []string + MaxFileSize int64 + MaxPackageBytes int64 + MaxPackageFiles int + PurchaseAvailable bool + Terms Terms + UploadProfiles []UploadProfile + type Catalog interface + Validate func(context.Context, Associations) error + type Category struct + Enabled bool + Fields []Field + GroupBy string + ID string + Names Names + Order int + Revision int64 + type CategoryPage struct + Items []Category + NextCursor string + type CategoryWrite struct + Enabled bool + Fields []Field + GroupBy string + Names Names + Order int + Revision int64 + type Command struct + Revision int64 + type Config struct + AllowedTypes []string + Clock func() time.Time + Lease time.Duration + MaxAttempts int + MaxDirectoryDepth int + MaxFileSize int64 + MaxJobs int + MaxOperations int + MaxPackageBytes int64 + MaxPackageFiles int + MaxPackageParts int + MaxRecords int + OperationTimeout time.Duration + PackageTTL time.Duration + Terms Terms + UploadProfiles []UploadProfile + type Consent struct + Accepted bool + Digest string + Version string + type Coverage struct + PlanID string + Revision int64 + Rules []CoverageRule + type CoverageRule struct + CategoryID string + DirectoryID string + SchoolID string + type Decision struct + Action string + ID string + Reason string + Revision int64 + VersionID string + type Dependencies struct + Authority Authority + Catalog Catalog + Files Files + Moderation Moderation + type Directory struct + CourseID string + Enabled bool + ID string + Names Names + ParentID string + Revision int64 + SchoolID string + type DirectoryPage struct + Items []Directory + NextCursor string + type DirectoryWrite struct + CourseID string + Enabled bool + Names Names + ParentID string + Revision int64 + SchoolID string + type DiscoveryDocument struct + At time.Time + CourseID string + Revision int64 + SchoolID string + Target DiscoveryTarget + TeacherIDs []string + Title string + Visible bool + type DiscoveryPage struct + Items []DiscoveryDocument + Next string + type DiscoverySource interface + DiscoverySnapshot func(context.Context, string, int) (DiscoveryPage, error) + type DiscoveryTarget struct + ID string + Kind string + Source string + type DraftWrite struct + Metadata Metadata + Revision int64 + type Entitlement struct + Member bool + Purchased bool + type Envelope struct + Data json.RawMessage + DataContentType string + ID string + Source string + SpecVersion string + Subject string + Time time.Time + Type string + type Event struct + Actor string + ID string + Reason string + ResourceID string + Revision int64 + SchoolID string + Time time.Time + Type string + type Field struct + Filterable bool + Groupable bool + Key string + Kind string + Max *int64 + MaxLength int + Min *int64 + Names Names + Options []Option + Required bool + type File struct + ContentType string + Filename string + SHA256 string + Size int64 + VersionID string + type FileEvidence struct + Access string + File File + Module string + Owner Principal + SchoolID string + State string + type FileLink struct + MediaVersionID string + Revision int64 + type Files interface + Archive func(context.Context, Principal, []Selection, io.Writer) error + Download func(context.Context, Principal, string, io.Writer) error + Inspect func(context.Context, Principal, string) (FileEvidence, error) + Publish func(context.Context, Publication) (reference string, ready bool, err error) + Release func(context.Context, string, string) error + ReviewDownload func(context.Context, Principal, string, string, io.Writer) error + type Filter struct + After string + Attributes map[string]Value + CategoryID string + CourseID string + DirectoryID string + IncludeUnpublished bool + Limit int + OwnerKey string + Query string + SchoolID string + type Grant struct + ExpiresAt *time.Time + ID string + Revision int64 + Revoked bool + SubjectKey string + type GrantPage struct + Items []Grant + NextCursor string + type GrantRecord struct + Grant Grant + ResourceID string + SubjectKey string + type GrantWrite struct + ExpiresAt *time.Time + Revision int64 + Revoked bool + SubjectKey string + type Inspection struct + Description string + Owner string + ResourceID string + Revision int64 + SchoolID string + State string + Title string + VersionID string + Visible bool + type Job struct + Attempts int + AvailableAt time.Time + ErrorCode string + Generation int64 + ID string + Kind string + LeaseUntil time.Time + Owner string + ReferenceID string + RequestID string + ResourceID string + State string + VersionID string + type Membership struct + Owner Principal + PlanID string + Revision int64 + ValidFrom time.Time + ValidUntil time.Time + type Metadata struct + Access string + Associations Associations + Attributes map[string]Value + CategoryID string + CategoryRevision int64 + Description string + DirectoryID string + Origin Origin + Tags []string + Title string + type Moderation interface + Request func(context.Context, string, string, Principal, Request) (string, error) + Status func(context.Context, Principal, string) (RequestStatus, error) + Submit func(context.Context, string, ReviewSubmission) (string, error) + type NameCatalog interface + ReferenceNames func(context.Context, []string) (References, error) + type Names map[string]string + type Option struct + ID string + Names Names + type Origin struct + Author string + Consent *Consent + Kind string + License string + Source string + type OutboxReader interface + ConfirmOutbox func(context.Context, string) error + PendingOutbox func(context.Context, int, []string) ([]Envelope, error) + type Package struct + ExpiresAt time.Time + ID string + Parts []PackagePart + type PackagePart struct + Bytes int64 + Files []File + Number int + type PackageRecord struct + Owner Principal + Package Package + Selections [][]Selection + type PackageRequest struct + DirectoryID string + ResourceIDs []string + type Page struct + Items []Resource + NextCursor string + type Principal struct + Issuer string + Subject string + func (p Principal) Key() string + func (p Principal) Valid() bool + type Publication struct + Access string + MediaVersionID string + OperationID string + Owner Principal + ResourceID string + VersionID string + type PurchaseSource struct + OrderID string + Owner Principal + ResourceID string + Revision int64 + Revoked bool + type Record struct + ActiveID string + CreatedAt time.Time + ID string + NextVersion int64 + Owner Principal + ProposalID string + Revision int64 + SchoolID string + State string + type Reference struct + CanonicalID string + ID string + Kind string + Name string + type References struct + Items []Reference + MissingIDs []string + type Replay struct + Digest string + Key string + Result json.RawMessage + type Repository interface + Claim func(context.Context, string, time.Time, time.Duration) (Job, error) + Transaction func(context.Context, func(Transaction) error) error + type Request struct + Contact string + Evidence []string + Kind string + PreviousTaskID string + Reason string + type RequestPage struct + Items []RequestReceipt + NextCursor string + type RequestReceipt struct + CanAppeal bool + CreatedAt time.Time + DecisionReason string + ID string + Kind string + ResourceID string + ResourceTitle string + State string + TaskID string + type RequestRecord struct + ExternalID string + Receipt RequestReceipt + Reporter Principal + Request Request + ResourceID string + VersionID string + type RequestStatus struct + CanAppeal bool + Reason string + State string + type Resource struct + AccessReason string + AvailableMethods []string + Current *Version + DownloadAllowed bool + ID string + MissingConditions []string + Owned bool + Proposal *Version + Revision int64 + RuleVersion string + State string + UnavailableConditions []string + UnlockReason string + type ReviewSubmission struct + Description string + ResourceID string + Revision int64 + SchoolID string + Title string + VersionID string + type Selection struct + File File + ReferenceID string + ResourceID string + VersionID string + type Service struct + func New(repo Repository, deps Dependencies, cfg Config) (*Service, error) + func (s *Service) AnonymizeOwner(ctx context.Context, p Principal, id string) error + func (s *Service) ApplyContentDecision(ctx context.Context, p Principal, in Decision) (Resource, error) + func (s *Service) ApplyDecision(ctx context.Context, p Principal, id, key string, in Decision) (Resource, error) + func (s *Service) AttachFile(ctx context.Context, p Principal, id, key string, in FileLink) (Resource, error) + func (s *Service) AuthorizeFile(ctx context.Context, p Principal, versionID, mediaVersionID, action string) error + func (s *Service) Capabilities() Capabilities + func (s *Service) Categories(ctx context.Context, limit int, after string, includeDisabled bool) (CategoryPage, error) + func (s *Service) Consume(ctx context.Context, event Envelope) error + func (s *Service) CreateDraft(ctx context.Context, p Principal, key string, in DraftWrite) (Resource, error) + func (s *Service) CreatePackage(ctx context.Context, p Principal, key string, in PackageRequest) (Package, error) + func (s *Service) CreateRequest(ctx context.Context, p Principal, id, key string, in Request) (RequestReceipt, error) + func (s *Service) Directories(ctx context.Context, p Principal, school, course, parent string, n int, ...) (DirectoryPage, error) + func (s *Service) DiscoveryCurrent(ctx context.Context, p Principal, ids []string) ([]DiscoveryDocument, error) + func (s *Service) Download(ctx context.Context, p Principal, id string, w io.Writer) (File, error) + func (s *Service) DownloadPackage(ctx context.Context, p Principal, id string, part int, w io.Writer) error + func (s *Service) DownloadReviewFile(ctx context.Context, p Principal, versionID string, w io.Writer) error + func (s *Service) Get(ctx context.Context, p Principal, id string) (Resource, error) + func (s *Service) GetCoverage(ctx context.Context, p Principal, id string) (Coverage, error) + func (s *Service) GetPackage(ctx context.Context, p Principal, id string) (PackageRecord, error) + func (s *Service) Grants(ctx context.Context, p Principal, id string, n int, after string) (GrantPage, error) + func (s *Service) InspectComplaint(ctx context.Context, p Principal, versionID string) (Inspection, error) + func (s *Service) InspectReview(ctx context.Context, p Principal, versionID string) (Inspection, error) + func (s *Service) List(ctx context.Context, p Principal, f Filter, mine, admin bool) (Page, error) + func (s *Service) MyReferences(ctx context.Context, p Principal, ids []string) (References, error) + func (s *Service) ProcessOne(ctx context.Context, worker string) (bool, error) + func (s *Service) PutCategory(ctx context.Context, p Principal, id, key string, input CategoryWrite) (Category, error) + func (s *Service) PutCoverage(ctx context.Context, p Principal, id, key string, in Coverage) (Coverage, error) + func (s *Service) PutDirectory(ctx context.Context, p Principal, id, key string, in DirectoryWrite) (Directory, error) + func (s *Service) PutGrant(ctx context.Context, p Principal, id, grantID, key string, in GrantWrite) (Grant, error) + func (s *Service) ReadCategories(ctx context.Context, p Principal, limit int, after string, disabled bool) (CategoryPage, error) + func (s *Service) RequestStatus(ctx context.Context, p Principal, id string) (RequestReceipt, error) + func (s *Service) Requests(ctx context.Context, p Principal, n int, after string) (RequestPage, error) + func (s *Service) RetryPending(ctx context.Context, p Principal, id, key string, in Command) (Resource, error) + func (s *Service) RetryRequest(ctx context.Context, p Principal, id, key string) (RequestReceipt, error) + func (s *Service) ReviewResource(ctx context.Context, p Principal, versionID string) (Resource, error) + func (s *Service) SetState(ctx context.Context, p Principal, id, key string, in StateChange) (Resource, error) + func (s *Service) Submit(ctx context.Context, p Principal, id, key string, in Command) (Resource, error) + func (s *Service) UnlockEligibility(ctx context.Context, p Principal, id string) (UnlockDecision, error) + func (s *Service) UpdateDraft(ctx context.Context, p Principal, id, key string, in DraftWrite) (Resource, error) + type StateChange struct + Reason string + Revision int64 + State string + type Terms struct + Digest string + URL string + Version string + type Transaction interface + Categories func(int, string, bool) ([]Category, error) + Category func(string, int64) (Category, error) + CloseOwner func(Principal, string) error + Counts func() (records, operations, jobs int, err error) + Coverage func(string) (Coverage, error) + Directories func(string, string, string, int, string) ([]Directory, error) + Directory func(string) (Directory, error) + DiscoveryCurrent func([]string) ([]DiscoveryDocument, error) + Envelope func(Envelope) error + Event func(Event) error + Grant func(string, string) (GrantRecord, error) + GrantByID func(string) (GrantRecord, error) + Grants func(string, int, string) ([]GrantRecord, error) + Inbox func(string) (bool, error) + Job func(string) (Job, error) + List func(Filter) ([]Record, error) + Lock func(string) error + Membership func(string, string) (Membership, error) + OwnedReferences func(Principal, []string) ([]string, error) + Package func(string) (PackageRecord, error) + Purchase func(string) (PurchaseSource, error) + Record func(string) (Record, error) + Replay func(string) (Replay, error) + Request func(string) (RequestRecord, error) + Requests func(Principal, int, string) ([]RequestRecord, error) + Rights func(string, string, string, string, string, time.Time) (Entitlement, error) + SaveCategory func(Category) error + SaveCoverage func(Coverage) error + SaveDirectory func(Directory) error + SaveGrant func(GrantRecord) error + SaveInbox func(string) error + SaveJob func(Job) error + SaveMembership func(Membership) error + SavePackage func(PackageRecord) error + SavePurchase func(PurchaseSource) error + SaveRecord func(Record) error + SaveReplay func(Replay) error + SaveRequest func(RequestRecord) error + SaveVersion func(VersionRecord) error + Version func(string) (VersionRecord, error) + type UnlockDecision struct + Eligible bool + Reason string + type UploadProfile struct + Access string + Purpose string + SchoolID string + type Value struct + Number *int64 + Option *string + Text *string + type Version struct + Category Category + CreatedAt time.Time + File *File + ID string + Metadata Metadata + Number int64 + State string + type VersionRecord struct + DecisionID string + DecisionRevision int64 + FileOwner Principal + ModerationTaskID string + ReferenceID string + ResourceID string + Version Version