Documentation
¶
Overview ¶
Package editsession reads/deletes the shared, session-backed volume edit state that catalog-web writes to Redis (REDIS_DB=2 on catalog-api's own Redis instance - see docs/frontend-conventions.md's edit-session schema in sweetrpg/platform). catalog-api reads a session at finalize time and deletes it once finalize completes; the one exception to "catalog-api never creates a session" is pull-back (task 5.4), which recreates a pending proposal's diff as a fresh session so the submitter can resume editing it.
Index ¶
Constants ¶
const KeyPrefix = "edit-session"
KeyPrefix is the Redis key namespace for edit sessions: "edit-session:<userId>:<recordType>".
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Session ¶
type Session struct {
RecordID string `json:"recordId"`
Fields map[string]any `json:"fields"`
StagedCoverAssetId string `json:"stagedCoverAssetId,omitempty"`
SampleAssetIds []string `json:"sampleAssetIds,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Session mirrors the JSON schema catalog-web writes.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store reads/deletes edit sessions against a Redis pool already selecting REDIS_DB=2.
func NewStore ¶
NewStore wraps pool - the caller is responsible for the pool already dialing REDIS_DB=2.
func (*Store) Delete ¶
Delete removes a user's in-flight session for recordType. A missing session is not an error.