1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

fs: add --metadata-set flag to specify metadata for uploads

This commit is contained in:
Nick Craig-Wood
2022-05-24 15:46:07 +01:00
parent 0652ec95db
commit c4451bc43a
8 changed files with 173 additions and 1 deletions

View File

@@ -258,6 +258,24 @@ func (o NullOption) Mandatory() bool {
return false
}
// MetadataOption defines an Option which does nothing
type MetadataOption Metadata
// Header formats the option as an http header
func (o MetadataOption) Header() (key string, value string) {
return "", ""
}
// String formats the option into human-readable form
func (o MetadataOption) String() string {
return fmt.Sprintf("MetadataOption(%v)", Metadata(o))
}
// Mandatory returns whether the option must be parsed or can be ignored
func (o MetadataOption) Mandatory() bool {
return false
}
// OpenOptionAddHeaders adds each header found in options to the
// headers map provided the key was non empty.
func OpenOptionAddHeaders(options []OpenOption, headers map[string]string) {