@ -147,15 +147,26 @@ func (handler *Driver) List(ctx context.Context, base string, recursive bool) ([
if err != nil {
if err != nil {
continue
continue
}
}
if strings . HasSuffix ( * object . Key , "/" ) {
res = append ( res , response . Object {
Name : path . Base ( * object . Key ) ,
RelativePath : filepath . ToSlash ( rel ) ,
Size : 0 ,
IsDir : true ,
LastModify : time . Now ( ) ,
} )
} else {
res = append ( res , response . Object {
res = append ( res , response . Object {
Name : path . Base ( * object . Key ) ,
Name : path . Base ( * object . Key ) ,
Source : * object . Key ,
Source : * object . Key ,
RelativePath : filepath . ToSlash ( rel ) ,
RelativePath : filepath . ToSlash ( rel ) ,
Size : uint64 ( * object . Size ) ,
Size : uint64 ( * object . Size ) ,
IsDir : false ,
IsDir : false ,
LastModify : time . Now ( ) ,
LastModify : * object . LastModified ,
} )
} )
}
}
}
return res , nil
return res , nil