Documentation
¶
Overview ¶
Package watermark provides invisible metadata watermarking middleware for Trove. It embeds watermark text into downloaded content by injecting metadata chunks into supported file formats (PNG tEXt, JPEG COM, PDF info dictionary). No image processing libraries are required — only byte-level manipulation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Watermark)
Option configures the Watermark middleware.
func WithSkipTypes ¶
WithSkipTypes sets content type prefixes to skip watermarking.
func WithTextFunc ¶
WithTextFunc sets a dynamic watermark text function.
type Watermark ¶
type Watermark struct {
// contains filtered or unexported fields
}
Watermark provides invisible metadata watermarking middleware.
func (*Watermark) Direction ¶
func (w *Watermark) Direction() middleware.Direction
Direction returns Read since watermarking only applies to downloads.
func (*Watermark) WrapReader ¶
func (w *Watermark) WrapReader(ctx context.Context, r io.ReadCloser, info *driver.ObjectInfo) (io.ReadCloser, error)
WrapReader wraps a reader to inject watermark metadata into the content on download. Only matching content types are watermarked.