features: add new interfaces OpenChunkWriter and ChunkWriter #7056

This commit is contained in:
Vitor Gomes
2023-07-13 21:01:10 +02:00
committed by Nick Craig-Wood
parent 9b3b1c7067
commit f36ca0cd25
9 changed files with 106 additions and 9 deletions

View File

@ -276,6 +276,22 @@ func (o MetadataOption) Mandatory() bool {
return false
}
type ChunkOption struct {
ChunkSize int64
}
func (o *ChunkOption) Header() (key string, value string) {
return "chunkSize", fmt.Sprintf("%v", o.ChunkSize)
}
func (o *ChunkOption) Mandatory() bool {
return false
}
func (o *ChunkOption) String() string {
return fmt.Sprintf("ChunkOption(%v)", o.ChunkSize)
}
// 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) {