refactor: change PutFileSmall return value

This commit is contained in:
Derrick Hammer 2024-02-09 15:28:28 -05:00
parent c790c525ae
commit fc9724df2c
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 2 deletions

View File

@ -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) {