Documentation
¶
Overview ¶
Package exportlink mints one-time download links for the full raw event export (GET /export/<token>) — "give me my data" from the editor without dumping millions of rows through a conversation. Same token discipline as internal/share: 128-bit random tokens stored ONLY as sha256 hashes (a leaked sidecar file can't mint access). Stricter lifecycle than a share link, because this is the whole dataset: every link expires after an hour and burns on its first download.
Index ¶
Constants ¶
const TTL = time.Hour
TTL is how long an unused link stays downloadable.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Link ¶
type Link struct {
ID string `json:"id"`
Format string `json:"format"` // csv | jsonl
Hash string `json:"hash"` // sha256(token), hex
Created time.Time `json:"created"`
Expires time.Time `json:"expires"`
}
Link is one pending export grant (the raw token is returned once at creation, never stored).
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Create ¶
Create mints a one-time link for a format ("" defaults to jsonl) and returns it with the RAW token — shown once, never stored.
func (*Store) Redeem ¶
Redeem burns the link for a presented token and returns its format. ok is false for unknown, expired, and already-used tokens alike — callers must not give a prober a way to tell those apart. The burn happens before the download starts, so a link is single-use even if the transfer then fails.