Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PluginFlags ¶
PluginFlags returns CLI flags contributed by all registered attachment store plugins.
Types ¶
type AtomicAttachmentReplacer ¶ added in v0.0.6
type AtomicAttachmentReplacer interface {
// Replace writes data to an existing storage key and returns the new logical
// file metadata. Implementations must fail if storageKey does not already
// exist.
Replace(ctx context.Context, storageKey string, data io.Reader, contentType string) (*FileStoreResult, error)
}
AtomicAttachmentReplacer is an optional capability for stores that can replace the bytes for an existing storage key without changing the persisted key. Migration jobs use this to rewrite encrypted attachments while leaving attachment metadata stable.
type AttachmentStore ¶
type AttachmentStore interface {
// Store writes file data and returns storage key, size, and SHA256.
Store(ctx context.Context, data io.Reader, maxSize int64, contentType string) (*FileStoreResult, error)
// Retrieve returns a reader for the stored file.
Retrieve(ctx context.Context, storageKey string) (io.ReadCloser, error)
// Delete removes the stored file.
Delete(ctx context.Context, storageKey string) error
// GetSignedURL returns a time-limited signed download URL, if supported.
GetSignedURL(ctx context.Context, storageKey string, expiry time.Duration, opts *SignedURLOptions) (*url.URL, error)
}
AttachmentStore defines the interface for file storage backends.
type FileStoreResult ¶
FileStoreResult is the result of a file store operation.
type Loader ¶
type Loader func(ctx context.Context) (AttachmentStore, error)
Loader creates an AttachmentStore from config.
type Plugin ¶
type Plugin struct {
Name string
Loader Loader
Flags func(cfg *config.Config) []cli.Flag
Apply func(cfg *config.Config, cmd *cli.Command)
}
Plugin represents an attachment store plugin.
type SignedURLOptions ¶ added in v0.0.3
SignedURLOptions controls optional response overrides for signed download URLs.
Click to show internal directories.
Click to hide internal directories.