Documentation
¶
Overview ¶
Package notifyattach reads the files a channel document carries, at delivery.
A queued document names its attachments -- a portal asset at a version, an asset's preview tile, or a managed resource -- and never holds their bytes, so the queue row stays small. The send worker reads each one here when it delivers. The sender's entitlement to each file was checked when the document was queued (internal/platform/notifylayer); nothing here asks again, because the worker acts for nobody.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTooLarge = errors.New("notifyattach: attachment is over the size a channel carries")
ErrTooLarge is returned for an attachment over notification.MaxAttachmentBytes. The worker sends its link instead.
ErrUnavailable is returned for an attachment this deployment cannot read: no store for its kind, or the file is gone.
Functions ¶
This section is empty.
Types ¶
type Loader ¶
type Loader struct {
Assets Assets
Versions Versions
AssetObjects Objects
Resources Resources
ResourceObjs Objects
ResourceBucket string
}
Loader reads attachments. Any field may be nil; an attachment of a kind whose stores are absent is ErrUnavailable.
func (*Loader) Load ¶
func (l *Loader) Load(ctx context.Context, att notification.Attachment) (notification.File, error)
Load reads one attachment's content.
type Objects ¶
type Objects interface {
GetObject(ctx context.Context, bucket, key string) ([]byte, string, error)
}
Objects reads a stored object.
type Versions ¶
type Versions interface {
GetByVersion(ctx context.Context, assetID string, version int) (*portaldomain.AssetVersion, error)
}
Versions reads the version an attachment was pinned to.