Documentation
¶
Overview ¶
Package commmailbox contains shared bounded content-storage helpers for the host-authoritative soul comm mailbox.
Index ¶
Constants ¶
const ( // ContentKeyPrefix is the lifecycle-bound S3 prefix used by CDK. ContentKeyPrefix = "mailbox/v1/" // ContentStorageS3 marks mailbox content pointers backed by S3. ContentStorageS3 = "s3" )
Variables ¶
This section is empty.
Functions ¶
func ContentKey ¶
ContentKey returns the S3 object key for a mailbox delivery body.
func DefaultContentType ¶
DefaultContentType returns the content type used when a provider does not supply one.
Types ¶
type ContentInput ¶
type ContentInput struct {
DeliveryID string
InstanceSlug string
AgentID string
MessageID string
Direction string
ChannelType string
Body string
ContentMimeType string
}
ContentInput is the body payload stored for one canonical mailbox delivery.
type ContentOutput ¶
ContentOutput is explicit mailbox body content fetched from bounded storage.
type ContentPointer ¶
type ContentPointer struct {
Storage string
Bucket string
Key string
SHA256 string
Bytes int64
ContentType string
}
ContentPointer identifies a lifecycle-bound encrypted content object.
type ContentStore ¶
type ContentStore interface {
PutContent(ctx context.Context, input ContentInput) (ContentPointer, error)
GetContent(ctx context.Context, pointer ContentPointer, maxBytes int64) (ContentOutput, error)
}
ContentStore writes and reads bounded mailbox content.
type S3Store ¶
type S3Store struct {
// contains filtered or unexported fields
}
S3Store stores mailbox content in the dedicated CDK-managed mailbox bucket.
func NewS3Store ¶
NewS3Store constructs an S3-backed content store.
func NewS3StoreWithClient ¶
NewS3StoreWithClient constructs an S3-backed content store with an injected client.
func (*S3Store) GetContent ¶
func (s *S3Store) GetContent(ctx context.Context, pointer ContentPointer, maxBytes int64) (ContentOutput, error)
GetContent reads a bounded mailbox content object and verifies its digest when the mailbox row carries one.
func (*S3Store) PutContent ¶
func (s *S3Store) PutContent(ctx context.Context, input ContentInput) (ContentPointer, error)
PutContent writes content to the configured mailbox bucket and returns a pointer + digest. The bucket enforces encryption at rest and lifecycle expiry.