refactor: change PutFileSmall return value
This commit is contained in:
parent
c790c525ae
commit
fc9724df2c
|
@ -95,7 +95,7 @@ func NewStorageService(lc fx.Lifecycle, params StorageServiceParams) *StorageSer
|
||||||
return ss
|
return ss
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s StorageServiceDefault) PutFileSmall(file io.ReadSeeker, bucket string) ([]byte, error) {
|
func (s StorageServiceDefault) PutFileSmall(file io.ReadSeeker, bucket string) (*bao.Result, error) {
|
||||||
hash, err := s.GetHashSmall(file)
|
hash, err := s.GetHashSmall(file)
|
||||||
hashStr, err := encoding.NewMultihash(s.getPrefixedHash(hash.Hash)).ToBase64Url()
|
hashStr, err := encoding.NewMultihash(s.getPrefixedHash(hash.Hash)).ToBase64Url()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -124,7 +124,7 @@ func (s StorageServiceDefault) PutFileSmall(file io.ReadSeeker, bucket string) (
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return hash.Hash[:], nil
|
return hash, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StorageServiceDefault) BuildUploadBufferTus(basePath string, preUploadCb TusPreUploadCreateCallback, preFinishCb TusPreFinishResponseCallback) (*tusd.Handler, tusd.DataStore, *s3.Client, error) {
|
func (s *StorageServiceDefault) BuildUploadBufferTus(basePath string, preUploadCb TusPreUploadCreateCallback, preFinishCb TusPreFinishResponseCallback) (*tusd.Handler, tusd.DataStore, *s3.Client, error) {
|
||||||
|
|
Loading…
Reference in New Issue