// Open from s3, and bring down whole file
Open from s3, and bring down whole file
// Open from s3 and bring down whole file
func (s S3Fs) Open(name string) (afero.File, error) {
	memFile, err := s.Create(getNameFromPath(name))
	if err != nil {
		return nil, err
	}
	res, err := s.client.GetObject(&s3.GetObjectInput{
		Bucket: aws.String(s.Bucket),
		Key:    aws.String(name),
	})
	if err != nil {
		return memFile, err
	}
	b, err := ioutil.ReadAll(res.Body)
	if err != nil {
		return memFile, err
	}
	memFile.Write(b)
	return memFile, err
}
func ( s S3Fs ) Open ( name string ) ( afero . File , error ) { memFile , err := s . Create ( getNameFromPath ( name ) ) if err != nil { return nil , err } res , err := s . client . GetObject ( & s3 . GetObjectInput { Bucket : aws . String ( s . Bucket ) , Key : aws . String ( name ) , } ) if err != nil { return memFile , err } b , err := ioutil . ReadAll ( res . Body ) if err != nil { return memFile , err } memFile . Write ( b ) return memFile , err }
Open from s3, and bring down whole file
Open from s3 and bring down whole file