notifyattach

package
v1.147.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

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

View Source
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.

View Source
var ErrUnavailable = errors.New("notifyattach: attachment is unavailable")

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 Assets

type Assets interface {
	Get(ctx context.Context, id string) (*portaldomain.Asset, error)
}

Assets is the portal read an asset attachment needs.

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

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 Resources

type Resources interface {
	Get(ctx context.Context, id string) (*resource.Resource, error)
}

Resources is the managed-resource read a resource attachment needs.

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.

Jump to

Keyboard shortcuts

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