Add WithContentID function to file.go

The newly added function, WithContentID, allows for setting the Content-ID header for the File. This provides enhanced handling and differentiation of files.
This commit is contained in:
Winni Neessen 2024-06-28 11:54:06 +02:00
parent 8b1208949f
commit b709df4b2d
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -22,6 +22,13 @@ type File struct {
Writer func(w io.Writer) (int64, error) Writer func(w io.Writer) (int64, error)
} }
// WithContentID sets the Content-ID header for the File
func WithContentID(id string) FileOption {
return func(f *File) {
f.Header.Set(HeaderContentID.String(), id)
}
}
// WithFileName sets the filename of the File // WithFileName sets the filename of the File
func WithFileName(name string) FileOption { func WithFileName(name string) FileOption {
return func(f *File) { return func(f *File) {