Example #1
0
func (pl *Plugin) FileReader(path string) (*stream.File, error) {
	fp, err := os.Open(path)
	if err != nil {
		return nil, err
	}
	return stream.NewFile(filepath.Base(path), fp), nil
}
Example #2
0
File: s3.go Project: bluele/stream
func (pl *Plugin) FileReader(path string) (*stream.File, error) {
	bucketName, prefix := splitPath(path)
	ir, err := pl.s3.Bucket(bucketName).GetReader(prefix)
	if err != nil {
		return nil, err
	}
	return stream.NewFile(filepath.Base(prefix), ir), nil
}