You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
707 B
39 lines
707 B
package donut
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
type objectWriter struct {
|
|
metadata map[string]string
|
|
}
|
|
|
|
func (obj objectWriter) Write(data []byte) (length int, err error) {
|
|
return 11, nil
|
|
}
|
|
|
|
func (obj objectWriter) Close() error {
|
|
return nil
|
|
}
|
|
|
|
func (obj objectWriter) CloseWithError(err error) error {
|
|
return errors.New("Not Implemented")
|
|
}
|
|
|
|
func (obj objectWriter) SetMetadata(metadata map[string]string) error {
|
|
for k := range obj.metadata {
|
|
delete(obj.metadata, k)
|
|
}
|
|
for k, v := range metadata {
|
|
obj.metadata[k] = v
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (obj objectWriter) GetMetadata() (map[string]string, error) {
|
|
ret := make(map[string]string)
|
|
for k, v := range obj.metadata {
|
|
ret[k] = v
|
|
}
|
|
return ret, nil
|
|
}
|
|
|