storagekey

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package storagekey is the single source of truth for the S3 object-key layout of an uploaded document. Both the API service (at upload time) and the document-events worker (when materializing connector-synced documents) must produce byte-identical keys for the same document, because the reclassify KB re-stamp, the download presign, and the S3 delete all address the object by this key — a divergence silently breaks those operations for every affected document.

The two producers live in different apps and app→app imports are forbidden, so the format lives here in the foundation tier where both may depend on it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(
	orgExternalID string,
	workspaceID, documentID uuid.UUID,
	filename string,
) string

Build returns the per-org S3 object key for a document: "{orgExternalID}/{workspaceID}/{documentID}/{filename}". The org-prefixed layout lets each tenant's Bedrock Knowledge Base scan only its own "{org}/" slice Callers pass the filename verbatim (it is the display title, not sanitized here).

func OrgFrom

func OrgFrom(key string) string

OrgFrom returns the org (leading) segment of an org-prefixed storage key. The chunk-child key builder uses it to inherit the parent's org: the parent is org-prefixed, so its first segment is the org and the child lands under the same "{org}/" slice the per-org KB scans.

Types

This section is empty.

Jump to

Keyboard shortcuts

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