fs: add MetadataAsOpenOptions
This commit is contained in:
parent
41b1250eaf
commit
24b4148b5e
1 changed files with 10 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
||||||
package fs
|
package fs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -276,6 +277,15 @@ func (o MetadataOption) Mandatory() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MetadataAsOpenOptions fetch any metadata to set as open options
|
||||||
|
func MetadataAsOpenOptions(ctx context.Context) (options []OpenOption) {
|
||||||
|
ci := GetConfig(ctx)
|
||||||
|
if ci.MetadataSet != nil {
|
||||||
|
options = append(options, MetadataOption(ci.MetadataSet))
|
||||||
|
}
|
||||||
|
return options
|
||||||
|
}
|
||||||
|
|
||||||
// ChunkOption defines an Option which returns a preferred chunk size
|
// ChunkOption defines an Option which returns a preferred chunk size
|
||||||
type ChunkOption struct {
|
type ChunkOption struct {
|
||||||
ChunkSize int64
|
ChunkSize int64
|
||||||
|
|
Loading…
Reference in a new issue