// Open opens the file for read.  Call Close() on the returned io.ReadCloser
Open opens the file for read.  Call Close() on the returned io.ReadCloser
// Open opens the file for read . Call Close () on the returned io . ReadCloser
func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error) {
	bucketInit, err := o.fs.svc.Bucket(o.fs.bucket, o.fs.zone)
	if err != nil {
		return nil, err
	}
	key := o.fs.root + o.remote
	req := qs.GetObjectInput{}
	fs.FixRangeOption(options, o.size)
	for _, option := range options {
		switch option.(type) {
		case *fs.RangeOption, *fs.SeekOption:
			_, value := option.Header()
			req.Range = &value
		default:
			if option.Mandatory() {
				fs.Logf(o, "Unsupported mandatory option: %v", option)
			}
		}
	}
	resp, err := bucketInit.GetObject(key, &req)
	if err != nil {
		return nil, err
	}
	return resp.Body, nil
}
func ( o * Object ) Open ( ctx context . Context , options ... fs . OpenOption ) ( io . ReadCloser , error ) { bucketInit , err := o . fs . svc . Bucket ( o . fs . bucket , o . fs . zone ) if err != nil { return nil , err } key := o . fs . root + o . remote req := qs . GetObjectInput { } fs . FixRangeOption ( options , o . size ) for _ , option := range options { switch option . ( type ) { case * fs . RangeOption , * fs . SeekOption : _ , value := option . Header ( ) req . Range = & value default : if option . Mandatory ( ) { fs . Logf ( o , " " , option ) } } } resp , err := bucketInit . GetObject ( key , & req ) if err != nil { return nil , err } return resp . Body , nil }
Open opens the file for read.
Open opens the file for read .